Example #1
0
        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();
            }
        }
Example #2
0
 public abstract void Store(ContactList list, object descriptor);
Example #3
0
 public void OnDeserialization(object sender)
 {
     Instance = this;
 }
Example #4
0
 public ContactList()
 {
     Instance = this;
 }
Example #5
0
 public Controller()
 {
     ContactList = new ContactList();
     ContactList.Reload();
 }
Example #6
0
 public void OnDeserialization(object sender)
 {
     Instance = this;
 }
Example #7
0
 public ContactList()
 {
     Instance = this;
 }
Example #8
0
 public static void SaveContactList(ContactList cl, string filename)
 {
     Controls.Store<XMLStorageBackend>(cl, filename);
 }
Example #9
0
 public static ContactList CreateContactList()
 {
     ContactList cl = new ContactList();
     return cl;
 }