/// <summary> /// Konstruktor der Klasse Contact. Erstellt ein neues Objekt Contact aus einem Preview-Objekt. /// </summary> /// <param name="p">Preview-Objekt, aus dem der Kontakt erstellt werden soll</param> public Contact(Preview p) { this.sSaveName = p.sSaveName; this.sName = p.sName; this.sFirstName = p.sFirstName; this.sShowAs = p.sShowAs; this.iGender = p.iGender; this.sNickName = p.sNickName; this.sTitle = p.sTitle; this.dtBirthday = p.dtBirthday; this.sCC1 = p.sCC1; this.sCC2 = p.sCC2; this.sCC3 = p.sCC3; this.sCC4 = p.sCC4; this.iAC1 = p.iAC1; this.iAC2 = p.iAC2; this.iAC3 = p.iAC3; this.iAC4 = p.iAC4; this.sNr1 = p.sNr1; this.sNr2 = p.sNr2; this.sNr3 = p.sNr3; this.sNr4 = p.sNr4; this.sNumberType1 = p.sNumberType1; this.sNumberType2 = p.sNumberType2; this.sNumberType3 = p.sNumberType3; this.sNumberType4 = p.sNumberType4; this.sStreet = p.sStreet; this.sHouseNr = p.sHouseNr; this.sZipCode = p.sZipCode; this.sCity = p.sCity; this.sCountry = p.sCountry; this.sWorkName = p.sWorkName; this.sStreet2 = p.sStreet2; this.sHouseNr2 = p.sHouseNr2; this.sZipCode2 = p.sZipCode2; this.sCity2 = p.sCity2; this.sCountry2 = p.sCountry2; this.sMail1 = p.sMail1; this.sMail2 = p.sMail2; this.sMailType1 = p.sMailType1; this.sMailType2 = p.sMailType2; this.sNotes = p.sNotes; this.sContactImage = ImageToString(p.imgContactImage, p.imgContactImage.RawFormat); }
//Button "Vorschau" private void btnPreview_Click(object sender, EventArgs e) { saveVars(); p = new Preview(sName, sFirstName, sShowAsType, iGender); p.SetGeneralVars(sNickName, sTitle, sBirthday, imgContact); p.SetPhoneNumberVars(sCC1, sCC2, sCC3, sCC4, sAC1, sAC2, sAC3, sAC4, sNr1, sNr2, sNr3, sNr4, sNumberType1, sNumberType2, sNumberType3, sNumberType4); p.SetAddressVars(sStreet, sHouseNumber, sZipCode, sCity, sCountry); p.SetWorkAddressVars(sWorkName, sStreet2, sHouseNumber2, sZipCode2, sCity2, sCountry2); p.SetOtherVars(sEmail1, sEmail2, sEmailType1, sEmailType2, sNotes); if (p.ShowPreview()) { btnSave.Visible = true; btnEdit.Visible = true; btnOpen.Visible = false; btnPreview.Visible = false; tabControlContactInfos.Enabled = false; } }