public static ContactCardCategory Parse(XmlReader reader) { ContactCardCategory card = new ContactCardCategory(); while (reader.Read()) { if (reader.Name == @"displayName") { while (reader.Read() && reader.NodeType != XmlNodeType.Text) { ; } card.DisplayName = reader.ReadContentAsString(); } if (reader.Name == @"email") { while (reader.Read() && reader.NodeType != XmlNodeType.Text) { ; } card.Email = reader.ReadContentAsString(); } if (reader.Name == @"contactCard" && reader.NodeType == XmlNodeType.EndElement) { break; } } return(card); }
/// <summary> /// SetContactCard /// </summary> /// <param name="uri"></param> /// <param name="contactCard">new ContactCardCategory() { DisplayName = displayName, Email = email }</param> public void SetContactCard(string uri, ContactCardCategory contactCard) { lock (sync) { Publication publication = ResolvePublication(uri); publication.SetContactCard(contactCard); } }
/* public List<string> Emails { get; set; } public StateCategory() { this.Availability = 0; } public string Email1 { set { SetEmail(0, value); } } public string Email1 { set { SetEmail(0, value); } } private void SetEmail(int index, string email) { if (Emails == null) Emails = new List<string>(); while (Emails.Count < index) Emails.Add(@""); Emails[index] = email; } */ public static ContactCardCategory Create(string displayName, string email) { ContactCardCategory card = new ContactCardCategory(); card.DisplayName = displayName; card.Email = email; return card; }
/* * public List<string> Emails { get; set; } * * public StateCategory() * { * this.Availability = 0; * } * * public string Email1 * { * set * { * SetEmail(0, value); * } * } * * public string Email1 * { * set * { * SetEmail(0, value); * } * } * * private void SetEmail(int index, string email) * { * if (Emails == null) * Emails = new List<string>(); * while (Emails.Count < index) * Emails.Add(@""); * Emails[index] = email; * } */ public static ContactCardCategory Create(string displayName, string email) { ContactCardCategory card = new ContactCardCategory(); card.DisplayName = displayName; card.Email = email; return(card); }
public void SetContactCard(ContactCardCategory contactCard) { this.Process( new Category() { Instance = 0, ExpireType = CategoryExpireType.Static, ContactCard = contactCard } , null ); }
public static Category Parse(XmlReader reader) { string xmlElement = reader.Name; Category category = new Category(); if (xmlElement == "category") { category.Name = reader.GetAttribute("name"); } else if (xmlElement == "publication") { category.Name = reader.GetAttribute("categoryName"); } category.InstanceString = reader.GetAttribute("instance"); category.ContainerString = reader.GetAttribute("container"); category.PublishTimeString = reader.GetAttribute("publishTime"); category.VersionString = reader.GetAttribute("version"); category.ExpireTypeString = reader.GetAttribute("expireType"); category.EndpointId = reader.GetAttribute("endpointId"); category.ExpiresString = reader.GetAttribute("expires"); if (category.IsContactCardCategory()) { category.ContactCard = ContactCardCategory.Parse(reader); } else if (category.IsStateCategory()) { category.State = StateCategory.Parse(reader); } while (reader.Name != xmlElement && reader.NodeType == XmlNodeType.EndElement) { reader.Read(); } return(category); }
public static ContactCardCategory Parse(XmlReader reader) { ContactCardCategory card = new ContactCardCategory(); while (reader.Read()) { if (reader.Name == @"displayName") { while (reader.Read() && reader.NodeType != XmlNodeType.Text) ; card.DisplayName = reader.ReadContentAsString(); } if (reader.Name == @"email") { while (reader.Read() && reader.NodeType != XmlNodeType.Text) ; card.Email = reader.ReadContentAsString(); } if (reader.Name == @"contactCard" && reader.NodeType == XmlNodeType.EndElement) break; } return card; }
/// <summary> /// SetContactCard /// </summary> /// <param name="uri"></param> /// <param name="contactCard">new ContactCardCategory() { DisplayName = displayName, Email = email }</param> public void SetContactCard(string uri, ContactCardCategory contactCard) { lock (sync) { Publication publication = ResolvePublication(uri); publication.SetContactCard(contactCard); } }
public void SetContactCard(ContactCardCategory contactCard) { this.Process( new Category() { Instance = 0, ExpireType = CategoryExpireType.Static, ContactCard = contactCard } , null ); }