public static SpreadSheetRegistrySingleton GetInstance() { if (_instance == null) { lock (_initLock) { if (_instance == null) { _instance = new SpreadSheetRegistrySingleton(); } } } return _instance; }
public static SpreadSheetRegistrySingleton GetInstance() { if (_instance == null) { lock (_initLock) { if (_instance == null) { _instance = new SpreadSheetRegistrySingleton(); } } } return(_instance); }
public static ISpreadSheet Load(string filename) { SimpleSpreadsheet sheet; using (FileStream stream = File.OpenRead(filename)) { BinaryFormatter formatter = new BinaryFormatter(); sheet = (SimpleSpreadsheet)formatter.Deserialize(stream); SpreadSheetRegistrySingleton.GetInstance().RegisterSheet(sheet.Name, sheet); } return(sheet); }
public SimpleSpreadsheet(string name) { this.name = name; SpreadSheetRegistrySingleton.GetInstance().RegisterSheet(name, this); }