public static bool SwitchSheet(string title) { var tmpSheet = launchedSheets.Where(x => x.spreadSheetName.Contains(title)).FirstOrDefault(); CurrentSheet = tmpSheet ?? CurrentSheet; return(tmpSheet != null); }
public static bool SwitchSheet(int id) { var tmpSheet = launchedSheets.Where(x => x.Id == id).FirstOrDefault(); CurrentSheet = tmpSheet ?? CurrentSheet; return(tmpSheet != null); }
public static void Remove(SheetsWrapper wrapper) { var toRemove = launchedSheets.Where(x => x == wrapper).FirstOrDefault(); if (toRemove != null) { Remove(toRemove.Id); } }
public static SheetsWrapper AddSheet() { int assignedId = GetNextId(); SheetsWrapper wrapper = new SheetsWrapper(assignedId); launchedSheets.Add(wrapper); CurrentSheet = wrapper; return(wrapper); }