Beispiel #1
0
        void Initialize()
        {
            //Get top levels
            IDevUIService devUIService = Kernel.Instance.Container.Resolve <Service.DevUIService.IDevUIService>();
            var           topLevels    = devUIService.GetDataBrowserTopLevelElements();

            List <DataBrowserTopLevel> tabsToRemove = new List <DataBrowserTopLevel>();


            //Destroy unneeded toplevels
            foreach (KeyValuePair <DataBrowserTopLevel, GMTab> tab in tabs)
            {
                if (!topLevels.Contains(tab.Key))
                {
                    tabbar.RemoveTab(tab.Value, true);
                    tabsToRemove.Add(tab.Key);
                }
            }

            //Remove from list
            foreach (DataBrowserTopLevel topLevel in tabsToRemove)
            {
                tabs.Remove(topLevel);
            }

            //Spawn missing
            foreach (DataBrowserTopLevel topLevel in topLevels)
            {
                if (!tabs.ContainsKey(topLevel))
                {
                    SpawnTopLevelTab(topLevel);
                }
            }

            tabbar.ActivateFirstTab();

            tabsToRemove.Clear();
        }
        void Initialize()
        {
            //Get top levels
            this.Publish(getTopLevels);

            List <DataBrowserTopLevel> tabsToRemove = new List <DataBrowserTopLevel>();

            //Destroy unneeded toplevels
            foreach (KeyValuePair <DataBrowserTopLevel, GMTab> tab in tabs)
            {
                if (!getTopLevels.result.Contains(tab.Key))
                {
                    tabbar.RemoveTab(tab.Value, true);
                    tabsToRemove.Add(tab.Key);
                }
            }

            //Remove from list
            foreach (DataBrowserTopLevel topLevel in tabsToRemove)
            {
                tabs.Remove(topLevel);
            }

            //Spawn missing
            foreach (DataBrowserTopLevel topLevel in getTopLevels.result)
            {
                if (!tabs.ContainsKey(topLevel))
                {
                    SpawnTopLevelTab(topLevel);
                }
            }

            tabbar.ActivateFirstTab();

            tabsToRemove.Clear();
        }