internal static SheetToken Sheet(Chart chart) { Requires.NotNull(chart, nameof(chart)); return(new SheetToken( id: IdFactory.Sheet(chart), isActive: chart.IsActive(), isVisible: chart.IsVisible(), index: chart.Index, tabColor: chart.TabColor())); }
internal static SheetToken Sheet(Worksheet sheet) { Requires.NotNull(sheet, nameof(sheet)); return(new SheetToken( id: IdFactory.Sheet(sheet), isActive: sheet.IsActive(), isVisible: sheet.IsVisible(), index: sheet.Index, tabColor: sheet.TabColor())); }
internal static WindowToken Window(Window win) { Requires.NotNull(win, nameof(win)); object activeSheet = win.ActiveSheet; Debug.Assert(activeSheet != null); var activeSheetId = activeSheet != null?IdFactory.Sheet(activeSheet) : null; return(new WindowToken( id: IdFactory.Window(win), isActive: win.IsActive(), isVisible: win.Visible, state: ConvertState(win.WindowState), activeSheetId: activeSheetId)); }