Esempio n. 1
0
        public IEnumerable <object> Load(ISettingsManager settingsManager)
        {
            var section = settingsManager.GetOrCreateSection(SETTINGS_GUID);

            foreach (var o in fileListLoader.Load(section.GetOrCreateSection(FILE_LISTS_SECTION)))
            {
                yield return(o);
            }

            var tgws     = new List <SerializedTabGroupWindow>();
            var tgwsHash = new HashSet <string>();

            foreach (var tgwSection in section.SectionsWithName(TABGROUPWINDOW_SECTION))
            {
                var tgw = SerializedTabGroupWindow.Load(tgwSection);
                yield return(null);

                if (tgwsHash.Contains(tgw.Name))
                {
                    continue;
                }
                tgws.Add(tgw);
            }

            // The files are added to the treeview with a slight delay. Make sure the files have
            // been added to the TV or the node lookup code will fail to find the nodes it needs.
            yield return(LoaderConstants.Delay);

            foreach (var o in fileTabSerializer.Restore(tgws))
            {
                yield return(o);
            }

            fileTabManager.OnTabsLoaded();
        }
Esempio n. 2
0
        public List <SerializedTabGroupWindow> SaveTabs()
        {
            var tgws = new List <SerializedTabGroupWindow>();

            tgws.Add(SerializedTabGroupWindow.Create(fileTabContentFactoryManager, fileTabManager.TabGroupManager, SerializedTabGroupWindow.MAIN_NAME));
            return(tgws);
        }
Esempio n. 3
0
 IEnumerable<DnSpyFileInfo> GetAutoLoadedAssemblies(SerializedTabGroupWindow tgw)
 {
     foreach (var g in tgw.TabGroups) {
         foreach (var t in g.Tabs) {
             foreach (var f in t.AutoLoadedFiles)
                 yield return f;
         }
     }
 }
Esempio n. 4
0
		public static SerializedTabGroupWindow Create(IFileTabContentFactoryManager creator, ITabGroupManager tabGroupManager, string name) {
			int index = tabGroupManager.TabGroups.ToList().IndexOf(tabGroupManager.ActiveTabGroup);
			var stackedContentState = ((TabGroupManager)tabGroupManager).StackedContentState;
			var tgw = new SerializedTabGroupWindow(name, index, tabGroupManager.IsHorizontal, stackedContentState);

			foreach (var g in tabGroupManager.TabGroups)
				tgw.TabGroups.Add(SerializedTabGroup.Create(creator, g));

			return tgw;
		}
Esempio n. 5
0
		public static SerializedTabGroupWindow Load(ISettingsSection section) {
			var name = section.Attribute<string>(NAME_ATTR) ?? MAIN_NAME;
			int index = section.Attribute<int?>(INDEX_ATTR) ?? -1;
			bool isHorizontal = section.Attribute<bool?>(ISHORIZONTAL_ATTR) ?? false;
			var stackedContentState = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(STACKEDCONTENTSTATE_SECTION));
			var tgw = new SerializedTabGroupWindow(name, index, isHorizontal, stackedContentState);

			foreach (var tgSection in section.SectionsWithName(TABGROUP_SECTION))
				tgw.TabGroups.Add(SerializedTabGroup.Load(tgSection));

			return tgw;
		}
Esempio n. 6
0
 IEnumerable <DnSpyFileInfo> GetAutoLoadedAssemblies(SerializedTabGroupWindow tgw)
 {
     foreach (var g in tgw.TabGroups)
     {
         foreach (var t in g.Tabs)
         {
             foreach (var f in t.AutoLoadedFiles)
             {
                 yield return(f);
             }
         }
     }
 }
Esempio n. 7
0
        IEnumerable<object> Load(SerializedTabGroupWindow tgw)
        {
            bool addedAutoLoadedAssembly = false;
            foreach (var f in GetAutoLoadedAssemblies(tgw)) {
                addedAutoLoadedAssembly = true;
                fileTabManager.FileTreeView.FileManager.TryGetOrCreate(f, true);
                yield return null;
            }
            if (addedAutoLoadedAssembly)
                yield return LoaderConstants.Delay;

            foreach (var o in tgw.Restore(fileTabManager, fileTabContentFactoryManager, fileTabManager.TabGroupManager))
                yield return o;
        }
Esempio n. 8
0
        IEnumerable <object> Load(SerializedTabGroupWindow tgw)
        {
            bool addedAutoLoadedAssembly = false;

            foreach (var f in GetAutoLoadedAssemblies(tgw))
            {
                addedAutoLoadedAssembly = true;
                fileTabManager.FileTreeView.FileManager.TryGetOrCreate(f, true);
                yield return(null);
            }
            if (addedAutoLoadedAssembly)
            {
                yield return(LoaderConstants.Delay);
            }

            foreach (var o in tgw.Restore(fileTabManager, fileTabContentFactoryManager, fileTabManager.TabGroupManager))
            {
                yield return(o);
            }
        }
Esempio n. 9
0
        public static SerializedTabGroupWindow Load(ISettingsSection section)
        {
            var name = section.Attribute<string>(NAME_ATTR) ?? MAIN_NAME;
            int index = section.Attribute<int?>(INDEX_ATTR) ?? -1;
            bool isHorizontal = section.Attribute<bool?>(ISHORIZONTAL_ATTR) ?? false;
            var stackedContentState = StackedContentStateSerializer.TryDeserialize(section.GetOrCreateSection(STACKEDCONTENTSTATE_SECTION));
            var tgw = new SerializedTabGroupWindow(name, index, isHorizontal, stackedContentState);

            foreach (var tgSection in section.SectionsWithName(TABGROUP_SECTION))
                tgw.TabGroups.Add(SerializedTabGroup.Load(tgSection));

            return tgw;
        }
Esempio n. 10
0
        public static SerializedTabGroupWindow Create(IFileTabContentFactoryManager creator, ITabGroupManager tabGroupManager, string name)
        {
            int index = tabGroupManager.TabGroups.ToList().IndexOf(tabGroupManager.ActiveTabGroup);
            var stackedContentState = ((TabGroupManager)tabGroupManager).StackedContentState;
            var tgw = new SerializedTabGroupWindow(name, index, tabGroupManager.IsHorizontal, stackedContentState);

            foreach (var g in tabGroupManager.TabGroups)
                tgw.TabGroups.Add(SerializedTabGroup.Create(creator, g));

            return tgw;
        }