Moved AddressBook from Web to separate plugin and began to implement Microsoft Contact format (incomplete)
This commit is contained in:
parent
33954864c5
commit
c09c7a5199
@ -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<ObjectModel> objectModels)
|
||||
{
|
||||
base.BeforeLoadInternal(objectModels);
|
||||
objectModels.Push(new MarkupObjectModel());
|
||||
}
|
||||
protected override void AfterLoadInternal(Stack<ObjectModel> 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<string>(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<string>(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<string>(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<string>(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<string>(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<string>(tagOffice.Value);
|
||||
|
||||
MarkupTagElement tagDepartment = (tag.Elements["c:Department"] as MarkupTagElement);
|
||||
if (tagDepartment != null) item.Department = new ContactGenericField<string>(tagDepartment.Value);
|
||||
|
||||
MarkupTagElement tagJobTitle = (tag.Elements["c:JobTitle"] as MarkupTagElement);
|
||||
if (tagJobTitle != null) item.JobTitle = new ContactGenericField<string>(tagJobTitle.Value);
|
||||
|
||||
MarkupTagElement tagCompany = (tag.Elements["c:Company"] as MarkupTagElement);
|
||||
if (tagCompany != null) item.JobTitle = new ContactGenericField<string>(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<ObjectModel> objectModels)
|
||||
{
|
||||
base.BeforeSaveInternal(objectModels);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactDate>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactEmailAddress>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace UniversalEditor.ObjectModels.Contact
|
||||
{
|
||||
public struct ContactGenericField<T>
|
||||
{
|
||||
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<T> Empty = new ContactGenericField<T>(default(T));
|
||||
|
||||
public ContactGenericField(T value, DateTime? modificationDate = null)
|
||||
{
|
||||
mvarValue = value;
|
||||
if (modificationDate != null)
|
||||
{
|
||||
mvarModificationDate = modificationDate.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
mvarModificationDate = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactIdentifier>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactLabel>
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactName>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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; } }
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactPhoneNumber>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactPhoto>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactPhysicalAddress>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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<string> mvarCountry = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> Country { get { return mvarCountry; } set { mvarCountry = value; } }
|
||||
|
||||
private ContactGenericField<string> mvarPostalCode = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> PostalCode { get { return mvarPostalCode; } set { mvarPostalCode = value; } }
|
||||
|
||||
private ContactGenericField<string> mvarRegion = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> Region { get { return mvarRegion; } set { mvarRegion = value; } }
|
||||
|
||||
private ContactGenericField<string> mvarLocality = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> Locality { get { return mvarLocality; } set { mvarLocality = value; } }
|
||||
|
||||
private ContactGenericField<string> mvarStreetAddress = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactPosition>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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<string> mvarOffice = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> Office { get { return mvarOffice; } set { mvarOffice = value; } }
|
||||
|
||||
private ContactGenericField<string> mvarDepartment = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> Department { get { return mvarDepartment; } set { mvarDepartment = value; } }
|
||||
|
||||
private ContactGenericField<string> mvarJobTitle = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> JobTitle { get { return mvarJobTitle; } set { mvarJobTitle = value; } }
|
||||
|
||||
private ContactGenericField<string> mvarCompany = ContactGenericField<string>.Empty;
|
||||
public ContactGenericField<string> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactRelationship>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ContactUrl>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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; }
|
||||
}
|
||||
}
|
||||
@ -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; }
|
||||
}
|
||||
}
|
||||
@ -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")]
|
||||
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{AC2E7D52-E3C0-4C5A-A13E-B77F6D41C46E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>UniversalEditor</RootNamespace>
|
||||
<AssemblyName>UniversalEditor.Plugins.AddressBook</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Output\Debug\Plugins\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Output\Release\Plugins\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DataFormats\AddressBook\WABDataFormat.cs" />
|
||||
<Compile Include="DataFormats\Contact\Microsoft\ContactDataFormat.cs" />
|
||||
<Compile Include="ObjectModels\AddressBook\AddressBookObjectModel.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactEmailAddress.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactGender.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactIdentifier.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactLabel.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactName.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactNotes.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactObjectModel.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactPhoneNumber.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactPhoto.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactPhysicalAddress.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactGenericField.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactPosition.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactRelationship.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactDate.cs" />
|
||||
<Compile Include="ObjectModels\Contact\ContactUrl.cs" />
|
||||
<Compile Include="ObjectModels\Contact\IContactComplexType.cs" />
|
||||
<Compile Include="ObjectModels\Contact\IContactLabelContainer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Libraries\UniversalEditor.Core\UniversalEditor.Core.csproj">
|
||||
<Project>{2d4737e6-6d95-408a-90db-8dff38147e85}</Project>
|
||||
<Name>UniversalEditor.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\UniversalEditor.Essential\UniversalEditor.Essential.csproj">
|
||||
<Project>{30467e5c-05bc-4856-aadc-13906ef4cadd}</Project>
|
||||
<Name>UniversalEditor.Essential</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@ -36,14 +36,12 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Accessors\HTTPAccessor.cs" />
|
||||
<Compile Include="DataFormats\AddressBook\WABDataFormat.cs" />
|
||||
<Compile Include="DataFormats\Text\HTML\HTMLDataFormat.cs" />
|
||||
<Compile Include="DataFormats\Text\MHTML\MHTMLDataFormat.cs" />
|
||||
<Compile Include="DataFormats\Web\StyleSheet\CSSDataFormat.cs" />
|
||||
<Compile Include="DataFormats\Text\MHTML\MHTMLHeader.cs" />
|
||||
<Compile Include="DataFormats\Web\WebService\Description\WSDL\WSDLDataFormat.cs" />
|
||||
<Compile Include="NumericStringSplitter.cs" />
|
||||
<Compile Include="ObjectModels\AddressBook\AddressBookObjectModel.cs" />
|
||||
<Compile Include="ObjectModels\Web\Measurement.cs" />
|
||||
<Compile Include="ObjectModels\Web\MeasurementExtensionMethods.cs" />
|
||||
<Compile Include="ObjectModels\Web\MeasurementUnit.cs" />
|
||||
|
||||
@ -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}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user