Пример #1
0
 private void ControlsToData()
 {
     if (contact == null)
         contact = new ManufacturerDataContact();
     contact.email = edtEmail.GetValue<string>();
     contact.name = edtName.GetValue<string>();
     contact.phoneNumber = edtPhone.GetValue<string>();
 }
 public void AddContact(ManufacturerDataContact contact)
 {
     if (manufacturer.Contacts == null)
         manufacturer.Contacts = new List<ManufacturerDataContact>();
     manufacturer.Contacts.Add(contact);
     ListViewItem item = new ListViewItem(contact.name);
     item.SubItems.Add(contact.phoneNumber);
     item.SubItems.Add(contact.email);
     item.Tag = contact;
     Items.Add(item);
 }
Пример #3
0
 public ContactForm( ManufacturerDataContact contact )
 {
     InitializeComponent();
     this.contact = contact;
 }
Пример #4
0
 public ContactForm()
 {
     InitializeComponent();
     contact = new ManufacturerDataContact();
 }
Пример #5
0
 public static bool LoadFromFile(string fileName, out ManufacturerDataContact obj)
 {
     System.Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
Пример #6
0
 /// <summary>
 /// Deserializes xml markup from file into an ManufacturerDataContact object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output ManufacturerDataContact object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out ManufacturerDataContact obj, out System.Exception exception)
 {
     exception = null;
     obj = default(ManufacturerDataContact);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Пример #7
0
 public static bool Deserialize(string input, out ManufacturerDataContact obj)
 {
     System.Exception exception;
     return Deserialize(input, out obj, out exception);
 }
Пример #8
0
 /// <summary>
 /// Deserializes workflow markup into an ManufacturerDataContact object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output ManufacturerDataContact object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out ManufacturerDataContact obj, out System.Exception exception)
 {
     exception = null;
     obj = default(ManufacturerDataContact);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }