public static SuperView FromStorage(IDecoupledStorage storage, int index) { SuperView superView = new SuperView(); string section = STR_SuperView + index.ToString(); superView.Name = storage.ReadString(section, STR_Name); superView.ActiveFile = storage.ReadString(section, STR_ActiveFile); int docViewCount = storage.ReadInt32(section, STR_DocViewCount); for (int i = 0; i < docViewCount; i++) { DocView newDocView = DocView.FromStorage(storage, section, i); superView.DocViews.Add(newDocView); } return superView; }
private void btnSaveCurrentView_Click(object sender, EventArgs e) { SuperView superView = new SuperView(); Document activeDocument = CodeRush.Documents.Active; // activeDocument.ActiveWindow and foreach (EnvDTE.Window window in activeDocument.Windows) { //window. } if (activeDocument != null) superView.ActiveFile = activeDocument.FullName; foreach (Document document in CodeRush.Documents.AllDocuments) { DocView docView = new DocView(); docView.FileName = document.FullName; TextDocument textDocument = document as TextDocument; if (textDocument != null) { TextView firstView = textDocument.FirstView; if (firstView != null) { docView.TopLine = firstView.TopLine; TextViewSelection activeSelection = firstView.Selection; if (activeSelection != null) { docView.SelectionAnchor = activeSelection.AnchorPosition; docView.SelectionActive = activeSelection.ActivePosition; } } } superView.DocViews.Add(docView); } _AllViews.Add(superView); lstViews.SelectedItem = superView; SaveViews(); }