private void Read() { try { string filename = GetFilename(); if (!File.Exists(filename)) { return; } var bf = new BinaryFormatter(); object data; using (var fs = File.OpenRead(filename)) { data = bf.Deserialize(fs); fs.Close(); } if (data == null || !(data is ArrayList)) { return; } var list = (ArrayList)data; if ((int)list[0] != _version) { return; } _items = (Dictionary <string, object>)list[1]; _storeItems = new StoreItems(_items); } catch { // Ignore exceptions } }
public CommitStoreEventArgs(StoreItems items) { _items = items; }
private Store(int version) { _version = version; _items = new Dictionary <string, object>(); _storeItems = new StoreItems(_items); }
private void Read() { try { string filename = GetFilename(); if (!File.Exists(filename)) { return; } var bf = new BinaryFormatter(); object data; using (var fs = File.OpenRead(filename)) { data = bf.Deserialize(fs); fs.Close(); } if (data == null || !(data is ArrayList)) { return; } var list = (ArrayList)data; if ((int)list[0] != _version) { return; } _items = (Dictionary<string, object>)list[1]; _storeItems = new StoreItems(_items); } catch { // Ignore exceptions } }
private Store(int version) { _version = version; _items = new Dictionary<string, object>(); _storeItems = new StoreItems(_items); }