Ejemplo n.º 1
0
 public void UpdateInstanceValue(InstanceValue instVal, string descr)
 {
     _instValue                = instVal;
     Title                     = TypeExtractor.GetDisplayableTypeName(instVal.TypeName);
     CollectionInfo.Text       = GuiUtils.GetExtraDataString(instVal.ExtraData as KeyValuePair <string, string>[], instVal.TypeName, instVal.Address);
     KeyValuePairs.ItemsSource = instVal.KeyValuePairs;
 }
Ejemplo n.º 2
0
 public void UpdateInstanceValue(InstanceValue instVal, string descr)
 {
     _instanceValue = instVal;
     Debug.Assert(instVal.ArrayValues != null);
     Title = TypeExtractor.GetDisplayableTypeName(instVal.TypeName);
     CollectionValues.ItemsSource = instVal.ArrayValues;
     CollectionInfo.Text          = descr == null?GuiUtils.GetExtraDataString(instVal.ExtraData as KeyValuePair <string, string>[], instVal.TypeName, instVal.Address) : descr;
 }
Ejemplo n.º 3
0
 public CollectionDisplay(int id, string descr, InstanceValue instVal, bool locked = true)
 {
     _wndType = ValueWindows.WndType.List;
     _id      = id;
     InitializeComponent();
     SetLock(locked);
     UpdateInstanceValue(instVal, descr);
     Title = TypeExtractor.GetDisplayableTypeName(instVal.TypeName);
 }
Ejemplo n.º 4
0
        public void UpdateInstanceValue(InstanceValue instVal, string descr)
        {
            if (instVal.Parent == null)
            {
                Title = TypeExtractor.GetDisplayableTypeName(instVal.TypeName);
            }
            ClassStructInfo.Text = descr;
            var stackPanel = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };
            var textBlk = new TextBlock();

            textBlk.Inlines.Add(instVal.ToString());
            stackPanel.Children.Add(textBlk);
            var tvRoot = new TreeViewItem
            {
                Header = GuiUtils.GetInstanceValueStackPanel(instVal),
                Tag    = instVal
            };

            var que = new Queue <KeyValuePair <InstanceValue, TreeViewItem> >();

            que.Enqueue(new KeyValuePair <InstanceValue, TreeViewItem>(instVal, tvRoot));
            while (que.Count > 0)
            {
                var             info         = que.Dequeue();
                InstanceValue   parentNode   = info.Key;
                TreeViewItem    tvParentNode = info.Value;
                InstanceValue[] descendants  = parentNode.Fields;
                for (int i = 0, icount = descendants.Length; i < icount; ++i)
                {
                    var descNode = descendants[i];
                    var tvNode   = new TreeViewItem
                    {
                        Header = GuiUtils.GetInstanceValueStackPanel(descNode),
                        Tag    = descNode
                    };
                    tvParentNode.Items.Add(tvNode);
                    que.Enqueue(new KeyValuePair <InstanceValue, TreeViewItem>(descNode, tvNode));
                }
            }

            var treeView = InstanceValueTreeview;

            treeView.Items.Clear();
            treeView.Items.Add(tvRoot);
            tvRoot.IsSelected = true;
            tvRoot.ExpandSubtree();
        }
Ejemplo n.º 5
0
 public ContentDisplay(int id, string description, InstanceValue instVal, bool locked = true)
 {
     _wndType = ValueWindows.WndType.Content;
     _id      = id;
     InitializeComponent();
     _wordWrapped        = true;
     _instanceValue      = instVal;
     _lockedImg          = new Image();
     _lockedImg.Source   = ValueWindows.LockedImage.Source;
     _unlockedImg        = new Image();
     _unlockedImg.Source = ValueWindows.UnlockedImage.Source;
     UpdateInstanceValue(instVal, description);
     _locked         = locked;
     LockBtn.Content = locked ? _lockedImg : _unlockedImg;
     Title           = TypeExtractor.GetDisplayableTypeName(instVal.TypeName);
 }
Ejemplo n.º 6
0
 public void UpdateInstanceValue(InstanceValue instVal, string descr)
 {
     Title             = TypeExtractor.GetDisplayableTypeName(instVal.TypeName);
     ContentInfo.Text  = descr;
     ContentValue.Text = instVal.Value.FullContent;
 }