示例#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();
            }
        }
示例#2
0
 public abstract void Store(ContactList list, object descriptor);
示例#3
0
 public void OnDeserialization(object sender)
 {
     Instance = this;
 }
示例#4
0
 public ContactList()
 {
     Instance = this;
 }
示例#5
0
 public Controller()
 {
     ContactList = new ContactList();
     ContactList.Reload();
 }
示例#6
0
 public void OnDeserialization(object sender)
 {
     Instance = this;
 }
示例#7
0
 public ContactList()
 {
     Instance = this;
 }
示例#8
0
文件: Logic.cs 项目: Ozerich/labs
 public static void SaveContactList(ContactList cl, string filename)
 {
     Controls.Store<XMLStorageBackend>(cl, filename);
 }
示例#9
0
文件: Logic.cs 项目: Ozerich/labs
 public static ContactList CreateContactList()
 {
     ContactList cl = new ContactList();
     return cl;
 }