예제 #1
0
 private ElementTreeItem ConvertItem(GuiElementInfo guiElementInfo)
 {
     return(new ElementTreeItem(guiElementInfo.Id, guiElementInfo.ElementType)
     {
         Children = guiElementInfo.ChildElements?.Any() ?? false?guiElementInfo.ChildElements.Select(ConvertItem).ToArray() : null
     });
 }
예제 #2
0
        private GuiElementInfo BuildGuiElementInfo(IGuiElement guiElement)
        {
            var info = new GuiElementInfo(guiElement.Id, guiElement.GetType().Name);

            info.ChildElements = guiElement.ChildElements.ToArray().Select(BuildGuiElementInfo).ToArray();
            return(info);
        }
예제 #3
0
        private GuiDebuggerElementInfo Convert(GuiElementInfo guiElementInfo)
        {
            var model = _guiDebuggerElementInfoCache.GetFromCacheOrFetch(guiElementInfo.Id, () => new GuiDebuggerElementInfo()
            {
                Id = guiElementInfo.Id
            });

            model.ElementType = guiElementInfo.ElementType;

            if (guiElementInfo.ChildElements != null && guiElementInfo.ChildElements.Any())
            {
                var newChildElements = guiElementInfo.ChildElements.Select(Convert).ToArray();

                //using (model.ChildElements.SuspendChangeNotifications(SuspensionMode.MixedConsolidate))
                {
                    model.ChildElements.Clear();
                    model.ChildElements.AddItems(newChildElements);
                }
            }

            return(model);
        }