예제 #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
파일: Controller.cs 프로젝트: rettour/Labs
 public Controller()
 {
     ContactList = new ContactList();
     ContactList.Reload();
 }
예제 #6
0
파일: ContactList.cs 프로젝트: rettour/Labs
 public void OnDeserialization(object sender)
 {
     Instance = this;
 }
예제 #7
0
파일: ContactList.cs 프로젝트: rettour/Labs
 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;
 }