Throttle information about a group (i.e. posting limit)
상속: IFlickrParsable
예제 #1
0
		internal GroupFullInfo(XmlNode node)
		{
			if( node.Attributes.GetNamedItem("id") != null )
				GroupId = node.Attributes.GetNamedItem("id").Value;
			if( node.SelectSingleNode("name") != null )
				GroupName = node.SelectSingleNode("name").InnerText;
			if( node.SelectSingleNode("description") != null )
				Description = node.SelectSingleNode("description").InnerXml;
			if( node.SelectSingleNode("members") != null )
				Members = int.Parse(node.SelectSingleNode("members").InnerText);
			if( node.SelectSingleNode("privacy") != null )
				Privacy = (PoolPrivacy)int.Parse(node.SelectSingleNode("privacy").InnerText);

			if( node.SelectSingleNode("throttle") != null )
			{
				XmlNode throttle = node.SelectSingleNode("throttle");
				ThrottleInfo = new GroupThrottleInfo();
				if( throttle.Attributes.GetNamedItem("count") != null )
					ThrottleInfo.Count = int.Parse(throttle.Attributes.GetNamedItem("count").Value);
				if( throttle.Attributes.GetNamedItem("mode") != null )
					ThrottleInfo.setMode(throttle.Attributes.GetNamedItem("mode").Value);
				if( throttle.Attributes.GetNamedItem("remaining") != null )
					ThrottleInfo.Remaining = int.Parse(throttle.Attributes.GetNamedItem("remaining").Value);
			}
		}
예제 #2
0
        internal GroupFullInfo(XmlNode node)
        {
            if (node.Attributes.GetNamedItem("id") != null)
            {
                GroupId = node.Attributes.GetNamedItem("id").Value;
            }
            if (node.SelectSingleNode("name") != null)
            {
                GroupName = node.SelectSingleNode("name").InnerText;
            }
            if (node.SelectSingleNode("description") != null)
            {
                Description = node.SelectSingleNode("description").InnerXml;
            }
            if (node.SelectSingleNode("members") != null)
            {
                Members = int.Parse(node.SelectSingleNode("members").InnerText);
            }
            if (node.SelectSingleNode("privacy") != null)
            {
                Privacy = (PoolPrivacy)int.Parse(node.SelectSingleNode("privacy").InnerText);
            }

            if (node.SelectSingleNode("throttle") != null)
            {
                XmlNode throttle = node.SelectSingleNode("throttle");
                ThrottleInfo = new GroupThrottleInfo();
                if (throttle.Attributes.GetNamedItem("count") != null)
                {
                    ThrottleInfo.Count = int.Parse(throttle.Attributes.GetNamedItem("count").Value);
                }
                if (throttle.Attributes.GetNamedItem("mode") != null)
                {
                    ThrottleInfo.setMode(throttle.Attributes.GetNamedItem("mode").Value);
                }
                if (throttle.Attributes.GetNamedItem("remaining") != null)
                {
                    ThrottleInfo.Remaining = int.Parse(throttle.Attributes.GetNamedItem("remaining").Value);
                }
            }
        }
예제 #3
0
        void IFlickrParsable.Load(XmlReader reader)
        {
            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "nsid":
                    case "id":
                        GroupId = reader.Value;
                        break;
                    case "iconserver":
                        IconServer = reader.Value;
                        break;
                    case "iconfarm":
                        IconFarm = reader.Value;
                        break;
                    case "lang":
                        Language = reader.Value;
                        break;
                    case "ispoolmoderated":
                        IsPoolModerated = reader.Value == "1";
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        break;
                }
            }

            reader.Read();

            while (reader.LocalName != "group")
            {
                switch (reader.LocalName)
                {
                    case "name":
                        GroupName = reader.ReadElementContentAsString();
                        break;
                    case "description":
                        Description = reader.ReadElementContentAsString();
                        break;
                    case "members":
                        Members = reader.ReadElementContentAsInt();
                        break;
                    case "privacy":
                        Privacy = (PoolPrivacy)reader.ReadElementContentAsInt();
                        break;
                    case "blast":
                        BlastDateAdded = UtilityMethods.UnixTimestampToDate(reader.GetAttribute("date_blast_added"));
                        BlastUserId = reader.GetAttribute("user_id");
                        BlastHtml = reader.ReadElementContentAsString();
                        break;
                    case "throttle":
                        ThrottleInfo = new GroupThrottleInfo();
                        ((IFlickrParsable)ThrottleInfo).Load(reader);
                        break;
                    case "restrictions":
                        Restrictions = new GroupInfoRestrictions();
                        ((IFlickrParsable)Restrictions).Load(reader);
                        break;
                    case "roles":
                        MemberRoleName = reader.GetAttribute("member");
                        ModeratorRoleName = reader.GetAttribute("moderator");
                        AdminRoleName = reader.GetAttribute("admin");
                        reader.Read();
                        break;
                    case "rules":
                        Rules = reader.ReadElementContentAsString();
                        break;
                    case "pool_count":
                        PoolCount = reader.ReadElementContentAsInt();
                        break;
                    case "topic_count":
                        TopicCount = reader.ReadElementContentAsInt();
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        reader.Skip();
                        break;

                }
            }

            reader.Read();
        }
예제 #4
0
        void IFlickrParsable.Load(XmlReader reader)
        {
            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                case "nsid":
                case "id":
                    GroupId = reader.Value;
                    break;

                case "iconserver":
                    IconServer = reader.Value;
                    break;

                case "iconfarm":
                    IconFarm = reader.Value;
                    break;

                case "lang":
                    Language = reader.Value;
                    break;

                case "ispoolmoderated":
                    IsPoolModerated = reader.Value == "1";
                    break;

                default:
                    UtilityMethods.CheckParsingException(reader);
                    break;
                }
            }

            reader.Read();

            while (reader.LocalName != "group")
            {
                switch (reader.LocalName)
                {
                case "name":
                    GroupName = reader.ReadElementContentAsString();
                    break;

                case "description":
                    Description = reader.ReadElementContentAsString();
                    break;

                case "members":
                    Members = reader.ReadElementContentAsInt();
                    break;

                case "privacy":
                    Privacy = (PoolPrivacy)reader.ReadElementContentAsInt();
                    break;

                case "blast":
                    BlastDateAdded = UtilityMethods.UnixTimestampToDate(reader.GetAttribute("date_blast_added"));
                    BlastUserId    = reader.GetAttribute("user_id");
                    BlastHtml      = reader.ReadElementContentAsString();
                    break;

                case "throttle":
                    ThrottleInfo = new GroupThrottleInfo();
                    ((IFlickrParsable)ThrottleInfo).Load(reader);
                    break;

                case "restrictions":
                    Restrictions = new GroupInfoRestrictions();
                    ((IFlickrParsable)Restrictions).Load(reader);
                    break;

                default:
                    UtilityMethods.CheckParsingException(reader);
                    reader.Skip();
                    break;
                }
            }

            reader.Read();
        }