예제 #1
0
        private void InitializeWidgetManager()
        {
            foreach (ILayoutPanelElement layoutPanelElement in _widgetManager.GetInitializedViews())
            {
                rootLayout.RootPanel.Children.Add(layoutPanelElement);
            }

            if (File.Exists(_layoutFile))
            {
                List <string> ids     = GetIdentifiersInFile().ToList();
                List <string> widgets = _widgetManager.Widgets
                                        .Select(widget => widget.ContentGuid).ToList();
                bool everthingFound = (ids.Count == widgets.Count) && !widgets.Except(ids).Any();

                if (everthingFound)
                {
                    XmlLayoutSerializer serializer = new XmlLayoutSerializer(dockingManager);
                    serializer.Deserialize(_layoutFile);
                }
            }
        }
        private void InitializeWidgetManager()
        {
            foreach (ILayoutPanelElement layoutPanelElement in _widgetManager.GetInitializedViews())
            {
                rootLayout.RootPanel.Children.Add(layoutPanelElement);
            }

            if (File.Exists(_layoutFile))
            {
                IEnumerable <string> ids = GetIdentifiersInFile();

                bool everthingFound = _widgetManager.Widgets
                                      .Select(widget => ids.Any(id => string.Equals(id, widget.ContentGuid, StringComparison.OrdinalIgnoreCase)))
                                      .All(found => found);

                if (everthingFound)
                {
                    XmlLayoutSerializer serializer = new XmlLayoutSerializer(dockingManager);
                    serializer.Deserialize(_layoutFile);
                }
            }
        }