diff --git a/vCardEditor/Presenter/MainPresenter.cs b/vCardEditor/Presenter/MainPresenter.cs index 06cccb5..1964e96 100644 --- a/vCardEditor/Presenter/MainPresenter.cs +++ b/vCardEditor/Presenter/MainPresenter.cs @@ -8,6 +8,7 @@ using vCardEditor.Model; using System.Linq; using System.IO; using System.Drawing; +using System.Collections.Generic; namespace VCFEditor.Presenter { @@ -33,7 +34,26 @@ namespace VCFEditor.Presenter _view.CloseForm += CloseForm; _view.ModifyImage += ModifyImage; _view.ExportImage += ExportImage; + _view.AddressAdded += _view_AddressAdded; + _view.AddressRemoved += _view_AddressRemoved; + + } + + private void _view_AddressRemoved(object sender, EventArg e) + { + var contact = _repository.Contacts[_view.SelectedContactIndex]; + _repository.SetDirtyFlag(_view.SelectedContactIndex); + + contact.card.DeliveryAddresses.RemoveAt(e.Data); + } + + private void _view_AddressAdded(object sender, EventArg> e) + { + var contact = _repository.Contacts[_view.SelectedContactIndex]; + _repository.SetDirtyFlag(_view.SelectedContactIndex); + + contact.card.DeliveryAddresses.Add(new vCardDeliveryAddress( e.Data)); } private void ExportImage(object sender, EventArgs e) diff --git a/vCardEditor/Repository/ContactRepository.cs b/vCardEditor/Repository/ContactRepository.cs index 8252bbd..22d3bc6 100644 --- a/vCardEditor/Repository/ContactRepository.cs +++ b/vCardEditor/Repository/ContactRepository.cs @@ -65,7 +65,7 @@ namespace VCFEditor.Repository } } - + OriginalContactList = Contacts; return Contacts; } @@ -135,7 +135,7 @@ namespace VCFEditor.Repository if (_contacts[i].isSelected) { _contacts[i].isDeleted = true; - _contacts[i].isDirty = true; + SetDirtyFlag(i); _contacts.RemoveAt(i); } @@ -342,7 +342,7 @@ namespace VCFEditor.Repository { if (index > -1) { - _contacts[index].isDirty = true; + SetDirtyFlag(index); _contacts[index].card.Photos.Clear(); if (photo != null) _contacts[index].card.Photos.Add(photo); diff --git a/vCardEditor/Thought.vCards/vCardDeliveryAddress.cs b/vCardEditor/Thought.vCards/vCardDeliveryAddress.cs index 204b541..a516f63 100644 --- a/vCardEditor/Thought.vCards/vCardDeliveryAddress.cs +++ b/vCardEditor/Thought.vCards/vCardDeliveryAddress.cs @@ -25,6 +25,8 @@ namespace Thought.vCards private string postalCode; private string region; private string street; + private string postOfficeBox; + private string extendedAddress; /// @@ -37,6 +39,8 @@ namespace Thought.vCards this.postalCode = string.Empty; this.region = string.Empty; this.street = string.Empty; + this.postOfficeBox = string.Empty; + this.extendedAddress = string.Empty; this.addressType = new List(); } @@ -50,7 +54,22 @@ namespace Thought.vCards Street = street; } + public vCardDeliveryAddress(string street, string city, string region, string country, string postalCode, string extendedAddress, string postOfficeBox, vCardDeliveryAddressTypes addressType) + { + AddressType = new List() { addressType }; + City = city; + Country = country; + PostalCode = postalCode; + Region = region; + Street = street; + ExtendedAddress = extendedAddress; + PostOfficeBox= postOfficeBox; + } + public vCardDeliveryAddress(List addressType) + { + AddressType = addressType ; + } /// /// The type of postal address. @@ -230,6 +249,28 @@ namespace Thought.vCards } } + public string ExtendedAddress + { + get + { + return this.extendedAddress ?? string.Empty; + } + set + { + this.extendedAddress = value; + } + } + public string PostOfficeBox + { + get + { + return this.postOfficeBox ?? string.Empty; + } + set + { + this.postOfficeBox = value; + } + } } } \ No newline at end of file diff --git a/vCardEditor/Thought.vCards/vCardStandardReader.cs b/vCardEditor/Thought.vCards/vCardStandardReader.cs index 90a867c..d1e3e1d 100644 --- a/vCardEditor/Thought.vCards/vCardStandardReader.cs +++ b/vCardEditor/Thought.vCards/vCardStandardReader.cs @@ -1225,6 +1225,12 @@ namespace Thought.vCards if (addressParts.Length >= 3) deliveryAddress.Street = addressParts[2].Trim(); + if (addressParts.Length >= 1) + deliveryAddress.ExtendedAddress = addressParts[1].Trim(); + + if (addressParts.Length >= 0) + deliveryAddress.PostOfficeBox = addressParts[0].Trim(); + if ( (string.IsNullOrEmpty(deliveryAddress.City)) && (string.IsNullOrEmpty(deliveryAddress.Country)) && @@ -1661,6 +1667,7 @@ namespace Thought.vCards // often consist of binary data. vCardCertificate certificate = new vCardCertificate(); + certificate.Data = (byte[])property.Value; // TODO: Support other key types. diff --git a/vCardEditor/View/Customs/AddAddress.Designer.cs b/vCardEditor/View/Customs/AddAddress.Designer.cs new file mode 100644 index 0000000..2b1fba0 --- /dev/null +++ b/vCardEditor/View/Customs/AddAddress.Designer.cs @@ -0,0 +1,165 @@ + +namespace vCardEditor.View.Customs +{ + partial class AddAddress + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.cbHome = new System.Windows.Forms.CheckBox(); + this.cbWork = new System.Windows.Forms.CheckBox(); + this.cbPostal = new System.Windows.Forms.CheckBox(); + this.cbDomestic = new System.Windows.Forms.CheckBox(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.cbInternational = new System.Windows.Forms.CheckBox(); + this.cbCustom = new System.Windows.Forms.CheckBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // cbHome + // + this.cbHome.AutoSize = true; + this.cbHome.Location = new System.Drawing.Point(12, 12); + this.cbHome.Name = "cbHome"; + this.cbHome.Size = new System.Drawing.Size(67, 21); + this.cbHome.TabIndex = 0; + this.cbHome.Text = "Home"; + this.cbHome.UseVisualStyleBackColor = true; + // + // cbWork + // + this.cbWork.AutoSize = true; + this.cbWork.Location = new System.Drawing.Point(12, 40); + this.cbWork.Name = "cbWork"; + this.cbWork.Size = new System.Drawing.Size(63, 21); + this.cbWork.TabIndex = 1; + this.cbWork.Text = "Work"; + this.cbWork.UseVisualStyleBackColor = true; + // + // cbPostal + // + this.cbPostal.AutoSize = true; + this.cbPostal.Location = new System.Drawing.Point(12, 67); + this.cbPostal.Name = "cbPostal"; + this.cbPostal.Size = new System.Drawing.Size(69, 21); + this.cbPostal.TabIndex = 2; + this.cbPostal.Text = "Postal"; + this.cbPostal.UseVisualStyleBackColor = true; + // + // cbDomestic + // + this.cbDomestic.AutoSize = true; + this.cbDomestic.Location = new System.Drawing.Point(12, 94); + this.cbDomestic.Name = "cbDomestic"; + this.cbDomestic.Size = new System.Drawing.Size(88, 21); + this.cbDomestic.TabIndex = 3; + this.cbDomestic.Text = "Domestic"; + this.cbDomestic.UseVisualStyleBackColor = true; + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Location = new System.Drawing.Point(95, 187); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 7; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnCancel + // + this.btnCancel.CausesValidation = false; + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(176, 187); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 8; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // cbInternational + // + this.cbInternational.AutoSize = true; + this.cbInternational.Location = new System.Drawing.Point(12, 121); + this.cbInternational.Name = "cbInternational"; + this.cbInternational.Size = new System.Drawing.Size(108, 21); + this.cbInternational.TabIndex = 9; + this.cbInternational.Text = "International"; + this.cbInternational.UseVisualStyleBackColor = true; + // + // cbCustom + // + this.cbCustom.AutoSize = true; + this.cbCustom.Location = new System.Drawing.Point(12, 148); + this.cbCustom.Name = "cbCustom"; + this.cbCustom.Size = new System.Drawing.Size(81, 21); + this.cbCustom.TabIndex = 10; + this.cbCustom.Text = "Custom:"; + this.cbCustom.UseVisualStyleBackColor = true; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(90, 149); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(161, 22); + this.textBox1.TabIndex = 11; + // + // AddAddress + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(263, 223); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.cbCustom); + this.Controls.Add(this.cbInternational); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.cbDomestic); + this.Controls.Add(this.cbPostal); + this.Controls.Add(this.cbWork); + this.Controls.Add(this.cbHome); + this.Name = "AddAddress"; + this.Text = "Address Type"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox cbHome; + private System.Windows.Forms.CheckBox cbWork; + private System.Windows.Forms.CheckBox cbPostal; + private System.Windows.Forms.CheckBox cbDomestic; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.CheckBox cbInternational; + private System.Windows.Forms.CheckBox cbCustom; + private System.Windows.Forms.TextBox textBox1; + } +} \ No newline at end of file diff --git a/vCardEditor/View/Customs/AddAddress.cs b/vCardEditor/View/Customs/AddAddress.cs new file mode 100644 index 0000000..329c817 --- /dev/null +++ b/vCardEditor/View/Customs/AddAddress.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Thought.vCards; + +namespace vCardEditor.View.Customs +{ + public partial class AddAddress : Form + { + public List Addresses { get;} + private readonly List _checkBoxes; + + public AddAddress() + { + InitializeComponent(); + + _checkBoxes = Controls.OfType().ToList(); + Addresses = new List(); + } + + public AddAddress(List addressCollection) + { + InitializeComponent(); + + _checkBoxes = Controls.OfType().ToList(); + + foreach (var item in addressCollection) + { + switch (item.ToString()) + { + case "Home": + cbHome.Checked = true; + break; + + case "Work": + cbWork.Checked = true; + break; + + case "Postal": + cbPostal.Checked = true; + break; + + case "Domestic": + cbDomestic.Checked = true; + break; + + case "International": + cbInternational.Checked = true; + break; + case "Default": + cbCustom.Checked = true; + break; + + } + } + } + + private void btnOK_Click(object sender, EventArgs e) + { + var total = _checkBoxes + .Where(checkBox => checkBox.Checked); + + if (total.Count() == 0) + { + MessageBox.Show("One item must be checked!"); + DialogResult = DialogResult.None; + return; + } + + + + foreach (var item in total) + { + var enumType = (vCardDeliveryAddressTypes)Enum.Parse(typeof(vCardDeliveryAddressTypes), item.Text, true); + Addresses.Add(enumType); + } + + + } + + } +} diff --git a/vCardEditor/View/Customs/AddAddress.resx b/vCardEditor/View/Customs/AddAddress.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/vCardEditor/View/Customs/AddAddress.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/vCardEditor/View/Customs/AddressBox.Designer.cs b/vCardEditor/View/Customs/AddressBox.Designer.cs new file mode 100644 index 0000000..ce48538 --- /dev/null +++ b/vCardEditor/View/Customs/AddressBox.Designer.cs @@ -0,0 +1,252 @@ + +namespace vCardEditor.View.Customs +{ + partial class AddressBox + { + /// + /// Variable nécessaire au concepteur. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Nettoyage des ressources utilisées. + /// + /// true si les ressources managées doivent être supprimées ; sinon, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Code généré par le Concepteur de composants + + /// + /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas + /// le contenu de cette méthode avec l'éditeur de code. + /// + private void InitializeComponent() + { + this.ExtAddrValue = new vCardEditor.View.StateTextBox(); + this.ExtAdressLabel = new System.Windows.Forms.Label(); + this.StreetLabel = new System.Windows.Forms.Label(); + this.StreetValue = new vCardEditor.View.StateTextBox(); + this.POBoxLabel = new System.Windows.Forms.Label(); + this.CountryValue = new vCardEditor.View.StateTextBox(); + this.Country = new System.Windows.Forms.Label(); + this.POBoxValue = new vCardEditor.View.StateTextBox(); + this.CityLabel = new System.Windows.Forms.Label(); + this.RegionValue = new vCardEditor.View.StateTextBox(); + this.CityValue = new vCardEditor.View.StateTextBox(); + this.StateLabel = new System.Windows.Forms.Label(); + this.ZipLabel = new System.Windows.Forms.Label(); + this.ZipValue = new vCardEditor.View.StateTextBox(); + this.SuspendLayout(); + // + // ExtAddrValue + // + this.ExtAddrValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.ExtAddrValue.Location = new System.Drawing.Point(90, 45); + this.ExtAddrValue.Margin = new System.Windows.Forms.Padding(4); + this.ExtAddrValue.Name = "ExtAddrValue"; + this.ExtAddrValue.oldText = null; + this.ExtAddrValue.Size = new System.Drawing.Size(237, 22); + this.ExtAddrValue.TabIndex = 27; + this.ExtAddrValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.ExtAddrValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // ExtAdressLabel + // + this.ExtAdressLabel.Location = new System.Drawing.Point(1, 42); + this.ExtAdressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.ExtAdressLabel.Name = "ExtAdressLabel"; + this.ExtAdressLabel.Size = new System.Drawing.Size(87, 23); + this.ExtAdressLabel.TabIndex = 26; + this.ExtAdressLabel.Text = "Ext Address:"; + this.ExtAdressLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // StreetLabel + // + this.StreetLabel.Location = new System.Drawing.Point(2, 14); + this.StreetLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.StreetLabel.Name = "StreetLabel"; + this.StreetLabel.Size = new System.Drawing.Size(65, 23); + this.StreetLabel.TabIndex = 14; + this.StreetLabel.Text = "Address:"; + this.StreetLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // StreetValue + // + this.StreetValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.StreetValue.Location = new System.Drawing.Point(90, 14); + this.StreetValue.Margin = new System.Windows.Forms.Padding(4); + this.StreetValue.Name = "StreetValue"; + this.StreetValue.oldText = ""; + this.StreetValue.Size = new System.Drawing.Size(613, 22); + this.StreetValue.TabIndex = 15; + this.StreetValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.StreetValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // POBoxLabel + // + this.POBoxLabel.Location = new System.Drawing.Point(334, 75); + this.POBoxLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.POBoxLabel.Name = "POBoxLabel"; + this.POBoxLabel.Size = new System.Drawing.Size(59, 23); + this.POBoxLabel.TabIndex = 16; + this.POBoxLabel.Text = "PO Box:"; + this.POBoxLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + + // + // CountryValue + // + this.CountryValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.CountryValue.Location = new System.Drawing.Point(579, 76); + this.CountryValue.Margin = new System.Windows.Forms.Padding(4); + this.CountryValue.Name = "CountryValue"; + this.CountryValue.oldText = null; + this.CountryValue.Size = new System.Drawing.Size(125, 22); + this.CountryValue.TabIndex = 25; + this.CountryValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.CountryValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // Country + // + this.Country.Location = new System.Drawing.Point(505, 76); + this.Country.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.Country.Name = "Country"; + this.Country.Size = new System.Drawing.Size(65, 23); + this.Country.TabIndex = 24; + this.Country.Text = "Country:"; + this.Country.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // POBoxValue + // + this.POBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.POBoxValue.Location = new System.Drawing.Point(397, 75); + this.POBoxValue.Margin = new System.Windows.Forms.Padding(4); + this.POBoxValue.Name = "POBoxValue"; + this.POBoxValue.oldText = null; + this.POBoxValue.Size = new System.Drawing.Size(100, 22); + this.POBoxValue.TabIndex = 17; + this.POBoxValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.POBoxValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // CityLabel + // + this.CityLabel.Location = new System.Drawing.Point(338, 45); + this.CityLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.CityLabel.Name = "CityLabel"; + this.CityLabel.Size = new System.Drawing.Size(32, 23); + this.CityLabel.TabIndex = 18; + this.CityLabel.Text = "City:"; + this.CityLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // RegionValue + // + this.RegionValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.RegionValue.Location = new System.Drawing.Point(90, 75); + this.RegionValue.Margin = new System.Windows.Forms.Padding(4); + this.RegionValue.Name = "RegionValue"; + this.RegionValue.oldText = null; + this.RegionValue.Size = new System.Drawing.Size(236, 22); + this.RegionValue.TabIndex = 23; + this.RegionValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.RegionValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // CityValue + // + this.CityValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.CityValue.Location = new System.Drawing.Point(397, 45); + this.CityValue.Margin = new System.Windows.Forms.Padding(4); + this.CityValue.Name = "CityValue"; + this.CityValue.oldText = null; + this.CityValue.Size = new System.Drawing.Size(127, 22); + this.CityValue.TabIndex = 19; + this.CityValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.CityValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // StateLabel + // + this.StateLabel.Location = new System.Drawing.Point(17, 74); + this.StateLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.StateLabel.Name = "StateLabel"; + this.StateLabel.Size = new System.Drawing.Size(61, 23); + this.StateLabel.TabIndex = 22; + this.StateLabel.Text = "Region:"; + this.StateLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // ZipLabel + // + this.ZipLabel.Location = new System.Drawing.Point(533, 45); + this.ZipLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.ZipLabel.Name = "ZipLabel"; + this.ZipLabel.Size = new System.Drawing.Size(37, 23); + this.ZipLabel.TabIndex = 20; + this.ZipLabel.Text = "Zip:"; + this.ZipLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // ZipValue + // + this.ZipValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.ZipValue.Location = new System.Drawing.Point(579, 46); + this.ZipValue.Margin = new System.Windows.Forms.Padding(4); + this.ZipValue.Name = "ZipValue"; + this.ZipValue.oldText = null; + this.ZipValue.Size = new System.Drawing.Size(124, 22); + this.ZipValue.TabIndex = 21; + this.ZipValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.ZipValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // AddressBox + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.ExtAddrValue); + this.Controls.Add(this.ExtAdressLabel); + this.Controls.Add(this.StreetLabel); + this.Controls.Add(this.StreetValue); + this.Controls.Add(this.POBoxLabel); + this.Controls.Add(this.CountryValue); + this.Controls.Add(this.Country); + this.Controls.Add(this.POBoxValue); + this.Controls.Add(this.CityLabel); + this.Controls.Add(this.RegionValue); + this.Controls.Add(this.CityValue); + this.Controls.Add(this.StateLabel); + this.Controls.Add(this.ZipLabel); + this.Controls.Add(this.ZipValue); + this.Name = "AddressBox"; + this.Size = new System.Drawing.Size(706, 104); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + internal StateTextBox ExtAddrValue; + internal System.Windows.Forms.Label ExtAdressLabel; + internal System.Windows.Forms.Label StreetLabel; + internal StateTextBox StreetValue; + internal System.Windows.Forms.Label POBoxLabel; + internal StateTextBox CountryValue; + internal System.Windows.Forms.Label Country; + internal StateTextBox POBoxValue; + internal System.Windows.Forms.Label CityLabel; + internal StateTextBox RegionValue; + internal StateTextBox CityValue; + internal System.Windows.Forms.Label StateLabel; + internal System.Windows.Forms.Label ZipLabel; + internal StateTextBox ZipValue; + } +} diff --git a/vCardEditor/View/Customs/AddressBox.cs b/vCardEditor/View/Customs/AddressBox.cs new file mode 100644 index 0000000..896418b --- /dev/null +++ b/vCardEditor/View/Customs/AddressBox.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using Thought.vCards; + +namespace vCardEditor.View.Customs +{ + public partial class AddressBox : UserControl + { + public event EventHandler TextChangedEvent; + public List AddressType { get; set; } + + + public AddressBox(string street, string city, string region, string country, string postalCode, + string extendedAddress, string postOfficeBox, List addressType) + { + InitializeComponent(); + + this.AddressType = addressType; + CityValue.Text = city; + CityValue.oldText = city; + + CountryValue.Text = country; + CountryValue.oldText = country; + + ZipValue.Text = postalCode; + ZipValue.oldText = postalCode; + + RegionValue.Text = region; + RegionValue.oldText = region; + + StreetValue.Text = street; + StreetValue.oldText = street; + + ExtAddrValue.Text = extendedAddress; + ExtAddrValue.oldText = extendedAddress; + + POBoxValue.Text = postOfficeBox; + POBoxValue.oldText = postOfficeBox; + } + + private void Value_TextChanged(object sender, EventArgs e) + { + TextChangedEvent?.Invoke(sender, e); + } + + public vCardDeliveryAddress getDeliveryAddress() + { + var deliveryAddress = new vCardDeliveryAddress + { + City = CityValue.Text, + Country = CountryValue.Text, + PostalCode = ZipValue.Text, + Region = RegionValue.Text, + Street = StreetValue.Text, + ExtendedAddress = ExtAddrValue.Text, + PostOfficeBox = POBoxValue.Text, + AddressType = AddressType + }; + + return deliveryAddress; + } + + } +} diff --git a/vCardEditor/View/Customs/AddressBox.resx b/vCardEditor/View/Customs/AddressBox.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/vCardEditor/View/Customs/AddressBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/vCardEditor/View/Customs/AddressTabControl.cs b/vCardEditor/View/Customs/AddressTabControl.cs index 0443eff..f6592cc 100644 --- a/vCardEditor/View/Customs/AddressTabControl.cs +++ b/vCardEditor/View/Customs/AddressTabControl.cs @@ -1,32 +1,83 @@ using System; +using System.Collections.Generic; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; +using Thought.vCards; +using VCFEditor.View; namespace vCardEditor.View.Customs { class AddressTabControl : TabControl { + + + public event EventHandler TextChangedEvent; + public event EventHandler>> AddTab; + public event EventHandler> RemoveTab; + //public event EventHandler> ModifyTab; + public AddressTabControl() { - Padding = new Point(12, 4); - + Padding = new Point(20, 20); + ShowToolTips = true; DrawMode = TabDrawMode.OwnerDrawFixed; + DrawItem += tbcAddress_DrawItem; MouseDown += tbcAddress_MouseDown; Selecting += tbcAddress_Selecting; - HandleCreated += tbcAddress_HandleCreated; + HandleCreated += tabControl1_HandleCreated; + MouseDoubleClick += AddressTabControl_MouseDoubleClick; + + + } + public void getDeliveryAddress(vCard card) + { + if (TabCount < 2) + return; + + card.DeliveryAddresses.Clear(); + + for (int i = 0; i < TabCount - 1; i++) + { + AddressBox adr = TabPages[i].Controls[0] as AddressBox; + card.DeliveryAddresses.Add(adr.getDeliveryAddress()); + } + } + + private void AddressTabControl_MouseDoubleClick(object sender, MouseEventArgs e) + { + //NOT IMPLEMENTED + //TabPage checkTab; + //for (int i = 0; i < TabPages.Count; ++i) + //{ + // if (GetTabRect(i).Contains(e.Location)) + // { + // var AddressBox = TabPages[i].Controls[0] as AddressBox; + + // var diag = new AddAddress(AddressBox.AddressType); + // diag.ShowDialog(); + // //if (diag.ShowDialog() == DialogResult.OK) + // // _card.DeliveryAddresses[i].AddressType = diag.Addresses; + // //ModifyTab?.Invoke(sender, new EventArg(checkTab)); + // break; + // } + //} + + } + + [DllImport("user32.dll")] private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); private const int TCM_SETMINTABWIDTH = 0x1300 + 49; - - private void tbcAddress_HandleCreated(object sender, EventArgs e) + private void tabControl1_HandleCreated(object sender, EventArgs e) { SendMessage(Handle, TCM_SETMINTABWIDTH, IntPtr.Zero, (IntPtr)16); } + private void tbcAddress_Selecting(object sender, TabControlCancelEventArgs e) { if (e.TabPageIndex == TabCount - 1) @@ -39,9 +90,15 @@ namespace vCardEditor.View.Customs var lastIndex = TabCount - 1; if (GetTabRect(lastIndex).Contains(e.Location)) { - TabPages.Insert(lastIndex, "New Tab"); - SelectedIndex = lastIndex; - + var diag = new AddAddress(); + if (diag.ShowDialog() == DialogResult.OK) + { + vCardDeliveryAddress da = new vCardDeliveryAddress(); + da.AddressType = diag.Addresses; + AddtabForAddress(da); + AddTab?.Invoke(sender, new EventArg>(diag.Addresses)); + } + SelectedIndex = TabCount - 1; } else { @@ -53,22 +110,36 @@ namespace vCardEditor.View.Customs var imageRect = new Rectangle( (tabRect.Right - closeImage.Width), tabRect.Top + (tabRect.Height - closeImage.Height) / 2, - closeImage.Width, - closeImage.Height); + closeImage.Width, closeImage.Height); + if (imageRect.Contains(e.Location)) { - TabPages.RemoveAt(i); - break; + var result = MessageBox.Show("Remove tab?", "Asking", MessageBoxButtons.YesNo); + if (result == DialogResult.Yes) + { + TabPages.RemoveAt(i); + SelectedIndex = 0; + RemoveTab?.Invoke(sender, new EventArg(i)); + + } + return; } + } + } } + + private void tbcAddress_DrawItem(object sender, DrawItemEventArgs e) { - var tabPage = TabPages[e.Index]; + if (e.Index > TabCount - 1) + return; + var tabRect = GetTabRect(e.Index); tabRect.Inflate(-2, -2); + if (e.Index == TabCount - 1) { var addImage = Properties.Resources.Add; @@ -82,10 +153,72 @@ namespace vCardEditor.View.Customs e.Graphics.DrawImage(closeImage, (tabRect.Right - closeImage.Width), tabRect.Top + (tabRect.Height - closeImage.Height) / 2); - TextRenderer.DrawText(e.Graphics, tabPage.Text, tabPage.Font, - tabRect, tabPage.ForeColor, TextFormatFlags.Left); + + TabPage SelectedTab = TabPages[e.Index]; + Rectangle HeaderRect = GetTabRect(e.Index); + SolidBrush TextBrush = new SolidBrush(Color.Black); + StringFormat sf = new StringFormat + { + LineAlignment = StringAlignment.Center + }; + + if (e.State == DrawItemState.Selected) + { + Font BoldFont = new Font(Font.Name, Font.Size, FontStyle.Bold); + + e.Graphics.DrawString(SelectedTab.Text, BoldFont, TextBrush, HeaderRect, sf); + } + else + e.Graphics.DrawString(SelectedTab.Text , e.Font, TextBrush, HeaderRect, sf); + + TextBrush.Dispose(); } + + } + public void SetAddresses(vCard card) + { + ClearTabs(); + AddTabForEveryAddress(card); + } + + private void AddTabForEveryAddress(vCard card) + { + foreach (var item in card.DeliveryAddresses) + AddtabForAddress(item); + + //Page for the "+" sign + TabPages.Add(new TabPage(" ")); + } + + private void AddtabForAddress(vCardDeliveryAddress da) + { + var title = da.AddressType[0].ToString(); + + if (da.AddressType.Count > 1) + title += "..."; + + var page = new TabPage($" {title} "); + TabPages.Add(page); + + var ab = new AddressBox(da.Street, da.City, da.Region, da.Country, + da.PostalCode, da.ExtendedAddress, da.PostOfficeBox, da.AddressType); + + ab.TextChangedEvent += (s, e) => TextChangedEvent?.Invoke(s, e); + page.Controls.Add(ab); + page.ToolTipText = string.Join(",", da.AddressType.ConvertAll(f => f.ToString())); + + + } + + + private void ClearTabs() + { + + //Remove every tab. We don't call Clear() as it doesn't free memory. + while (TabCount > 0) + TabPages[TabCount - 1].Dispose(); + } } } diff --git a/vCardEditor/View/IMainView.cs b/vCardEditor/View/IMainView.cs index 2a1606d..1946983 100644 --- a/vCardEditor/View/IMainView.cs +++ b/vCardEditor/View/IMainView.cs @@ -23,6 +23,10 @@ namespace VCFEditor.View event EventHandler> CloseForm; event EventHandler> ModifyImage; event EventHandler ExportImage; + event EventHandler>> AddressAdded; + event EventHandler> AddressRemoved; + + int SelectedContactIndex { get; } void DisplayContacts(BindingList contacts); void DisplayContactDetail(vCard card, string FileName); diff --git a/vCardEditor/View/MainForm.Designer.cs b/vCardEditor/View/MainForm.Designer.cs index 6f70074..9b19c9a 100644 --- a/vCardEditor/View/MainForm.Designer.cs +++ b/vCardEditor/View/MainForm.Designer.cs @@ -64,66 +64,16 @@ namespace vCardEditor.View this.btnExportImage = new System.Windows.Forms.Button(); this.btnRemoveImage = new System.Windows.Forms.Button(); this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.tbcAddress = new vCardEditor.View.Customs.AddressTabControl(); - this.tbHome = new System.Windows.Forms.TabPage(); - this.AddressLabel = new System.Windows.Forms.Label(); - this.HomeAddressValue = new vCardEditor.View.StateTextBox(); - this.POBoxLabel = new System.Windows.Forms.Label(); - this.HomeCountryValue = new vCardEditor.View.StateTextBox(); - this.HomePOBoxValue = new vCardEditor.View.StateTextBox(); - this.Country = new System.Windows.Forms.Label(); - this.CityLabel = new System.Windows.Forms.Label(); - this.HomeStateValue = new vCardEditor.View.StateTextBox(); - this.HomeCityValue = new vCardEditor.View.StateTextBox(); - this.StateLabel = new System.Windows.Forms.Label(); - this.ZipLabel = new System.Windows.Forms.Label(); - this.HomeZipValue = new vCardEditor.View.StateTextBox(); - this.tbWork = new System.Windows.Forms.TabPage(); - this.label9 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.WorkAddressValue = new vCardEditor.View.StateTextBox(); - this.WorkCountryValue = new vCardEditor.View.StateTextBox(); - this.WorkPOBoxValue = new vCardEditor.View.StateTextBox(); - this.WorkZipValue = new vCardEditor.View.StateTextBox(); - this.WorkCityValue = new vCardEditor.View.StateTextBox(); - this.WorkStateValue = new vCardEditor.View.StateTextBox(); - this.tbPostal = new System.Windows.Forms.TabPage(); - this.label10 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.label13 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); - this.PostalAddressValue = new vCardEditor.View.StateTextBox(); - this.PostalCountryValue = new vCardEditor.View.StateTextBox(); - this.PostalPOBoxValue = new vCardEditor.View.StateTextBox(); - this.PostalZipValue = new vCardEditor.View.StateTextBox(); - this.PostalCityValue = new vCardEditor.View.StateTextBox(); - this.PostalStateValue = new vCardEditor.View.StateTextBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.FormattedTitleValue = new vCardEditor.View.StateTextBox(); this.FormattedTitleLabel = new System.Windows.Forms.Label(); - this.lastNameValue = new vCardEditor.View.StateTextBox(); this.label3 = new System.Windows.Forms.Label(); - this.middleNameValue = new vCardEditor.View.StateTextBox(); this.label2 = new System.Windows.Forms.Label(); - this.firstNameValue = new vCardEditor.View.StateTextBox(); this.label1 = new System.Windows.Forms.Label(); - this.FormattedNameValue = new vCardEditor.View.StateTextBox(); this.FormattedNameLabel = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.EmailAddressLabel = new System.Windows.Forms.Label(); - this.EmailAddressValue = new vCardEditor.View.StateTextBox(); this.PersonalWebSiteLabel = new System.Windows.Forms.Label(); - this.PersonalWebSiteValue = new vCardEditor.View.StateTextBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.HomePhoneValue = new vCardEditor.View.StateTextBox(); - this.WorkPhoneValue = new vCardEditor.View.StateTextBox(); - this.CellularPhoneValue = new vCardEditor.View.StateTextBox(); this.PhotoBox = new System.Windows.Forms.PictureBox(); this.bsContacts = new System.Windows.Forms.BindingSource(this.components); this.gbNameList = new System.Windows.Forms.GroupBox(); @@ -132,14 +82,21 @@ namespace vCardEditor.View this.dgContacts = new System.Windows.Forms.DataGridView(); this.Column1 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.tbcAddress = new vCardEditor.View.Customs.AddressTabControl(); + this.FormattedTitleValue = new vCardEditor.View.StateTextBox(); + this.lastNameValue = new vCardEditor.View.StateTextBox(); + this.middleNameValue = new vCardEditor.View.StateTextBox(); + this.firstNameValue = new vCardEditor.View.StateTextBox(); + this.FormattedNameValue = new vCardEditor.View.StateTextBox(); + this.EmailAddressValue = new vCardEditor.View.StateTextBox(); + this.PersonalWebSiteValue = new vCardEditor.View.StateTextBox(); + this.HomePhoneValue = new vCardEditor.View.StateTextBox(); + this.WorkPhoneValue = new vCardEditor.View.StateTextBox(); + this.CellularPhoneValue = new vCardEditor.View.StateTextBox(); this.menuStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.gbContactDetail.SuspendLayout(); this.groupBox4.SuspendLayout(); - this.tbcAddress.SuspendLayout(); - this.tbHome.SuspendLayout(); - this.tbWork.SuspendLayout(); - this.tbPostal.SuspendLayout(); this.groupBox3.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -159,7 +116,7 @@ namespace vCardEditor.View this.toolsToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(1145, 28); + this.menuStrip1.Size = new System.Drawing.Size(1145, 30); this.menuStrip1.TabIndex = 0; this.menuStrip1.Text = "menuStrip1"; // @@ -173,7 +130,7 @@ namespace vCardEditor.View this.recentFilesMenuItem, this.miQuit}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); + this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 26); this.fileToolStripMenuItem.Text = "File"; // // miSave @@ -223,7 +180,7 @@ namespace vCardEditor.View this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.copyToolStripMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(49, 24); + this.editToolStripMenuItem.Size = new System.Drawing.Size(49, 26); this.editToolStripMenuItem.Text = "Edit"; // // copyToolStripMenuItem @@ -237,7 +194,7 @@ namespace vCardEditor.View this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.miAbout}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(55, 24); + this.helpToolStripMenuItem.Size = new System.Drawing.Size(55, 26); this.helpToolStripMenuItem.Text = "Help"; // // miAbout @@ -254,7 +211,7 @@ namespace vCardEditor.View this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.imagesToolStripMenuItem}); this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 24); + this.toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 26); this.toolsToolStripMenuItem.Text = "Tools"; // // imagesToolStripMenuItem @@ -284,9 +241,9 @@ namespace vCardEditor.View this.toolStripSeparator1, this.tbsAbout, this.toolStripSeparator}); - this.toolStrip1.Location = new System.Drawing.Point(0, 28); + this.toolStrip1.Location = new System.Drawing.Point(0, 30); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(1145, 27); + this.toolStrip1.Size = new System.Drawing.Size(1145, 31); this.toolStrip1.TabIndex = 1; this.toolStrip1.Text = "toolStrip1"; // @@ -296,7 +253,7 @@ namespace vCardEditor.View this.tbsNew.Image = ((System.Drawing.Image)(resources.GetObject("tbsNew.Image"))); this.tbsNew.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbsNew.Name = "tbsNew"; - this.tbsNew.Size = new System.Drawing.Size(29, 24); + this.tbsNew.Size = new System.Drawing.Size(29, 28); this.tbsNew.Text = "&Nouveau"; this.tbsNew.Click += new System.EventHandler(this.tbsNew_Click); // @@ -306,7 +263,7 @@ namespace vCardEditor.View this.tbsOpen.Image = ((System.Drawing.Image)(resources.GetObject("tbsOpen.Image"))); this.tbsOpen.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbsOpen.Name = "tbsOpen"; - this.tbsOpen.Size = new System.Drawing.Size(29, 24); + this.tbsOpen.Size = new System.Drawing.Size(29, 28); this.tbsOpen.Text = "&Open"; this.tbsOpen.Click += new System.EventHandler(this.tbsOpen_Click); // @@ -316,7 +273,7 @@ namespace vCardEditor.View this.tbsSave.Image = ((System.Drawing.Image)(resources.GetObject("tbsSave.Image"))); this.tbsSave.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbsSave.Name = "tbsSave"; - this.tbsSave.Size = new System.Drawing.Size(29, 24); + this.tbsSave.Size = new System.Drawing.Size(29, 28); this.tbsSave.Text = "&Save"; this.tbsSave.Click += new System.EventHandler(this.tbsSave_Click); // @@ -326,14 +283,14 @@ namespace vCardEditor.View this.tbsDelete.Image = ((System.Drawing.Image)(resources.GetObject("tbsDelete.Image"))); this.tbsDelete.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbsDelete.Name = "tbsDelete"; - this.tbsDelete.Size = new System.Drawing.Size(29, 24); + this.tbsDelete.Size = new System.Drawing.Size(29, 28); this.tbsDelete.Text = "Delete"; this.tbsDelete.Click += new System.EventHandler(this.tbsDelete_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 27); + this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31); // // tbsAbout // @@ -341,14 +298,14 @@ namespace vCardEditor.View this.tbsAbout.Image = ((System.Drawing.Image)(resources.GetObject("tbsAbout.Image"))); this.tbsAbout.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbsAbout.Name = "tbsAbout"; - this.tbsAbout.Size = new System.Drawing.Size(29, 24); + this.tbsAbout.Size = new System.Drawing.Size(29, 28); this.tbsAbout.Text = "&?"; this.tbsAbout.Click += new System.EventHandler(this.tbsAbout_Click); // // toolStripSeparator // this.toolStripSeparator.Name = "toolStripSeparator"; - this.toolStripSeparator.Size = new System.Drawing.Size(6, 27); + this.toolStripSeparator.Size = new System.Drawing.Size(6, 31); // // openFileDialog // @@ -443,502 +400,6 @@ namespace vCardEditor.View this.groupBox4.TabStop = false; this.groupBox4.Text = "Address:"; // - // tbcAddress - // - this.tbcAddress.Controls.Add(this.tbHome); - this.tbcAddress.Controls.Add(this.tbWork); - this.tbcAddress.Controls.Add(this.tbPostal); - this.tbcAddress.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; - this.tbcAddress.Location = new System.Drawing.Point(17, 23); - this.tbcAddress.Margin = new System.Windows.Forms.Padding(4); - this.tbcAddress.Name = "tbcAddress"; - this.tbcAddress.Padding = new System.Drawing.Point(12, 4); - this.tbcAddress.SelectedIndex = 0; - this.tbcAddress.Size = new System.Drawing.Size(739, 144); - this.tbcAddress.TabIndex = 0; - // - // tbHome - // - this.tbHome.BackColor = System.Drawing.SystemColors.Control; - this.tbHome.Controls.Add(this.AddressLabel); - this.tbHome.Controls.Add(this.HomeAddressValue); - this.tbHome.Controls.Add(this.POBoxLabel); - this.tbHome.Controls.Add(this.HomeCountryValue); - this.tbHome.Controls.Add(this.HomePOBoxValue); - this.tbHome.Controls.Add(this.Country); - this.tbHome.Controls.Add(this.CityLabel); - this.tbHome.Controls.Add(this.HomeStateValue); - this.tbHome.Controls.Add(this.HomeCityValue); - this.tbHome.Controls.Add(this.StateLabel); - this.tbHome.Controls.Add(this.ZipLabel); - this.tbHome.Controls.Add(this.HomeZipValue); - this.tbHome.Location = new System.Drawing.Point(4, 27); - this.tbHome.Margin = new System.Windows.Forms.Padding(4); - this.tbHome.Name = "tbHome"; - this.tbHome.Padding = new System.Windows.Forms.Padding(4); - this.tbHome.Size = new System.Drawing.Size(731, 113); - this.tbHome.TabIndex = 0; - this.tbHome.Text = "Home"; - // - // AddressLabel - // - this.AddressLabel.Location = new System.Drawing.Point(19, 16); - this.AddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.AddressLabel.Name = "AddressLabel"; - this.AddressLabel.Size = new System.Drawing.Size(65, 23); - this.AddressLabel.TabIndex = 0; - this.AddressLabel.Text = "Address:"; - this.AddressLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // HomeAddressValue - // - this.HomeAddressValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.HomeAddressValue.Location = new System.Drawing.Point(92, 15); - this.HomeAddressValue.Margin = new System.Windows.Forms.Padding(4); - this.HomeAddressValue.Name = "HomeAddressValue"; - this.HomeAddressValue.oldText = ""; - this.HomeAddressValue.Size = new System.Drawing.Size(613, 22); - this.HomeAddressValue.TabIndex = 1; - this.HomeAddressValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.HomeAddressValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // POBoxLabel - // - this.POBoxLabel.Location = new System.Drawing.Point(19, 46); - this.POBoxLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.POBoxLabel.Name = "POBoxLabel"; - this.POBoxLabel.Size = new System.Drawing.Size(65, 23); - this.POBoxLabel.TabIndex = 2; - this.POBoxLabel.Text = "PO Box:"; - this.POBoxLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // HomeCountryValue - // - this.HomeCountryValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.HomeCountryValue.Location = new System.Drawing.Point(399, 79); - this.HomeCountryValue.Margin = new System.Windows.Forms.Padding(4); - this.HomeCountryValue.Name = "HomeCountryValue"; - this.HomeCountryValue.oldText = null; - this.HomeCountryValue.Size = new System.Drawing.Size(307, 22); - this.HomeCountryValue.TabIndex = 11; - this.HomeCountryValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.HomeCountryValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // HomePOBoxValue - // - this.HomePOBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.HomePOBoxValue.Location = new System.Drawing.Point(92, 44); - this.HomePOBoxValue.Margin = new System.Windows.Forms.Padding(4); - this.HomePOBoxValue.Name = "HomePOBoxValue"; - this.HomePOBoxValue.oldText = null; - this.HomePOBoxValue.Size = new System.Drawing.Size(236, 22); - this.HomePOBoxValue.TabIndex = 3; - this.HomePOBoxValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.HomePOBoxValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // Country - // - this.Country.Location = new System.Drawing.Point(337, 80); - this.Country.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.Country.Name = "Country"; - this.Country.Size = new System.Drawing.Size(65, 23); - this.Country.TabIndex = 10; - this.Country.Text = "Country:"; - this.Country.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // CityLabel - // - this.CityLabel.Location = new System.Drawing.Point(337, 48); - this.CityLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.CityLabel.Name = "CityLabel"; - this.CityLabel.Size = new System.Drawing.Size(43, 23); - this.CityLabel.TabIndex = 4; - this.CityLabel.Text = "City:"; - this.CityLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // HomeStateValue - // - this.HomeStateValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.HomeStateValue.Location = new System.Drawing.Point(92, 76); - this.HomeStateValue.Margin = new System.Windows.Forms.Padding(4); - this.HomeStateValue.Name = "HomeStateValue"; - this.HomeStateValue.oldText = null; - this.HomeStateValue.Size = new System.Drawing.Size(236, 22); - this.HomeStateValue.TabIndex = 9; - this.HomeStateValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.HomeStateValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // HomeCityValue - // - this.HomeCityValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.HomeCityValue.Location = new System.Drawing.Point(399, 46); - this.HomeCityValue.Margin = new System.Windows.Forms.Padding(4); - this.HomeCityValue.Name = "HomeCityValue"; - this.HomeCityValue.oldText = null; - this.HomeCityValue.Size = new System.Drawing.Size(127, 22); - this.HomeCityValue.TabIndex = 5; - this.HomeCityValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.HomeCityValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // StateLabel - // - this.StateLabel.Location = new System.Drawing.Point(19, 69); - this.StateLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.StateLabel.Name = "StateLabel"; - this.StateLabel.Size = new System.Drawing.Size(61, 23); - this.StateLabel.TabIndex = 8; - this.StateLabel.Text = "State:"; - this.StateLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // ZipLabel - // - this.ZipLabel.Location = new System.Drawing.Point(535, 46); - this.ZipLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.ZipLabel.Name = "ZipLabel"; - this.ZipLabel.Size = new System.Drawing.Size(37, 23); - this.ZipLabel.TabIndex = 6; - this.ZipLabel.Text = "Zip:"; - this.ZipLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // HomeZipValue - // - this.HomeZipValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.HomeZipValue.Location = new System.Drawing.Point(581, 47); - this.HomeZipValue.Margin = new System.Windows.Forms.Padding(4); - this.HomeZipValue.Name = "HomeZipValue"; - this.HomeZipValue.oldText = null; - this.HomeZipValue.Size = new System.Drawing.Size(124, 22); - this.HomeZipValue.TabIndex = 7; - this.HomeZipValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.HomeZipValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // tbWork - // - this.tbWork.BackColor = System.Drawing.SystemColors.Control; - this.tbWork.Controls.Add(this.label9); - this.tbWork.Controls.Add(this.label8); - this.tbWork.Controls.Add(this.label5); - this.tbWork.Controls.Add(this.label7); - this.tbWork.Controls.Add(this.label4); - this.tbWork.Controls.Add(this.label6); - this.tbWork.Controls.Add(this.WorkAddressValue); - this.tbWork.Controls.Add(this.WorkCountryValue); - this.tbWork.Controls.Add(this.WorkPOBoxValue); - this.tbWork.Controls.Add(this.WorkZipValue); - this.tbWork.Controls.Add(this.WorkCityValue); - this.tbWork.Controls.Add(this.WorkStateValue); - this.tbWork.Location = new System.Drawing.Point(4, 27); - this.tbWork.Margin = new System.Windows.Forms.Padding(4); - this.tbWork.Name = "tbWork"; - this.tbWork.Padding = new System.Windows.Forms.Padding(4); - this.tbWork.Size = new System.Drawing.Size(731, 113); - this.tbWork.TabIndex = 1; - this.tbWork.Text = "Work"; - // - // label9 - // - this.label9.Location = new System.Drawing.Point(20, 12); - this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(65, 23); - this.label9.TabIndex = 16; - this.label9.Text = "Address:"; - this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label8 - // - this.label8.Location = new System.Drawing.Point(20, 42); - this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(65, 23); - this.label8.TabIndex = 18; - this.label8.Text = "PO Box:"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label5 - // - this.label5.Location = new System.Drawing.Point(20, 65); - this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(61, 23); - this.label5.TabIndex = 24; - this.label5.Text = "State:"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label7 - // - this.label7.Location = new System.Drawing.Point(339, 76); - this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(61, 23); - this.label7.TabIndex = 26; - this.label7.Text = "Country:"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label4 - // - this.label4.Location = new System.Drawing.Point(536, 42); - this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(37, 23); - this.label4.TabIndex = 22; - this.label4.Text = "Zip:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label6 - // - this.label6.Location = new System.Drawing.Point(339, 44); - this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(43, 23); - this.label6.TabIndex = 20; - this.label6.Text = "City:"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // WorkAddressValue - // - this.WorkAddressValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.WorkAddressValue.Location = new System.Drawing.Point(89, 11); - this.WorkAddressValue.Margin = new System.Windows.Forms.Padding(4); - this.WorkAddressValue.Name = "WorkAddressValue"; - this.WorkAddressValue.oldText = ""; - this.WorkAddressValue.Size = new System.Drawing.Size(617, 22); - this.WorkAddressValue.TabIndex = 17; - this.WorkAddressValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.WorkAddressValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // WorkCountryValue - // - this.WorkCountryValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.WorkCountryValue.Location = new System.Drawing.Point(400, 75); - this.WorkCountryValue.Margin = new System.Windows.Forms.Padding(4); - this.WorkCountryValue.Name = "WorkCountryValue"; - this.WorkCountryValue.oldText = null; - this.WorkCountryValue.Size = new System.Drawing.Size(307, 22); - this.WorkCountryValue.TabIndex = 27; - this.WorkCountryValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.WorkCountryValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // WorkPOBoxValue - // - this.WorkPOBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.WorkPOBoxValue.Location = new System.Drawing.Point(89, 41); - this.WorkPOBoxValue.Margin = new System.Windows.Forms.Padding(4); - this.WorkPOBoxValue.Name = "WorkPOBoxValue"; - this.WorkPOBoxValue.oldText = null; - this.WorkPOBoxValue.Size = new System.Drawing.Size(236, 22); - this.WorkPOBoxValue.TabIndex = 19; - this.WorkPOBoxValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.WorkPOBoxValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // WorkZipValue - // - this.WorkZipValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.WorkZipValue.Location = new System.Drawing.Point(583, 43); - this.WorkZipValue.Margin = new System.Windows.Forms.Padding(4); - this.WorkZipValue.Name = "WorkZipValue"; - this.WorkZipValue.oldText = null; - this.WorkZipValue.Size = new System.Drawing.Size(124, 22); - this.WorkZipValue.TabIndex = 23; - this.WorkZipValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.WorkZipValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // WorkCityValue - // - this.WorkCityValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.WorkCityValue.Location = new System.Drawing.Point(400, 42); - this.WorkCityValue.Margin = new System.Windows.Forms.Padding(4); - this.WorkCityValue.Name = "WorkCityValue"; - this.WorkCityValue.oldText = null; - this.WorkCityValue.Size = new System.Drawing.Size(127, 22); - this.WorkCityValue.TabIndex = 21; - this.WorkCityValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.WorkCityValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // WorkStateValue - // - this.WorkStateValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.WorkStateValue.Location = new System.Drawing.Point(89, 73); - this.WorkStateValue.Margin = new System.Windows.Forms.Padding(4); - this.WorkStateValue.Name = "WorkStateValue"; - this.WorkStateValue.oldText = null; - this.WorkStateValue.Size = new System.Drawing.Size(240, 22); - this.WorkStateValue.TabIndex = 25; - this.WorkStateValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.WorkStateValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // tbPostal - // - this.tbPostal.BackColor = System.Drawing.SystemColors.Control; - this.tbPostal.Controls.Add(this.label10); - this.tbPostal.Controls.Add(this.label11); - this.tbPostal.Controls.Add(this.label12); - this.tbPostal.Controls.Add(this.label13); - this.tbPostal.Controls.Add(this.label14); - this.tbPostal.Controls.Add(this.label15); - this.tbPostal.Controls.Add(this.PostalAddressValue); - this.tbPostal.Controls.Add(this.PostalCountryValue); - this.tbPostal.Controls.Add(this.PostalPOBoxValue); - this.tbPostal.Controls.Add(this.PostalZipValue); - this.tbPostal.Controls.Add(this.PostalCityValue); - this.tbPostal.Controls.Add(this.PostalStateValue); - this.tbPostal.Location = new System.Drawing.Point(4, 27); - this.tbPostal.Margin = new System.Windows.Forms.Padding(4); - this.tbPostal.Name = "tbPostal"; - this.tbPostal.Size = new System.Drawing.Size(731, 113); - this.tbPostal.TabIndex = 2; - this.tbPostal.Text = "Postal"; - // - // label10 - // - this.label10.Location = new System.Drawing.Point(20, 12); - this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(65, 23); - this.label10.TabIndex = 16; - this.label10.Text = "Address:"; - this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label11 - // - this.label11.Location = new System.Drawing.Point(20, 42); - this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(65, 23); - this.label11.TabIndex = 18; - this.label11.Text = "PO Box:"; - this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label12 - // - this.label12.Location = new System.Drawing.Point(20, 65); - this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(61, 23); - this.label12.TabIndex = 24; - this.label12.Text = "State:"; - this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label13 - // - this.label13.Location = new System.Drawing.Point(335, 76); - this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(61, 23); - this.label13.TabIndex = 26; - this.label13.Text = "Country:"; - this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label14 - // - this.label14.Location = new System.Drawing.Point(536, 42); - this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(37, 23); - this.label14.TabIndex = 22; - this.label14.Text = "Zip:"; - this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label15 - // - this.label15.Location = new System.Drawing.Point(339, 44); - this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(43, 23); - this.label15.TabIndex = 20; - this.label15.Text = "City:"; - this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // PostalAddressValue - // - this.PostalAddressValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.PostalAddressValue.Location = new System.Drawing.Point(89, 11); - this.PostalAddressValue.Margin = new System.Windows.Forms.Padding(4); - this.PostalAddressValue.Name = "PostalAddressValue"; - this.PostalAddressValue.oldText = ""; - this.PostalAddressValue.Size = new System.Drawing.Size(617, 22); - this.PostalAddressValue.TabIndex = 17; - this.PostalAddressValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.PostalAddressValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // PostalCountryValue - // - this.PostalCountryValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.PostalCountryValue.Location = new System.Drawing.Point(400, 75); - this.PostalCountryValue.Margin = new System.Windows.Forms.Padding(4); - this.PostalCountryValue.Name = "PostalCountryValue"; - this.PostalCountryValue.oldText = null; - this.PostalCountryValue.Size = new System.Drawing.Size(307, 22); - this.PostalCountryValue.TabIndex = 27; - this.PostalCountryValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.PostalCountryValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // PostalPOBoxValue - // - this.PostalPOBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.PostalPOBoxValue.Location = new System.Drawing.Point(89, 41); - this.PostalPOBoxValue.Margin = new System.Windows.Forms.Padding(4); - this.PostalPOBoxValue.Name = "PostalPOBoxValue"; - this.PostalPOBoxValue.oldText = null; - this.PostalPOBoxValue.Size = new System.Drawing.Size(240, 22); - this.PostalPOBoxValue.TabIndex = 19; - this.PostalPOBoxValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.PostalPOBoxValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // PostalZipValue - // - this.PostalZipValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.PostalZipValue.Location = new System.Drawing.Point(583, 43); - this.PostalZipValue.Margin = new System.Windows.Forms.Padding(4); - this.PostalZipValue.Name = "PostalZipValue"; - this.PostalZipValue.oldText = null; - this.PostalZipValue.Size = new System.Drawing.Size(124, 22); - this.PostalZipValue.TabIndex = 23; - this.PostalZipValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.PostalZipValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // PostalCityValue - // - this.PostalCityValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.PostalCityValue.Location = new System.Drawing.Point(400, 42); - this.PostalCityValue.Margin = new System.Windows.Forms.Padding(4); - this.PostalCityValue.Name = "PostalCityValue"; - this.PostalCityValue.oldText = null; - this.PostalCityValue.Size = new System.Drawing.Size(127, 22); - this.PostalCityValue.TabIndex = 21; - this.PostalCityValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.PostalCityValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // PostalStateValue - // - this.PostalStateValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.PostalStateValue.Location = new System.Drawing.Point(89, 73); - this.PostalStateValue.Margin = new System.Windows.Forms.Padding(4); - this.PostalStateValue.Name = "PostalStateValue"; - this.PostalStateValue.oldText = null; - this.PostalStateValue.Size = new System.Drawing.Size(240, 22); - this.PostalStateValue.TabIndex = 25; - this.PostalStateValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.PostalStateValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // groupBox3 // this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -962,17 +423,6 @@ namespace vCardEditor.View this.groupBox3.TabStop = false; this.groupBox3.Text = "Name"; // - // FormattedTitleValue - // - this.FormattedTitleValue.Location = new System.Drawing.Point(45, 21); - this.FormattedTitleValue.Margin = new System.Windows.Forms.Padding(4); - this.FormattedTitleValue.Name = "FormattedTitleValue"; - this.FormattedTitleValue.oldText = null; - this.FormattedTitleValue.Size = new System.Drawing.Size(100, 22); - this.FormattedTitleValue.TabIndex = 1; - this.FormattedTitleValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.FormattedTitleValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // FormattedTitleLabel // this.FormattedTitleLabel.Location = new System.Drawing.Point(-4, 20); @@ -983,19 +433,6 @@ namespace vCardEditor.View this.FormattedTitleLabel.Text = "Title:"; this.FormattedTitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // lastNameValue - // - this.lastNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lastNameValue.Location = new System.Drawing.Point(395, 53); - this.lastNameValue.Margin = new System.Windows.Forms.Padding(4); - this.lastNameValue.Name = "lastNameValue"; - this.lastNameValue.oldText = null; - this.lastNameValue.Size = new System.Drawing.Size(168, 22); - this.lastNameValue.TabIndex = 9; - this.lastNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.lastNameValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // label3 // this.label3.Location = new System.Drawing.Point(341, 53); @@ -1006,19 +443,6 @@ namespace vCardEditor.View this.label3.Text = "Last:"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // middleNameValue - // - this.middleNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.middleNameValue.Location = new System.Drawing.Point(237, 53); - this.middleNameValue.Margin = new System.Windows.Forms.Padding(4); - this.middleNameValue.Name = "middleNameValue"; - this.middleNameValue.oldText = null; - this.middleNameValue.Size = new System.Drawing.Size(95, 22); - this.middleNameValue.TabIndex = 7; - this.middleNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.middleNameValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // label2 // this.label2.Location = new System.Drawing.Point(151, 53); @@ -1029,17 +453,6 @@ namespace vCardEditor.View this.label2.Text = "Middle:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // firstNameValue - // - this.firstNameValue.Location = new System.Drawing.Point(45, 53); - this.firstNameValue.Margin = new System.Windows.Forms.Padding(4); - this.firstNameValue.Name = "firstNameValue"; - this.firstNameValue.oldText = null; - this.firstNameValue.Size = new System.Drawing.Size(100, 22); - this.firstNameValue.TabIndex = 5; - this.firstNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.firstNameValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // label1 // this.label1.Location = new System.Drawing.Point(4, 53); @@ -1050,19 +463,6 @@ namespace vCardEditor.View this.label1.Text = "First:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // FormattedNameValue - // - this.FormattedNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.FormattedNameValue.Location = new System.Drawing.Point(237, 21); - this.FormattedNameValue.Margin = new System.Windows.Forms.Padding(4); - this.FormattedNameValue.Name = "FormattedNameValue"; - this.FormattedNameValue.oldText = null; - this.FormattedNameValue.Size = new System.Drawing.Size(324, 22); - this.FormattedNameValue.TabIndex = 3; - this.FormattedNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.FormattedNameValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // FormattedNameLabel // this.FormattedNameLabel.Location = new System.Drawing.Point(148, 21); @@ -1100,19 +500,6 @@ namespace vCardEditor.View this.EmailAddressLabel.Text = "Email:"; this.EmailAddressLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // EmailAddressValue - // - this.EmailAddressValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.EmailAddressValue.Location = new System.Drawing.Point(71, 26); - this.EmailAddressValue.Margin = new System.Windows.Forms.Padding(4); - this.EmailAddressValue.Name = "EmailAddressValue"; - this.EmailAddressValue.oldText = null; - this.EmailAddressValue.Size = new System.Drawing.Size(360, 22); - this.EmailAddressValue.TabIndex = 1; - this.EmailAddressValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.EmailAddressValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // PersonalWebSiteLabel // this.PersonalWebSiteLabel.Location = new System.Drawing.Point(13, 55); @@ -1123,19 +510,6 @@ namespace vCardEditor.View this.PersonalWebSiteLabel.Text = "Web:"; this.PersonalWebSiteLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // PersonalWebSiteValue - // - this.PersonalWebSiteValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.PersonalWebSiteValue.Location = new System.Drawing.Point(71, 55); - this.PersonalWebSiteValue.Margin = new System.Windows.Forms.Padding(4); - this.PersonalWebSiteValue.Name = "PersonalWebSiteValue"; - this.PersonalWebSiteValue.oldText = null; - this.PersonalWebSiteValue.Size = new System.Drawing.Size(360, 22); - this.PersonalWebSiteValue.TabIndex = 3; - this.PersonalWebSiteValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.PersonalWebSiteValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) @@ -1155,45 +529,6 @@ namespace vCardEditor.View this.groupBox1.TabStop = false; this.groupBox1.Text = "Phones : "; // - // HomePhoneValue - // - this.HomePhoneValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.HomePhoneValue.Location = new System.Drawing.Point(80, 25); - this.HomePhoneValue.Margin = new System.Windows.Forms.Padding(4); - this.HomePhoneValue.Name = "HomePhoneValue"; - this.HomePhoneValue.oldText = null; - this.HomePhoneValue.Size = new System.Drawing.Size(229, 22); - this.HomePhoneValue.TabIndex = 1; - this.HomePhoneValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.HomePhoneValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // WorkPhoneValue - // - this.WorkPhoneValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.WorkPhoneValue.Location = new System.Drawing.Point(80, 89); - this.WorkPhoneValue.Margin = new System.Windows.Forms.Padding(4); - this.WorkPhoneValue.Name = "WorkPhoneValue"; - this.WorkPhoneValue.oldText = null; - this.WorkPhoneValue.Size = new System.Drawing.Size(229, 22); - this.WorkPhoneValue.TabIndex = 5; - this.WorkPhoneValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.WorkPhoneValue.Validated += new System.EventHandler(this.Value_TextChanged); - // - // CellularPhoneValue - // - this.CellularPhoneValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.CellularPhoneValue.Location = new System.Drawing.Point(80, 55); - this.CellularPhoneValue.Margin = new System.Windows.Forms.Padding(4); - this.CellularPhoneValue.Name = "CellularPhoneValue"; - this.CellularPhoneValue.oldText = null; - this.CellularPhoneValue.Size = new System.Drawing.Size(229, 22); - this.CellularPhoneValue.TabIndex = 3; - this.CellularPhoneValue.LostFocus += new System.EventHandler(this.Value_TextChanged); - this.CellularPhoneValue.Validated += new System.EventHandler(this.Value_TextChanged); - // // PhotoBox // this.PhotoBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -1291,6 +626,143 @@ namespace vCardEditor.View this.Column2.Name = "Column2"; this.Column2.ReadOnly = true; // + // tbcAddress + // + this.tbcAddress.Location = new System.Drawing.Point(17, 23); + this.tbcAddress.Margin = new System.Windows.Forms.Padding(4); + this.tbcAddress.Name = "tbcAddress"; + this.tbcAddress.Padding = new System.Drawing.Point(12, 4); + this.tbcAddress.SelectedIndex = 0; + this.tbcAddress.ShowToolTips = true; + this.tbcAddress.Size = new System.Drawing.Size(739, 144); + this.tbcAddress.TabIndex = 0; + // + // FormattedTitleValue + // + this.FormattedTitleValue.Location = new System.Drawing.Point(45, 21); + this.FormattedTitleValue.Margin = new System.Windows.Forms.Padding(4); + this.FormattedTitleValue.Name = "FormattedTitleValue"; + this.FormattedTitleValue.oldText = null; + this.FormattedTitleValue.Size = new System.Drawing.Size(100, 22); + this.FormattedTitleValue.TabIndex = 1; + this.FormattedTitleValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.FormattedTitleValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // lastNameValue + // + this.lastNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lastNameValue.Location = new System.Drawing.Point(395, 53); + this.lastNameValue.Margin = new System.Windows.Forms.Padding(4); + this.lastNameValue.Name = "lastNameValue"; + this.lastNameValue.oldText = null; + this.lastNameValue.Size = new System.Drawing.Size(168, 22); + this.lastNameValue.TabIndex = 9; + this.lastNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.lastNameValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // middleNameValue + // + this.middleNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.middleNameValue.Location = new System.Drawing.Point(237, 53); + this.middleNameValue.Margin = new System.Windows.Forms.Padding(4); + this.middleNameValue.Name = "middleNameValue"; + this.middleNameValue.oldText = null; + this.middleNameValue.Size = new System.Drawing.Size(95, 22); + this.middleNameValue.TabIndex = 7; + this.middleNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.middleNameValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // firstNameValue + // + this.firstNameValue.Location = new System.Drawing.Point(45, 53); + this.firstNameValue.Margin = new System.Windows.Forms.Padding(4); + this.firstNameValue.Name = "firstNameValue"; + this.firstNameValue.oldText = null; + this.firstNameValue.Size = new System.Drawing.Size(100, 22); + this.firstNameValue.TabIndex = 5; + this.firstNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.firstNameValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // FormattedNameValue + // + this.FormattedNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.FormattedNameValue.Location = new System.Drawing.Point(237, 21); + this.FormattedNameValue.Margin = new System.Windows.Forms.Padding(4); + this.FormattedNameValue.Name = "FormattedNameValue"; + this.FormattedNameValue.oldText = null; + this.FormattedNameValue.Size = new System.Drawing.Size(324, 22); + this.FormattedNameValue.TabIndex = 3; + this.FormattedNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.FormattedNameValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // EmailAddressValue + // + this.EmailAddressValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.EmailAddressValue.Location = new System.Drawing.Point(71, 26); + this.EmailAddressValue.Margin = new System.Windows.Forms.Padding(4); + this.EmailAddressValue.Name = "EmailAddressValue"; + this.EmailAddressValue.oldText = null; + this.EmailAddressValue.Size = new System.Drawing.Size(360, 22); + this.EmailAddressValue.TabIndex = 1; + this.EmailAddressValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.EmailAddressValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // PersonalWebSiteValue + // + this.PersonalWebSiteValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.PersonalWebSiteValue.Location = new System.Drawing.Point(71, 55); + this.PersonalWebSiteValue.Margin = new System.Windows.Forms.Padding(4); + this.PersonalWebSiteValue.Name = "PersonalWebSiteValue"; + this.PersonalWebSiteValue.oldText = null; + this.PersonalWebSiteValue.Size = new System.Drawing.Size(360, 22); + this.PersonalWebSiteValue.TabIndex = 3; + this.PersonalWebSiteValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.PersonalWebSiteValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // HomePhoneValue + // + this.HomePhoneValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.HomePhoneValue.Location = new System.Drawing.Point(80, 25); + this.HomePhoneValue.Margin = new System.Windows.Forms.Padding(4); + this.HomePhoneValue.Name = "HomePhoneValue"; + this.HomePhoneValue.oldText = null; + this.HomePhoneValue.Size = new System.Drawing.Size(229, 22); + this.HomePhoneValue.TabIndex = 1; + this.HomePhoneValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.HomePhoneValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // WorkPhoneValue + // + this.WorkPhoneValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.WorkPhoneValue.Location = new System.Drawing.Point(80, 89); + this.WorkPhoneValue.Margin = new System.Windows.Forms.Padding(4); + this.WorkPhoneValue.Name = "WorkPhoneValue"; + this.WorkPhoneValue.oldText = null; + this.WorkPhoneValue.Size = new System.Drawing.Size(229, 22); + this.WorkPhoneValue.TabIndex = 5; + this.WorkPhoneValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.WorkPhoneValue.Validated += new System.EventHandler(this.Value_TextChanged); + // + // CellularPhoneValue + // + this.CellularPhoneValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.CellularPhoneValue.Location = new System.Drawing.Point(80, 55); + this.CellularPhoneValue.Margin = new System.Windows.Forms.Padding(4); + this.CellularPhoneValue.Name = "CellularPhoneValue"; + this.CellularPhoneValue.oldText = null; + this.CellularPhoneValue.Size = new System.Drawing.Size(229, 22); + this.CellularPhoneValue.TabIndex = 3; + this.CellularPhoneValue.LostFocus += new System.EventHandler(this.Value_TextChanged); + this.CellularPhoneValue.Validated += new System.EventHandler(this.Value_TextChanged); + // // MainForm // this.AllowDrop = true; @@ -1316,13 +788,6 @@ namespace vCardEditor.View this.toolStrip1.PerformLayout(); this.gbContactDetail.ResumeLayout(false); this.groupBox4.ResumeLayout(false); - this.tbcAddress.ResumeLayout(false); - this.tbHome.ResumeLayout(false); - this.tbHome.PerformLayout(); - this.tbWork.ResumeLayout(false); - this.tbWork.PerformLayout(); - this.tbPostal.ResumeLayout(false); - this.tbPostal.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -1385,18 +850,6 @@ namespace vCardEditor.View internal StateTextBox FormattedTitleValue; internal System.Windows.Forms.Label FormattedTitleLabel; private System.Windows.Forms.GroupBox groupBox4; - internal StateTextBox HomeCountryValue; - internal System.Windows.Forms.Label Country; - internal StateTextBox HomeStateValue; - internal System.Windows.Forms.Label StateLabel; - internal StateTextBox HomeZipValue; - internal System.Windows.Forms.Label ZipLabel; - internal StateTextBox HomeCityValue; - internal System.Windows.Forms.Label CityLabel; - internal StateTextBox HomePOBoxValue; - internal System.Windows.Forms.Label POBoxLabel; - internal StateTextBox HomeAddressValue; - internal System.Windows.Forms.Label AddressLabel; internal StateTextBox lastNameValue; internal System.Windows.Forms.Label label3; internal StateTextBox middleNameValue; @@ -1404,33 +857,6 @@ namespace vCardEditor.View internal StateTextBox firstNameValue; internal System.Windows.Forms.Label label1; private System.Windows.Forms.ToolStripMenuItem miSave; - private System.Windows.Forms.TabPage tbHome; - private System.Windows.Forms.TabPage tbWork; - internal System.Windows.Forms.Label label9; - internal StateTextBox WorkAddressValue; - internal System.Windows.Forms.Label label8; - internal StateTextBox WorkCountryValue; - internal System.Windows.Forms.Label label5; - internal StateTextBox WorkPOBoxValue; - internal StateTextBox WorkZipValue; - internal System.Windows.Forms.Label label7; - internal System.Windows.Forms.Label label4; - internal System.Windows.Forms.Label label6; - internal StateTextBox WorkCityValue; - internal StateTextBox WorkStateValue; - private System.Windows.Forms.TabPage tbPostal; - internal System.Windows.Forms.Label label10; - internal StateTextBox PostalAddressValue; - internal System.Windows.Forms.Label label11; - internal StateTextBox PostalCountryValue; - internal System.Windows.Forms.Label label12; - internal StateTextBox PostalPOBoxValue; - internal StateTextBox PostalZipValue; - internal System.Windows.Forms.Label label13; - internal System.Windows.Forms.Label label14; - internal System.Windows.Forms.Label label15; - internal StateTextBox PostalCityValue; - internal StateTextBox PostalStateValue; private System.Windows.Forms.ToolStripButton tbsNew; private System.Windows.Forms.ToolStripSeparator toolStripSeparator; private System.Windows.Forms.Button btnRemoveImage; diff --git a/vCardEditor/View/MainForm.cs b/vCardEditor/View/MainForm.cs index f745521..297f014 100644 --- a/vCardEditor/View/MainForm.cs +++ b/vCardEditor/View/MainForm.cs @@ -8,7 +8,7 @@ using Thought.vCards; using vCardEditor.Repository; using vCardEditor.Model; using System.Drawing; -using System.Runtime.InteropServices; +using System.Collections.Generic; namespace vCardEditor.View { @@ -25,10 +25,13 @@ namespace vCardEditor.View public event EventHandler TextBoxValueChanged; public event EventHandler> CloseForm; public event EventHandler> ModifyImage; + public event EventHandler>> AddressAdded; + public event EventHandler> AddressRemoved; public event EventHandler ExportImage; ComponentResourceManager resources; + public int SelectedContactIndex { get @@ -45,11 +48,12 @@ namespace vCardEditor.View { InitializeComponent(); resources = new ComponentResourceManager(typeof(MainForm)); - + tbcAddress.AddTab += (sender, e) => AddressAdded?.Invoke(sender, e); + tbcAddress.RemoveTab += (sender, e) => AddressRemoved?.Invoke(sender, e); + tbcAddress.TextChangedEvent += (sender, e) => TextBoxValueChanged?.Invoke(sender, e); BuildMRUMenu(); } - private void tbsOpen_Click(object sender, EventArgs e) { NewFileOpened?.Invoke(sender, new EventArg(string.Empty)); @@ -78,14 +82,13 @@ namespace vCardEditor.View private void tbsNew_Click(object sender, EventArgs e) { AddContact?.Invoke(sender, e); - } private void dgContacts_SelectionChanged(object sender, EventArgs e) { if (ChangeContactsSelected != null && dgContacts.CurrentCell != null) { - vCard data = GetvCard(); + vCard data = GetvCardFromWindow(); ChangeContactsSelected(sender, new EventArg(data)); } else @@ -116,7 +119,7 @@ namespace vCardEditor.View SetSummaryValue(WorkPhoneValue, card.Phones.GetFirstChoice(vCardPhoneTypes.Work)); SetSummaryValue(EmailAddressValue, card.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet)); SetSummaryValue(PersonalWebSiteValue, card.Websites.GetFirstChoice(vCardWebsiteTypes.Personal)); - SetAddressesValues(card.DeliveryAddresses); + SetAddressesValues(card); SetPhotoValue(card.Photos); } @@ -136,7 +139,7 @@ namespace vCardEditor.View SetSummaryValue(WorkPhoneValue, string.Empty); SetSummaryValue(EmailAddressValue, string.Empty); SetSummaryValue(PersonalWebSiteValue, string.Empty); - SetAddressesValues(new vCardDeliveryAddressCollection()); + SetAddressesValues(new vCard()); SetPhotoValue(new vCardPhotoCollection()); } @@ -198,72 +201,11 @@ namespace vCardEditor.View PhotoBox.Image = (Image)resources.GetObject("PhotoBox.Image"); } - private void SetAddressesValues(vCardDeliveryAddressCollection addresses) + private void SetAddressesValues(vCard card) { - ClearAddressTextFields(); - - if (addresses.Any()) - { - var HomeAddress = addresses.Where(x => x.IsHome).FirstOrDefault(); - if (HomeAddress != null) - { - HomeAddressValue.Text = HomeAddress.Street; - HomeCityValue.Text = HomeAddress.City; - HomeZipValue.Text = HomeAddress.PostalCode; - HomeStateValue.Text = HomeAddress.Region; - HomeCountryValue.Text = HomeAddress.Country; - } - - var WorkAddress = addresses.Where(x => x.IsWork).FirstOrDefault(); - if (WorkAddress != null) - { - WorkAddressValue.Text = WorkAddress.Street; - WorkCityValue.Text = WorkAddress.City; - WorkZipValue.Text = WorkAddress.PostalCode; - WorkStateValue.Text = WorkAddress.Region; - WorkCountryValue.Text = WorkAddress.Country; - } - - var PostalAddress = addresses.Where(x => x.IsPostal).FirstOrDefault(); - if (PostalAddress != null) - { - PostalAddressValue.Text = PostalAddress.Street; - PostalAddressValue.Text = PostalAddress.Street; - PostalCityValue.Text = PostalAddress.City; - PostalZipValue.Text = PostalAddress.PostalCode; - PostalStateValue.Text = PostalAddress.Region; - PostalCountryValue.Text = PostalAddress.Country; - } - - } - + tbcAddress.SetAddresses(card); } - private void ClearAddressTextFields() - { - HomeAddressValue.Clear(); - HomePOBoxValue.Clear(); - HomeCityValue.Clear(); - HomeZipValue.Clear(); - HomeStateValue.Clear(); - HomeCountryValue.Clear(); - - WorkAddressValue.Clear(); - WorkPOBoxValue.Clear(); - WorkCityValue.Clear(); - WorkZipValue.Clear(); - WorkStateValue.Clear(); - WorkCountryValue.Clear(); - - PostalAddressValue.Clear(); - PostalPOBoxValue.Clear(); - PostalCityValue.Clear(); - PostalZipValue.Clear(); - PostalStateValue.Clear(); - PostalCountryValue.Clear(); - } - - private void tbsDelete_Click(object sender, EventArgs e) { if (DeleteContact != null) @@ -283,7 +225,7 @@ namespace vCardEditor.View private void textBoxFilter_TextChanged(object sender, EventArgs e) { //Save before leaving contact. - BeforeLeavingContact?.Invoke(sender, new EventArg(GetvCard())); + BeforeLeavingContact?.Invoke(sender, new EventArg(GetvCardFromWindow())); FilterTextChanged?.Invoke(sender, new EventArg(textBoxFilter.Text)); } @@ -294,10 +236,10 @@ namespace vCardEditor.View } /// - /// Generate a vcard from differents fields + /// Generate a vcard from differents fields on the form. /// /// - private vCard GetvCard() + private vCard GetvCardFromWindow() { vCard card = new vCard { @@ -316,32 +258,21 @@ namespace vCardEditor.View card.Phones.Add(new vCardPhone(CellularPhoneValue.Text, vCardPhoneTypes.Cellular)); if (!string.IsNullOrEmpty(WorkPhoneValue.Text)) card.Phones.Add(new vCardPhone(WorkPhoneValue.Text, vCardPhoneTypes.Work)); - if (!string.IsNullOrEmpty(this.EmailAddressValue.Text)) card.EmailAddresses.Add(new vCardEmailAddress(this.EmailAddressValue.Text)); - if (!string.IsNullOrEmpty(this.PersonalWebSiteValue.Text)) card.Websites.Add(new vCardWebsite(this.PersonalWebSiteValue.Text)); - if (!string.IsNullOrEmpty(this.HomeAddressValue.Text)) - card.DeliveryAddresses.Add(new vCardDeliveryAddress(HomeAddressValue.Text, HomeCityValue.Text, HomeStateValue.Text, HomeCountryValue.Text, - HomePOBoxValue.Text, vCardDeliveryAddressTypes.Home)); - - - if (!string.IsNullOrEmpty(this.WorkAddressValue.Text)) - card.DeliveryAddresses.Add(new vCardDeliveryAddress(WorkAddressValue.Text, WorkCityValue.Text, WorkStateValue.Text, WorkCountryValue.Text, - WorkPOBoxValue.Text, vCardDeliveryAddressTypes.Work)); - - if (!string.IsNullOrEmpty(this.PostalAddressValue.Text)) - card.DeliveryAddresses.Add(new vCardDeliveryAddress(PostalAddressValue.Text, PostalCityValue.Text, PostalStateValue.Text, PostalCountryValue.Text, - PostalPOBoxValue.Text, vCardDeliveryAddressTypes.Postal)); + + + tbcAddress.getDeliveryAddress(card); return card; } private void dgContacts_RowLeave(object sender, DataGridViewCellEventArgs e) { - vCard data = GetvCard(); + vCard data = GetvCardFromWindow(); BeforeLeavingContact?.Invoke(sender, new EventArg(data)); } @@ -460,7 +391,7 @@ namespace vCardEditor.View var evt = new EventArg(fileName); ModifyImage(sender, evt); } - catch (ArgumentException ex) + catch (ArgumentException) { MessageBox.Show($"Invalid file! : {fileName}"); } @@ -482,7 +413,5 @@ namespace vCardEditor.View { ExportImage?.Invoke(sender, e); } - - } } diff --git a/vCardEditor/vCardEditor.csproj b/vCardEditor/vCardEditor.csproj index 05469e4..8712046 100644 --- a/vCardEditor/vCardEditor.csproj +++ b/vCardEditor/vCardEditor.csproj @@ -133,6 +133,18 @@ ConfigDialog.cs + + Form + + + AddAddress.cs + + + UserControl + + + AddressBox.cs + Component @@ -164,6 +176,12 @@ ConfigDialog.cs + + AddAddress.cs + + + AddressBox.cs + MainForm.cs