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; }
// Alt+Home to drop a marker. Escape gets me back. public static DocView FromStorage(IDecoupledStorage storage, string parentSection, int index) { string section = parentSection + STR_DocView + index; DocView newDocView = new DocView(); newDocView.FileName = storage.ReadString(section, STR_FileName); newDocView.SelectionActive = storage.ReadInt32(section, STR_SelectionActive); newDocView.SelectionAnchor = storage.ReadInt32(section, STR_SelectionAnchor); newDocView.TopLine = storage.ReadInt32(section, STR_TopLine); return newDocView; }