diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Web/DataFormats/AddressBook/WABDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/AddressBook/WABDataFormat.cs similarity index 100% rename from CSharp/Plugins/UniversalEditor.Plugins.Web/DataFormats/AddressBook/WABDataFormat.cs rename to CSharp/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/AddressBook/WABDataFormat.cs diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/Contact/Microsoft/ContactDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/Contact/Microsoft/ContactDataFormat.cs new file mode 100644 index 00000000..2eb495c7 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/Contact/Microsoft/ContactDataFormat.cs @@ -0,0 +1,532 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UniversalEditor.DataFormats.Markup.XML; +using UniversalEditor.ObjectModels.Contact; +using UniversalEditor.ObjectModels.Markup; + +namespace UniversalEditor.DataFormats.Contact.Microsoft +{ + public class ContactDataFormat : XMLDataFormat + { + private static DataFormatReference _dfr = null; + protected override DataFormatReference MakeReferenceInternal() + { + if (_dfr == null) + { + _dfr = new DataFormatReference(GetType()); + _dfr.Capabilities.Add(typeof(ContactObjectModel), DataFormatCapabilities.All); + } + return _dfr; + } + + protected override void BeforeLoadInternal(Stack objectModels) + { + base.BeforeLoadInternal(objectModels); + objectModels.Push(new MarkupObjectModel()); + } + protected override void AfterLoadInternal(Stack objectModels) + { + base.AfterLoadInternal(objectModels); + + MarkupObjectModel mom = (objectModels.Pop() as MarkupObjectModel); + ContactObjectModel contact = (objectModels.Pop() as ContactObjectModel); + + MarkupTagElement tagContact = (mom.Elements["c:contact"] as MarkupTagElement); + if (tagContact == null) throw new InvalidDataFormatException("File does not contain a top-level 'c:contact' element"); + + MarkupTagElement tagNotes = (tagContact.Elements["c:Notes"] as MarkupTagElement); + if (tagNotes != null) + { + LoadContactComplexType(tagNotes, contact.Notes); + contact.Notes.Content = tagNotes.Value; + } + + MarkupTagElement tagGender = (tagContact.Elements["c:Gender"] as MarkupTagElement); + if (tagGender != null) + { + switch (tagGender.Value) + { + case "Unspecified": + { + contact.Gender = ContactGender.Unspecified; + break; + } + case "Male": + { + contact.Gender = ContactGender.Male; + break; + } + case "Female": + { + contact.Gender = ContactGender.Female; + break; + } + } + } + + MarkupTagElement tagCreationDate = (tagContact.Elements["c:CreationDate"] as MarkupTagElement); + if (tagCreationDate != null) + { + contact.CreationDate = DateTime.Parse(tagCreationDate.Value); + } + + MarkupTagElement tagExtended = (tagContact.Elements["c:Extended"] as MarkupTagElement); + if (tagExtended != null) + { + foreach (MarkupElement item in tagExtended.Elements) + { + MarkupTagElement tag = (item as MarkupTagElement); + if (tag == null) continue; + + switch (tag.FullName) + { + case "MSWABMAPI:PropTag0x3A58101F": + { + MarkupAttribute attType = tag.Attributes["c:type"]; + MarkupAttribute attContentType = tag.Attributes["c:ContentType"]; + MarkupAttribute attVersion = tag.Attributes["c:Version"]; + + if (attContentType != null) + { + switch (attContentType.Value.ToLower()) + { + case "binary/x-ms-wab-mapi": + { + string content = tag.Value; + byte[] data = Convert.FromBase64String(content); + + // LoadContactComplexType(tag, item); + break; + } + } + } + break; + } + } + } + } + + #region ContactIdentifiers + MarkupTagElement tagContactIDCollection = (tagContact.Elements["c:ContactIDCollection"] as MarkupTagElement); + if (tagContactIDCollection != null) + { + foreach (MarkupElement el in tagContactIDCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:ContactID") continue; + + ContactIdentifier id = new ContactIdentifier(); + LoadContactComplexType(tag, id); + + MarkupTagElement tagValue = (tag.Elements["c:Value"] as MarkupTagElement); + id.Value = new Guid(tagValue.Value); + + contact.Identifiers.Add(id); + } + } + #endregion + #region EmailAddresses + MarkupTagElement tagEmailAddressCollection = (tagContact.Elements["c:EmailAddressCollection"] as MarkupTagElement); + if (tagEmailAddressCollection != null) + { + foreach (MarkupElement el in tagEmailAddressCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:EmailAddress") continue; + + ContactEmailAddress item = new ContactEmailAddress(); + + MarkupTagElement tagType = (tag.Elements["c:Type"] as MarkupTagElement); + if (tagType != null) item.Type = tagType.Value; + + MarkupTagElement tagAddress = (tag.Elements["c:Address"] as MarkupTagElement); + if (tagAddress != null) item.Address = tagAddress.Value; + + LoadContactComplexType(tag, item); + LoadLabelCollection(tag.Elements["c:LabelCollection"] as MarkupTagElement, item); + + contact.EmailAddresses.Add(item); + } + } + #endregion + #region Names + MarkupTagElement tagNameCollection = (tagContact.Elements["c:NameCollection"] as MarkupTagElement); + if (tagNameCollection != null) + { + foreach (MarkupElement elName in tagNameCollection.Elements) + { + MarkupTagElement tagName = (elName as MarkupTagElement); + if (tagName == null) continue; + if (tagName.FullName != "c:Name") continue; + + ContactName item = new ContactName(); + + LoadContactComplexType(tagName, item); + + MarkupTagElement tagNickName = (tagName.Elements["c:NickName"] as MarkupTagElement); + if (tagNickName != null) item.Nickname = tagNickName.Value; + + MarkupTagElement tagTitle = (tagName.Elements["c:Title"] as MarkupTagElement); + if (tagTitle != null) item.Nickname = tagTitle.Value; + + MarkupTagElement tagFormattedName = (tagName.Elements["c:FormattedName"] as MarkupTagElement); + if (tagFormattedName != null) item.FormattedName = tagFormattedName.Value; + + MarkupTagElement tagFamilyName = (tagName.Elements["c:FamilyName"] as MarkupTagElement); + if (tagFamilyName != null) item.FamilyName = tagFamilyName.Value; + + MarkupTagElement tagMiddleName = (tagName.Elements["c:MiddleName"] as MarkupTagElement); + if (tagMiddleName != null) item.MiddleName = tagMiddleName.Value; + + MarkupTagElement tagGivenName = (tagName.Elements["c:GivenName"] as MarkupTagElement); + if (tagGivenName != null) item.GivenName = tagGivenName.Value; + + contact.Names.Add(item); + } + } + #endregion + #region Physical Addresses + MarkupTagElement tagPhysicalAddressCollection = (tagContact.Elements["c:PhysicalAddressCollection"] as MarkupTagElement); + if (tagPhysicalAddressCollection != null) + { + foreach (MarkupElement el in tagPhysicalAddressCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:PhysicalAddress") continue; + + ContactPhysicalAddress item = new ContactPhysicalAddress(); + + #region Attributes + { + MarkupAttribute attElementID = tag.Attributes["c:ElementID"]; + if (attElementID != null) item.ElementID = new Guid(attElementID.Value); + + MarkupAttribute attVersion = tag.Attributes["c:Version"]; + if (attVersion != null) + { + + } + + MarkupAttribute attModificationDate = tag.Attributes["c:ModificationDate"]; + if (attModificationDate != null) item.ModificationDate = DateTime.Parse(attModificationDate.Value); + } + #endregion + + #region Country + { + MarkupTagElement tag1 = (tag.Elements["c:Country"] as MarkupTagElement); + if (tag1 != null) + { + MarkupAttribute attVersion = tag1.Attributes["c:Version"]; + if (attVersion != null) + { + + } + + string value = tag1.Value; + DateTime modificationDate = DateTime.Now; + + MarkupAttribute attModificationDate = tag1.Attributes["c:ModificationDate"]; + if (attModificationDate != null) modificationDate = DateTime.Parse(attModificationDate.Value); + + item.Country = new ContactGenericField(value, modificationDate); + } + } + #endregion + #region PostalCode + { + MarkupTagElement tag1 = (tag.Elements["c:PostalCode"] as MarkupTagElement); + if (tag1 != null) + { + MarkupAttribute attVersion = tag1.Attributes["c:Version"]; + if (attVersion != null) + { + + } + + string value = tag1.Value; + DateTime modificationDate = DateTime.Now; + + MarkupAttribute attModificationDate = tag1.Attributes["c:ModificationDate"]; + if (attModificationDate != null) modificationDate = DateTime.Parse(attModificationDate.Value); + + item.PostalCode = new ContactGenericField(value, modificationDate); + } + } + #endregion + #region Region + { + MarkupTagElement tag1 = (tag.Elements["c:Region"] as MarkupTagElement); + if (tag1 != null) + { + MarkupAttribute attVersion = tag1.Attributes["c:Version"]; + if (attVersion != null) + { + + } + + string value = tag1.Value; + DateTime modificationDate = DateTime.Now; + + MarkupAttribute attModificationDate = tag1.Attributes["c:ModificationDate"]; + if (attModificationDate != null) modificationDate = DateTime.Parse(attModificationDate.Value); + + item.Region = new ContactGenericField(value, modificationDate); + } + } + #endregion + #region Locality + { + MarkupTagElement tag1 = (tag.Elements["c:Locality"] as MarkupTagElement); + if (tag1 != null) + { + MarkupAttribute attVersion = tag1.Attributes["c:Version"]; + if (attVersion != null) + { + + } + + string value = tag1.Value; + DateTime modificationDate = DateTime.Now; + + MarkupAttribute attModificationDate = tag1.Attributes["c:ModificationDate"]; + if (attModificationDate != null) modificationDate = DateTime.Parse(attModificationDate.Value); + + item.Locality = new ContactGenericField(value, modificationDate); + } + } + #endregion + #region Street + { + MarkupTagElement tag1 = (tag.Elements["c:Street"] as MarkupTagElement); + if (tag1 != null) + { + MarkupAttribute attVersion = tag1.Attributes["c:Version"]; + if (attVersion != null) + { + + } + + string value = tag1.Value; + DateTime modificationDate = DateTime.Now; + + MarkupAttribute attModificationDate = tag1.Attributes["c:ModificationDate"]; + if (attModificationDate != null) modificationDate = DateTime.Parse(attModificationDate.Value); + + item.StreetAddress = new ContactGenericField(value, modificationDate); + } + } + #endregion + #region Labels + { + LoadLabelCollection(tag.Elements["c:LabelCollection"] as MarkupTagElement, item); + } + #endregion + + contact.PhysicalAddresses.Add(item); + } + } + #endregion + #region Phone Numbers + MarkupTagElement tagPhoneNumberCollection = (tagContact.Elements["c:PhoneNumberCollection"] as MarkupTagElement); + if (tagPhoneNumberCollection != null) + { + foreach (MarkupElement el in tagPhoneNumberCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:PhoneNumber") continue; + + ContactPhoneNumber item = new ContactPhoneNumber(); + + LoadContactComplexType(tag, item); + + MarkupTagElement tagNumber = (tag.Elements["c:Number"] as MarkupTagElement); + if (tagNumber != null) + { + item.Value = tagNumber.Value; + } + + LoadLabelCollection(tag, item); + + contact.PhoneNumbers.Add(item); + } + } + #endregion + #region Relationships + MarkupTagElement tagPersonCollection = (tagContact.Elements["c:PersonCollection"] as MarkupTagElement); + if (tagPersonCollection != null) + { + foreach (MarkupElement el in tagPersonCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:Person") continue; + + ContactRelationship item = new ContactRelationship(); + + LoadContactComplexType(tag, item); + + MarkupTagElement tagFormattedName = (tag.Elements["c:FormattedName"] as MarkupTagElement); + if (tagFormattedName != null) + { + item.FormattedName = tagFormattedName.Value; + } + + LoadLabelCollection(tag, item); + + contact.Relationships.Add(item); + } + } + #endregion + #region Photos + MarkupTagElement tagPhotoCollection = (tagContact.Elements["c:PhotoCollection"] as MarkupTagElement); + if (tagPhotoCollection != null) + { + foreach (MarkupElement el in tagPhotoCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:Photo") continue; + + ContactPhoto item = new ContactPhoto(); + + LoadContactComplexType(tag, item); + + + LoadLabelCollection(tag, item); + + contact.Photos.Add(item); + } + } + #endregion + #region Dates + MarkupTagElement tagDateCollection = (tagContact.Elements["c:DateCollection"] as MarkupTagElement); + if (tagDateCollection != null) + { + foreach (MarkupElement el in tagDateCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:Date") continue; + + ContactDate item = new ContactDate(); + + LoadContactComplexType(tag, item); + + MarkupTagElement tagValue = (tag.Elements["c:Value"] as MarkupTagElement); + if (tagValue != null) item.Value = DateTime.Parse(tagValue.Value); + + LoadLabelCollection(tag, item); + + contact.Dates.Add(item); + } + } + #endregion + #region Positions + MarkupTagElement tagPositionCollection = (tagContact.Elements["c:PositionCollection"] as MarkupTagElement); + if (tagPositionCollection != null) + { + foreach (MarkupElement el in tagPositionCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:Date") continue; + + ContactPosition item = new ContactPosition(); + + LoadContactComplexType(tag, item); + + MarkupTagElement tagOffice = (tag.Elements["c:Office"] as MarkupTagElement); + if (tagOffice != null) item.Office = new ContactGenericField(tagOffice.Value); + + MarkupTagElement tagDepartment = (tag.Elements["c:Department"] as MarkupTagElement); + if (tagDepartment != null) item.Department = new ContactGenericField(tagDepartment.Value); + + MarkupTagElement tagJobTitle = (tag.Elements["c:JobTitle"] as MarkupTagElement); + if (tagJobTitle != null) item.JobTitle = new ContactGenericField(tagJobTitle.Value); + + MarkupTagElement tagCompany = (tag.Elements["c:Company"] as MarkupTagElement); + if (tagCompany != null) item.JobTitle = new ContactGenericField(tagCompany.Value); + + LoadLabelCollection(tag, item); + + contact.Positions.Add(item); + } + } + #endregion + #region URLs + MarkupTagElement tagUrlCollection = (tagContact.Elements["c:UrlCollection"] as MarkupTagElement); + if (tagUrlCollection != null) + { + foreach (MarkupElement el in tagUrlCollection.Elements) + { + MarkupTagElement tag = (el as MarkupTagElement); + if (tag == null) continue; + if (tag.FullName != "c:Url") continue; + + ContactUrl item = new ContactUrl(); + + LoadContactComplexType(tag, item); + + MarkupTagElement tagValue = (tag.Elements["c:Value"] as MarkupTagElement); + if (tagValue != null) item.Value = tagValue.Value; + + LoadLabelCollection(tag, item); + + contact.Urls.Add(item); + } + } + #endregion + } + + private void LoadContactComplexType(MarkupTagElement tag, IContactComplexType item) + { + MarkupAttribute attXsiNil = tag.Attributes["xsi:nil"]; + if (attXsiNil != null && attXsiNil.Value == "true") item.IsEmpty = true; + + MarkupAttribute attModificationDate = tag.Attributes["c:ModificationDate"]; + if (attModificationDate != null) + { + item.ModificationDate = DateTime.Parse(attModificationDate.Value); + } + } + + private void LoadLabelCollection(MarkupTagElement tag, IContactLabelContainer item) + { + if (tag != null) + { + foreach (MarkupElement el in tag.Elements) + { + MarkupTagElement tag1 = (el as MarkupTagElement); + if (tag1 == null) continue; + if (tag1.FullName != "c:Label") continue; + + ContactLabel label = new ContactLabel(); + + MarkupAttribute attVersion = tag1.Attributes["c:Version"]; + if (attVersion != null) + { + + } + + label.Value = tag1.Value; + + MarkupAttribute attModificationDate = tag1.Attributes["c:ModificationDate"]; + if (attModificationDate != null) label.ModificationDate = DateTime.Parse(attModificationDate.Value); + + item.Labels.Add(label); + } + } + } + protected override void BeforeSaveInternal(Stack objectModels) + { + base.BeforeSaveInternal(objectModels); + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Web/ObjectModels/AddressBook/AddressBookObjectModel.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/AddressBook/AddressBookObjectModel.cs similarity index 100% rename from CSharp/Plugins/UniversalEditor.Plugins.Web/ObjectModels/AddressBook/AddressBookObjectModel.cs rename to CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/AddressBook/AddressBookObjectModel.cs diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactDate.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactDate.cs new file mode 100644 index 00000000..cb0d75dc --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactDate.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactDate : ICloneable, IContactLabelContainer, IContactComplexType + { + public class ContactDateCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private DateTime? mvarValue = null; + public DateTime? Value { get { return mvarValue; } set { mvarValue = value; } } + + private ContactLabel.ContactLabelCollection mvarLabels = new ContactLabel.ContactLabelCollection(); + public ContactLabel.ContactLabelCollection Labels { get { return mvarLabels; } } + + public object Clone() + { + ContactDate clone = new ContactDate(); + clone.ElementID = mvarElementID; + clone.IsEmpty = mvarIsEmpty; + foreach (ContactLabel item in mvarLabels) + { + clone.Labels.Add(item.Clone() as ContactLabel); + } + clone.ModificationDate = mvarModificationDate; + clone.Value = mvarValue; + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactEmailAddress.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactEmailAddress.cs new file mode 100644 index 00000000..e51dd5fb --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactEmailAddress.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactEmailAddress : ICloneable, IContactLabelContainer, IContactComplexType + { + public class ContactEmailAddressCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private string mvarType = String.Empty; + public string Type { get { return mvarType; } set { mvarType = value; } } + + private string mvarAddress = String.Empty; + public string Address { get { return mvarAddress; } set { mvarAddress = value; } } + + private ContactLabel.ContactLabelCollection mvarLabels = new ContactLabel.ContactLabelCollection(); + public ContactLabel.ContactLabelCollection Labels { get { return mvarLabels; } } + + public object Clone() + { + ContactEmailAddress clone = new ContactEmailAddress(); + clone.Address = (mvarAddress.Clone() as string); + clone.ElementID = mvarElementID; + clone.IsEmpty = mvarIsEmpty; + foreach (ContactLabel item in mvarLabels) + { + clone.Labels.Add(item.Clone() as string); + } + clone.ModificationDate = mvarModificationDate; + clone.Type = (mvarType.Clone() as string); + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactGender.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactGender.cs new file mode 100644 index 00000000..1bf770c1 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactGender.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactGender + { + private static ContactGender mvarMale = new ContactGender("Male", "Male"); + public static ContactGender Male { get { return Male; } } + + private static ContactGender mvarFemale = new ContactGender("Female", "Female"); + public static ContactGender Female { get { return Female; } } + + private static ContactGender mvarUnspecified = new ContactGender("Unspecified", "Unspecified"); + public static ContactGender Unspecified { get { return mvarUnspecified; } } + + private string mvarValue = String.Empty; + private string mvarTitle = String.Empty; + public string Title { get { return mvarTitle; } set { mvarTitle = value; } } + + public ContactGender(string value, string title) + { + mvarValue = value; + mvarTitle = title; + } + + public override string ToString() + { + return mvarTitle; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactGenericField.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactGenericField.cs new file mode 100644 index 00000000..23b4e6bb --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactGenericField.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public struct ContactGenericField + { + private DateTime mvarModificationDate; + public DateTime ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + + private T mvarValue; + public T Value { get { return mvarValue; } set { mvarValue = value; } } + + public static readonly ContactGenericField Empty = new ContactGenericField(default(T)); + + public ContactGenericField(T value, DateTime? modificationDate = null) + { + mvarValue = value; + if (modificationDate != null) + { + mvarModificationDate = modificationDate.Value; + } + else + { + mvarModificationDate = DateTime.Now; + } + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactIdentifier.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactIdentifier.cs new file mode 100644 index 00000000..f37d9e14 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactIdentifier.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactIdentifier : ICloneable, IContactComplexType + { + public class ContactIdentifierCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private Guid mvarValue = Guid.Empty; + public Guid Value { get { return mvarValue; } set { mvarValue = value; } } + + public object Clone() + { + ContactIdentifier clone = new ContactIdentifier(); + clone.ElementID = mvarElementID; + clone.IsEmpty = mvarIsEmpty; + clone.ModificationDate = mvarModificationDate; + clone.Value = mvarValue; + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactLabel.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactLabel.cs new file mode 100644 index 00000000..29b5ba12 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactLabel.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactLabel : ICloneable, IContactComplexType + { + public class ContactLabelCollection + : System.Collections.ObjectModel.Collection + { + public ContactLabel Add(string value, DateTime? modificationDate = null) + { + ContactLabel item = new ContactLabel(); + item.Value = value; + item.ModificationDate = modificationDate; + Add(item); + return item; + } + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private string mvarValue = String.Empty; + public string Value { get { return mvarValue; } set { mvarValue = value; } } + + public object Clone() + { + ContactLabel clone = new ContactLabel(); + clone.ModificationDate = mvarModificationDate; + clone.Value = (mvarValue.Clone() as string); + return clone; + } + + public override string ToString() + { + return mvarValue; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactName.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactName.cs new file mode 100644 index 00000000..47520717 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactName.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactName : ICloneable, IContactComplexType + { + public class ContactNameCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private string mvarNickname = String.Empty; + public string Nickname { get { return mvarNickname; } set { mvarNickname = value; } } + + private string mvarTitle = String.Empty; + public string Title { get { return mvarTitle; } set { mvarTitle = value; } } + + private string mvarFormattedName = String.Empty; + public string FormattedName { get { return mvarFormattedName; } set { mvarFormattedName = value; } } + + private string mvarFamilyName = String.Empty; + public string FamilyName { get { return mvarFamilyName; } set { mvarFamilyName = value; } } + + private string mvarMiddleName = String.Empty; + public string MiddleName { get { return mvarMiddleName; } set { mvarMiddleName = value; } } + + private string mvarGivenName = String.Empty; + public string GivenName { get { return mvarGivenName; } set { mvarGivenName = value; } } + + public object Clone() + { + ContactName clone = new ContactName(); + clone.IsEmpty = mvarIsEmpty; + clone.ModificationDate = mvarModificationDate; + clone.ElementID = mvarElementID; + clone.FamilyName = (mvarFamilyName.Clone() as string); + clone.FormattedName = (mvarFormattedName.Clone() as string); + clone.GivenName = (mvarGivenName.Clone() as string); + clone.MiddleName = (mvarMiddleName.Clone() as string); + clone.Nickname = (mvarNickname.Clone() as string); + clone.Title = (mvarTitle.Clone() as string); + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactNotes.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactNotes.cs new file mode 100644 index 00000000..b3885155 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactNotes.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactNotes : IContactComplexType + { + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private string mvarContent = String.Empty; + public string Content { get { return mvarContent; } set { mvarContent = value; } } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactObjectModel.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactObjectModel.cs new file mode 100644 index 00000000..82fe942e --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactObjectModel.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactObjectModel : ObjectModel + { + private static ObjectModelReference _omr = null; + protected override ObjectModelReference MakeReferenceInternal() + { + if (_omr == null) + { + _omr = base.MakeReferenceInternal(); + _omr.Title = "Contact"; + _omr.Path = new string[] { "General" }; + } + return _omr; + } + + private ContactNotes mvarNotes = new ContactNotes(); + public ContactNotes Notes { get { return mvarNotes; } } + + private ContactGender mvarGender = ContactGender.Unspecified; + public ContactGender Gender { get { return mvarGender; } set { mvarGender = value; } } + + private DateTime mvarCreationDate = DateTime.Now; + public DateTime CreationDate { get { return mvarCreationDate; } set { mvarCreationDate = value; } } + + private ContactIdentifier.ContactIdentifierCollection mvarIdentifiers = new ContactIdentifier.ContactIdentifierCollection(); + public ContactIdentifier.ContactIdentifierCollection Identifiers { get { return mvarIdentifiers; } } + + private ContactEmailAddress.ContactEmailAddressCollection mvarEmailAddresses = new ContactEmailAddress.ContactEmailAddressCollection(); + public ContactEmailAddress.ContactEmailAddressCollection EmailAddresses { get { return mvarEmailAddresses; } } + + private ContactName.ContactNameCollection mvarNames = new ContactName.ContactNameCollection(); + public ContactName.ContactNameCollection Names { get { return mvarNames; } } + + private ContactPhysicalAddress.ContactPhysicalAddressCollection mvarPhysicalAddresses = new ContactPhysicalAddress.ContactPhysicalAddressCollection(); + public ContactPhysicalAddress.ContactPhysicalAddressCollection PhysicalAddresses { get { return mvarPhysicalAddresses; } } + + private ContactPhoneNumber.ContactPhoneNumberCollection mvarPhoneNumbers = new ContactPhoneNumber.ContactPhoneNumberCollection(); + public ContactPhoneNumber.ContactPhoneNumberCollection PhoneNumbers { get { return mvarPhoneNumbers; } } + + private ContactRelationship.ContactRelationshipCollection mvarRelationships = new ContactRelationship.ContactRelationshipCollection(); + public ContactRelationship.ContactRelationshipCollection Relationships { get { return mvarRelationships; } } + + private ContactPhoto.ContactPhotoCollection mvarPhotos = new ContactPhoto.ContactPhotoCollection(); + public ContactPhoto.ContactPhotoCollection Photos { get { return mvarPhotos; } } + + private ContactDate.ContactDateCollection mvarDates = new ContactDate.ContactDateCollection(); + public ContactDate.ContactDateCollection Dates { get { return mvarDates; } } + + private ContactPosition.ContactPositionCollection mvarPositions = new ContactPosition.ContactPositionCollection(); + public ContactPosition.ContactPositionCollection Positions { get { return mvarPositions; } } + + private ContactUrl.ContactUrlCollection mvarUrls = new ContactUrl.ContactUrlCollection(); + public ContactUrl.ContactUrlCollection Urls { get { return mvarUrls; } } + + public override void Clear() + { + mvarNotes = new ContactNotes(); + mvarGender = ContactGender.Unspecified; + mvarCreationDate = DateTime.Now; + mvarIdentifiers.Clear(); + mvarEmailAddresses.Clear(); + mvarNames.Clear(); + mvarPhysicalAddresses.Clear(); + mvarPhoneNumbers.Clear(); + mvarRelationships.Clear(); + mvarPhotos.Clear(); + mvarDates.Clear(); + mvarPositions.Clear(); + mvarUrls.Clear(); + } + + public override void CopyTo(ObjectModel where) + { + ContactObjectModel clone = (where as ContactObjectModel); + clone.Notes.Content = (mvarNotes.Content.Clone() as string); + clone.Notes.ModificationDate = mvarNotes.ModificationDate; + clone.Gender = mvarGender; + clone.CreationDate = mvarCreationDate; + foreach (ContactIdentifier item in mvarIdentifiers) + { + clone.Identifiers.Add(item.Clone() as ContactIdentifier); + } + foreach (ContactEmailAddress item in mvarEmailAddresses) + { + clone.EmailAddresses.Add(item.Clone() as ContactEmailAddress); + } + foreach (ContactName item in mvarNames) + { + clone.Names.Add(item.Clone() as ContactName); + } + foreach (ContactPhysicalAddress item in mvarPhysicalAddresses) + { + clone.PhysicalAddresses.Add(item.Clone() as ContactPhysicalAddress); + } + foreach (ContactPhoneNumber item in mvarPhoneNumbers) + { + clone.PhoneNumbers.Add(item.Clone() as ContactPhoneNumber); + } + foreach (ContactRelationship item in mvarRelationships) + { + clone.Relationships.Add(item.Clone() as ContactRelationship); + } + foreach (ContactPhoto item in mvarPhotos) + { + clone.Photos.Add(item.Clone() as ContactPhoto); + } + foreach (ContactDate item in mvarDates) + { + clone.Dates.Add(item.Clone() as ContactDate); + } + foreach (ContactPosition item in mvarPositions) + { + clone.Positions.Add(item.Clone() as ContactPosition); + } + foreach (ContactUrl item in mvarUrls) + { + clone.Urls.Add(item.Clone() as ContactUrl); + } + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhoneNumber.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhoneNumber.cs new file mode 100644 index 00000000..ef374af8 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhoneNumber.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactPhoneNumber : ICloneable, IContactLabelContainer, IContactComplexType + { + public class ContactPhoneNumberCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private ContactLabel.ContactLabelCollection mvarLabels = new ContactLabel.ContactLabelCollection(); + public ContactLabel.ContactLabelCollection Labels { get { return mvarLabels; } } + + private string mvarValue = String.Empty; + public string Value { get { return mvarValue; } set { mvarValue = value; } } + + public object Clone() + { + ContactPhoneNumber clone = new ContactPhoneNumber(); + clone.ElementID = mvarElementID; + clone.IsEmpty = mvarIsEmpty; + clone.ModificationDate = mvarModificationDate; + clone.Value = (mvarValue.Clone() as string); + foreach (ContactLabel item in mvarLabels) + { + clone.Labels.Add(item.Clone() as ContactLabel); + } + return clone; + } + + public override string ToString() + { + return mvarValue; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhoto.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhoto.cs new file mode 100644 index 00000000..0cdd882c --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhoto.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactPhoto : ICloneable, IContactLabelContainer, IContactComplexType + { + public class ContactPhotoCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private ContactLabel.ContactLabelCollection mvarLabels = new ContactLabel.ContactLabelCollection(); + public ContactLabel.ContactLabelCollection Labels { get { return mvarLabels; } } + + public object Clone() + { + ContactPhoto clone = new ContactPhoto(); + clone.ElementID = mvarElementID; + clone.IsEmpty = mvarIsEmpty; + foreach (ContactLabel item in mvarLabels) + { + clone.Labels.Add(item.Clone() as ContactLabel); + } + clone.ModificationDate = mvarModificationDate; + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhysicalAddress.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhysicalAddress.cs new file mode 100644 index 00000000..48331ae3 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPhysicalAddress.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactPhysicalAddress : ICloneable, IContactLabelContainer, IContactComplexType + { + public class ContactPhysicalAddressCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private ContactGenericField mvarCountry = ContactGenericField.Empty; + public ContactGenericField Country { get { return mvarCountry; } set { mvarCountry = value; } } + + private ContactGenericField mvarPostalCode = ContactGenericField.Empty; + public ContactGenericField PostalCode { get { return mvarPostalCode; } set { mvarPostalCode = value; } } + + private ContactGenericField mvarRegion = ContactGenericField.Empty; + public ContactGenericField Region { get { return mvarRegion; } set { mvarRegion = value; } } + + private ContactGenericField mvarLocality = ContactGenericField.Empty; + public ContactGenericField Locality { get { return mvarLocality; } set { mvarLocality = value; } } + + private ContactGenericField mvarStreetAddress = ContactGenericField.Empty; + public ContactGenericField StreetAddress { get { return mvarStreetAddress; } set { mvarStreetAddress = value; } } + + private ContactLabel.ContactLabelCollection mvarLabels = new ContactLabel.ContactLabelCollection(); + public ContactLabel.ContactLabelCollection Labels { get { return mvarLabels; } } + + public object Clone() + { + ContactPhysicalAddress clone = new ContactPhysicalAddress(); + clone.Country = mvarCountry; + clone.ElementID = mvarElementID; + foreach (ContactLabel item in mvarLabels) + { + clone.Labels.Add(item.Clone() as ContactLabel); + } + clone.IsEmpty = mvarIsEmpty; + clone.Locality = mvarLocality; + clone.ModificationDate = mvarModificationDate; + clone.PostalCode = mvarPostalCode; + clone.Region = mvarRegion; + clone.StreetAddress = mvarStreetAddress; + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPosition.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPosition.cs new file mode 100644 index 00000000..947cc45a --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactPosition.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactPosition : ICloneable, IContactLabelContainer, IContactComplexType + { + public class ContactPositionCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private ContactLabel.ContactLabelCollection mvarLabels = new ContactLabel.ContactLabelCollection(); + public ContactLabel.ContactLabelCollection Labels { get { return mvarLabels; } } + + private ContactGenericField mvarOffice = ContactGenericField.Empty; + public ContactGenericField Office { get { return mvarOffice; } set { mvarOffice = value; } } + + private ContactGenericField mvarDepartment = ContactGenericField.Empty; + public ContactGenericField Department { get { return mvarDepartment; } set { mvarDepartment = value; } } + + private ContactGenericField mvarJobTitle = ContactGenericField.Empty; + public ContactGenericField JobTitle { get { return mvarJobTitle; } set { mvarJobTitle = value; } } + + private ContactGenericField mvarCompany = ContactGenericField.Empty; + public ContactGenericField Company { get { return mvarCompany; } set { mvarCompany = value; } } + + public object Clone() + { + ContactPosition clone = new ContactPosition(); + clone.ElementID = mvarElementID; + clone.IsEmpty = mvarIsEmpty; + foreach (ContactLabel item in mvarLabels) + { + clone.Labels.Add(item.Clone() as string); + } + clone.ModificationDate = mvarModificationDate; + clone.Office = mvarOffice; + clone.Department = mvarDepartment; + clone.JobTitle = mvarJobTitle; + clone.Company = mvarCompany; + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactRelationship.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactRelationship.cs new file mode 100644 index 00000000..e4c91905 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactRelationship.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactRelationship : ICloneable, IContactLabelContainer, IContactComplexType + { + public class ContactRelationshipCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private string mvarFormattedName = String.Empty; + public string FormattedName { get { return mvarFormattedName; } set { mvarFormattedName = value; } } + + private ContactLabel.ContactLabelCollection mvarLabels = new ContactLabel.ContactLabelCollection(); + public ContactLabel.ContactLabelCollection Labels { get { return mvarLabels; } } + + public object Clone() + { + ContactRelationship clone = new ContactRelationship(); + clone.ElementID = mvarElementID; + clone.FormattedName = (mvarFormattedName.Clone() as string); + clone.IsEmpty = mvarIsEmpty; + foreach (ContactLabel item in mvarLabels) + { + clone.Labels.Add(item.Clone() as ContactLabel); + } + clone.ModificationDate = mvarModificationDate; + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactUrl.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactUrl.cs new file mode 100644 index 00000000..06c05266 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/ContactUrl.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public class ContactUrl : ICloneable, IContactLabelContainer, IContactComplexType + { + public class ContactUrlCollection + : System.Collections.ObjectModel.Collection + { + + } + + #region IContactComplexType members + private bool mvarIsEmpty = false; + public bool IsEmpty { get { return mvarIsEmpty; } set { mvarIsEmpty = value; } } + + private Guid mvarElementID = Guid.Empty; + public Guid ElementID { get { return mvarElementID; } set { mvarElementID = value; } } + + private DateTime? mvarModificationDate = null; + public DateTime? ModificationDate { get { return mvarModificationDate; } set { mvarModificationDate = value; } } + #endregion + + private string mvarValue = null; + public string Value { get { return mvarValue; } set { mvarValue = value; } } + + private ContactLabel.ContactLabelCollection mvarLabels = new ContactLabel.ContactLabelCollection(); + public ContactLabel.ContactLabelCollection Labels { get { return mvarLabels; } } + + public object Clone() + { + ContactUrl clone = new ContactUrl(); + clone.ElementID = mvarElementID; + clone.IsEmpty = mvarIsEmpty; + foreach (ContactLabel item in mvarLabels) + { + clone.Labels.Add(item.Clone() as ContactLabel); + } + clone.ModificationDate = mvarModificationDate; + clone.Value = (mvarValue.Clone() as string); + return clone; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/IContactComplexType.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/IContactComplexType.cs new file mode 100644 index 00000000..a50ef55d --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/IContactComplexType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public interface IContactComplexType + { + bool IsEmpty { get; set; } + Guid ElementID { get; set; } + DateTime? ModificationDate { get; set; } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/IContactLabelContainer.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/IContactLabelContainer.cs new file mode 100644 index 00000000..30f7e41a --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/ObjectModels/Contact/IContactLabelContainer.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Contact +{ + public interface IContactLabelContainer + { + ContactLabel.ContactLabelCollection Labels { get; } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/Properties/AssemblyInfo.cs b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..e88c625f --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Address Book plugin for Universal Editor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Mike Becker's Software")] +[assembly: AssemblyProduct("Universal Editor Plugin Pack")] +[assembly: AssemblyCopyright("Copyright ©2015 Mike Becker's Software")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c1dccb77-e59a-4d96-91d6-dbf1793c4554")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/UniversalEditor.Plugins.AddressBook.csproj b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/UniversalEditor.Plugins.AddressBook.csproj new file mode 100644 index 00000000..570ab38c --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.AddressBook/UniversalEditor.Plugins.AddressBook.csproj @@ -0,0 +1,77 @@ + + + + + Debug + AnyCPU + {AC2E7D52-E3C0-4C5A-A13E-B77F6D41C46E} + Library + Properties + UniversalEditor + UniversalEditor.Plugins.AddressBook + v3.5 + 512 + + + true + full + false + ..\..\Output\Debug\Plugins\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Output\Release\Plugins\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {2d4737e6-6d95-408a-90db-8dff38147e85} + UniversalEditor.Core + + + {30467e5c-05bc-4856-aadc-13906ef4cadd} + UniversalEditor.Essential + + + + + \ No newline at end of file diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Web/UniversalEditor.Plugins.Web.csproj b/CSharp/Plugins/UniversalEditor.Plugins.Web/UniversalEditor.Plugins.Web.csproj index 42b0fe9c..ef38d6e8 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Web/UniversalEditor.Plugins.Web.csproj +++ b/CSharp/Plugins/UniversalEditor.Plugins.Web/UniversalEditor.Plugins.Web.csproj @@ -36,14 +36,12 @@ - - diff --git a/CSharp/UniversalEditor.sln b/CSharp/UniversalEditor.sln index 0914c3a8..0fc6774c 100644 --- a/CSharp/UniversalEditor.sln +++ b/CSharp/UniversalEditor.sln @@ -159,6 +159,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Engines.GTK EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Plugins.KnowledgeAdventure.UserInterface.WindowsForms", "Engines\WindowsForms\Plugins\UniversalEditor.Plugins.KnowledgeAdventure.UserInterface.WindowsForms\UniversalEditor.Plugins.KnowledgeAdventure.UserInterface.WindowsForms.csproj", "{2006E5F0-E3C2-4F3C-9F55-2171B9334FA4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Plugins.AddressBook", "Plugins\UniversalEditor.Plugins.AddressBook\UniversalEditor.Plugins.AddressBook.csproj", "{AC2E7D52-E3C0-4C5A-A13E-B77F6D41C46E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -434,6 +436,10 @@ Global {2006E5F0-E3C2-4F3C-9F55-2171B9334FA4}.Debug|Any CPU.Build.0 = Debug|Any CPU {2006E5F0-E3C2-4F3C-9F55-2171B9334FA4}.Release|Any CPU.ActiveCfg = Release|Any CPU {2006E5F0-E3C2-4F3C-9F55-2171B9334FA4}.Release|Any CPU.Build.0 = Release|Any CPU + {AC2E7D52-E3C0-4C5A-A13E-B77F6D41C46E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC2E7D52-E3C0-4C5A-A13E-B77F6D41C46E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC2E7D52-E3C0-4C5A-A13E-B77F6D41C46E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC2E7D52-E3C0-4C5A-A13E-B77F6D41C46E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -483,6 +489,7 @@ Global {05127997-B7F3-4802-8021-06C048C8FE63} = {71CFF024-26F7-4626-A526-B435FDF8D64E} {21D14362-103A-4B38-8FB8-EEA6C7C89E09} = {71CFF024-26F7-4626-A526-B435FDF8D64E} {991F734F-D659-4252-8D2D-E6F828474861} = {71CFF024-26F7-4626-A526-B435FDF8D64E} + {AC2E7D52-E3C0-4C5A-A13E-B77F6D41C46E} = {71CFF024-26F7-4626-A526-B435FDF8D64E} {FE016EA3-DC31-4A92-8B0A-8C746EC117E1} = {46041F27-7C1C-4209-B72B-251EDB5D4C61} {ED627DF7-3E78-4428-AB31-810BA1586E62} = {46041F27-7C1C-4209-B72B-251EDB5D4C61} {C1F34183-7A2F-41A6-9958-F6F329099654} = {A846CA33-9CAA-4237-B14F-8721DBA89442}