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(); }
public List <SerializedTabGroupWindow> SaveTabs() { var tgws = new List <SerializedTabGroupWindow>(); tgws.Add(SerializedTabGroupWindow.Create(fileTabContentFactoryManager, fileTabManager.TabGroupManager, SerializedTabGroupWindow.MAIN_NAME)); return(tgws); }
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; } } }
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; }
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; }
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); } } } }
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; }
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); } }