示例#1
0
        public void RefreshProperties(GuiDebuggerElementInfo elementInfo)
        {
            var propertyInfos = _guiDebuggerService.GetElementPropertyInfos(elementInfo.Id);

            foreach (var existingElementProp in elementInfo.Properties.ToArray())
            {
                if (propertyInfos.All(x => x.Name != existingElementProp.Name))
                {
                    elementInfo.Properties.Remove(existingElementProp);
                }
            }

            foreach (var property in propertyInfos)
            {
                var elementProp = elementInfo.Properties.FirstOrDefault(x => x.Name == property.Name);
                if (elementProp == null)
                {
                    elementProp = new GuiDebuggerElementPropertyInfo()
                    {
                        Name = property.Name
                    };

                    elementInfo.Properties.Add(elementProp);
                }

                elementProp.Value = property.Value;
            }
        }
示例#2
0
        private void GuiDebuggerElementInfoSelectionManagerOnSelectionChanged(object sender, SelectionChangedEventArgs <GuiDebuggerElementInfo> e)
        {
            ElementInfo = _guiDebuggerElementInfoSelectionManager.GetSelectedItem();

            if (ElementInfo != null)
            {
                _guiDebugDataService.RefreshProperties(ElementInfo);
                _guiDebugDataService.HighlightGuiElement(ElementInfo);
            }
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ElementInspectorViewModel"/> class.
        /// </summary>
        public ElementInspectorViewModel(IGuiDebugDataService guiDebugDataService, ISelectionManager <GuiDebuggerElementInfo> guiDebuggerElementInfoSelectionManager)
        {
            _guiDebugDataService = guiDebugDataService;
            _guiDebuggerElementInfoSelectionManager = guiDebuggerElementInfoSelectionManager;
            _guiDebuggerElementInfoSelectionManager.SelectionChanged += GuiDebuggerElementInfoSelectionManagerOnSelectionChanged;

            Title = "Element Inspector";

            ElementInfo = _guiDebuggerElementInfoSelectionManager.GetSelectedItem();
        }
示例#4
0
 public void HighlightGuiElement(GuiDebuggerElementInfo elementInfo)
 {
     _guiDebuggerService.HighlightGuiElement(elementInfo.Id);
 }