public override void Store(ContactList list, object descriptor) { FileStream fs = null; try { fs = File.Open(descriptor as string, FileMode.Create); } catch { throw new ArgumentException("Invalid file name"); } try { DataContractSerializer dcs = new DataContractSerializer(typeof(ContactList)); dcs.WriteObject(fs, list); } finally { fs.Close(); } }
public abstract void Store(ContactList list, object descriptor);
public void OnDeserialization(object sender) { Instance = this; }
public ContactList() { Instance = this; }
public Controller() { ContactList = new ContactList(); ContactList.Reload(); }
public static void SaveContactList(ContactList cl, string filename) { Controls.Store<XMLStorageBackend>(cl, filename); }
public static ContactList CreateContactList() { ContactList cl = new ContactList(); return cl; }