/// <summary> /// Constructor /// </summary> public PersonalInfo() { _name = new NameInfo(); _address = new AddressInfo(); _phoneNumber = new PhoneNumberInfo(); _ssn = new SSNNumberInfo(); _attachments = new ObservableCollection <AttachmentInfo>(); }
/// <summary> /// Constructor (Deserialize) /// </summary> /// <param name="info"></param> /// <param name="context"></param> public PersonalInfo(SerializationInfo info, StreamingContext context) { _id = (int)info.GetValue("id", typeof(int)); _name = (NameInfo)info.GetValue("na", typeof(NameInfo)); _phoneNumber = (PhoneNumberInfo)info.GetValue("ph", typeof(PhoneNumberInfo)); _address = (AddressInfo)info.GetValue("ad", typeof(AddressInfo)); _ssn = (SSNNumberInfo)info.GetValue("ss", typeof(SSNNumberInfo)); _gender = (string)info.GetValue("ge", typeof(string)); _dateOfBirth = (DateTime)info.GetValue("da", typeof(DateTime)); _dateCreated = (DateTime)info.GetValue("dc", typeof(DateTime)); _dateModified = (DateTime)info.GetValue("dm", typeof(DateTime)); _attachments = TryGetValue <ObservableCollection <AttachmentInfo> >(info, "at"); }
/// <summary> /// Constructor /// </summary> /// <param name="id"></param> /// <param name="name"></param> /// <param name="address"></param> /// <param name="phone"></param> /// <param name="ssn"></param> /// <param name="gender"></param> /// <param name="dob"></param> /// <param name="created"></param> /// <param name="modified"></param> public PersonalInfo( int id, NameInfo name, AddressInfo address, PhoneNumberInfo phone, SSNNumberInfo ssn, string gender, DateTime dob, DateTime created, DateTime modified) { _id = id; _name = name; _address = address; _phoneNumber = phone; _ssn = ssn; _gender = gender; _dateOfBirth = dob; _dateCreated = created; _dateModified = modified; _attachments = new ObservableCollection <AttachmentInfo>(); }