-
Notifications
You must be signed in to change notification settings - Fork 0
/
AjouterContact.xaml.cs
58 lines (46 loc) · 1.66 KB
/
AjouterContact.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.IO.IsolatedStorage;
namespace agenda
{
public partial class AjouterContact : PhoneApplicationPage
{
private ListeContacts listeContact;
public AjouterContact()
{
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
if (store.FileExists("Agenda/contact.xml"))
{
using (IsolatedStorageFileStream fileStream = store.OpenFile("Agenda/contact.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read))
{
XmlSerializer serializer = new XmlSerializer(typeof(ListeContacts));
listeContact = serializer.Deserialize(fileStream) as ListeContacts;
}
}
else
listeContact = new ListeContacts();
}
InitializeComponent();
}
private void BT_Enregistrer_Click(object sender, RoutedEventArgs e)
{
// Contact contactCourant = new Contact(Nom.Text.ToString(), Prenom.Text.ToString(), Email.Text.ToString(), Mobile.Text.ToString());
listeContact.Items.Add(new Contact { Nom = textBox_Nom.Text.ToString(), Prenom = textBox_Prenom.Text.ToString(), Email = textBox_eMail.Text.ToString(), Mobile = textBox_Mobile.Text.ToString() });
// listeContact.AjouterContact(contactCourant);
listeContact.Sauvegarder();
}
private void SubAjouterContact(string nom, string prenom, string mobile, string eMail)
{
}
}
}