summaryrefslogtreecommitdiff
path: root/Source/ModelViewer/BaseProvider.cs
diff options
context:
space:
mode:
authorGravatar MichalMoskal <unknown>2010-10-14 21:45:03 +0000
committerGravatar MichalMoskal <unknown>2010-10-14 21:45:03 +0000
commitfe8c2be3f0d21c75981f16c76003148300a917ec (patch)
tree422d7e0557aff02d8ef58c01a1c7ee937bf226a2 /Source/ModelViewer/BaseProvider.cs
parent692e5686954c0c6184f1d29a39cdbb4fb1be1760 (diff)
Add DisplayNode class with default IDisplayNode implementation. Add IDisplayNode.State.
Diffstat (limited to 'Source/ModelViewer/BaseProvider.cs')
-rw-r--r--Source/ModelViewer/BaseProvider.cs35
1 files changed, 8 insertions, 27 deletions
diff --git a/Source/ModelViewer/BaseProvider.cs b/Source/ModelViewer/BaseProvider.cs
index e2d82fd9..a4c61589 100644
--- a/Source/ModelViewer/BaseProvider.cs
+++ b/Source/ModelViewer/BaseProvider.cs
@@ -24,54 +24,40 @@ namespace Microsoft.Boogie.ModelViewer.Base
}
}
- public class StateNode : IDisplayNode
+ public class StateNode : DisplayNode
{
protected Model.CapturedState state;
- public StateNode(Model.CapturedState s)
+ public StateNode(Model.CapturedState s) : base(s.Name)
{
state = s;
}
- public virtual string Name
- {
- get { return state.Name; }
- }
-
- public virtual IEnumerable<string> Values
+ public override IEnumerable<string> Values
{
get { foreach (var v in state.Variables) yield return v; }
}
- public virtual bool Expandable { get { return state.VariableCount != 0; } }
+ public override bool Expandable { get { return state.VariableCount != 0; } }
- public virtual IEnumerable<IDisplayNode> Expand()
+ public override IEnumerable<IDisplayNode> Expand()
{
foreach (var v in state.Variables) {
yield return new ElementNode(v, state.TryGet(v));
}
}
-
- public object ViewSync { get; set; }
}
- public class ElementNode : IDisplayNode
+ public class ElementNode : DisplayNode
{
protected Model.Element elt;
- protected string name;
- public ElementNode(string name, Model.Element elt)
+ public ElementNode(string name, Model.Element elt) : base(name)
{
- this.name = name;
this.elt = elt;
}
- public virtual string Name
- {
- get { return name; }
- }
-
- public virtual IEnumerable<string> Values
+ public override IEnumerable<string> Values
{
get
{
@@ -83,11 +69,6 @@ namespace Microsoft.Boogie.ModelViewer.Base
}
}
}
-
- public virtual bool Expandable { get { return false; } }
- public virtual IEnumerable<IDisplayNode> Expand() { yield break; }
-
- public object ViewSync { get; set; }
}
public static class GenericNodes