/// <summary> /// Return Serialized String version of [data] Object /// </summary> /// <param name="data">as PhoneNumber</param> /// <returns></returns> /// <remarks></remarks> private static string XMLSerializeToString(ContactCard data) { try { XmlSerializer xmlSer = new XmlSerializer(typeof(PhoneNumber)); MemoryStream ms = new MemoryStream(); StreamReader strReader = default(StreamReader); string output = null; xmlSer.Serialize(ms, data); ms.Position = 0; strReader = new StreamReader(ms); output = strReader.ReadToEnd(); return output; } catch (Exception ex) { GetLastError = ex; return null; } }
/// <summary> /// Set MyBase to values of [data] /// </summary> /// <param name="data">as contact card</param> /// <returns></returns> internal bool SetBase(ContactCard data) { try { CNTID = data.CNTID; Type = data.Type; Title = data.Title; FirstName = data.FirstName; LastName = data.LastName; MiddleName = data.MiddleName; Suffix = data.Suffix; Organization = data.Organization; Avatar = data.Avatar; ShowInGlobalAddressList = data.ShowInGlobalAddressList; Department = data.Department; InternalNo = data.InternalNo; ExternalNo = data.ExternalNo; Notes = data.Notes; Title_FR = data.Title_FR; FirstName_FR = data.FirstName_FR; LastName_FR = data.LastName_FR; MiddleName_FR = data.MiddleName_FR; Suffix_FR = data.Suffix_FR; Organization_FR = data.Organization_FR; Department_FR = data.Department_FR; Notes_FR = data.Notes_FR; ZIndex = data.ZIndex; Emails = data.Emails; PhoneNumbers = data.PhoneNumbers; Addresses = data.Addresses; return true; } catch (Exception ex) { GetLastError = ex; throw ex; } }