예제 #1
0
        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);
        }
예제 #2
0
        /// <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);
            }
        }
예제 #3
0
		/*
		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;
        }
예제 #4
0
        /*
         * 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);
        }
예제 #5
0
 public void SetContactCard(ContactCardCategory contactCard)
 {
     this.Process(
         new Category()
     {
         Instance    = 0,
         ExpireType  = CategoryExpireType.Static,
         ContactCard = contactCard
     }
         , null
         );
 }
예제 #6
0
        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);
        }
예제 #7
0
        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;
        }
예제 #8
0
		/// <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);
			}
		}
예제 #9
0
		public void SetContactCard(ContactCardCategory contactCard)
		{
			this.Process(
				new Category()
				{
					Instance = 0,
					ExpireType = CategoryExpireType.Static,
					ContactCard = contactCard
				}
				, null
			);
		}