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);
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public SimpleSpreadsheet(string name)
 {
     this.name = name;
     SpreadSheetRegistrySingleton.GetInstance().RegisterSheet(name, this);
 }