当前位置: 首页>>代码示例>>C#>>正文


C# XmlReader.ReadContentAsInt方法代码示例

本文整理汇总了C#中System.Xml.XmlReader.ReadContentAsInt方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.ReadContentAsInt方法的具体用法?C# XmlReader.ReadContentAsInt怎么用?C# XmlReader.ReadContentAsInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlReader的用法示例。


在下文中一共展示了XmlReader.ReadContentAsInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: while

 void IFlickrParsable.Load(XmlReader reader)
 {
     while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "label":
     this.Label = reader.Value;
     continue;
       case "width":
     this.Width = reader.ReadContentAsInt();
     continue;
       case "height":
     this.Height = reader.ReadContentAsInt();
     continue;
       case "source":
     this.Source = reader.Value;
     continue;
       case "url":
     this.Url = reader.Value;
     continue;
       case "media":
     this.MediaType = reader.Value == "photo" ? MediaType.Photos : MediaType.Videos;
     continue;
       default:
     continue;
     }
       }
       reader.Read();
 }
开发者ID:rmck,项目名称:FlickrNet,代码行数:30,代码来源:Size.cs

示例2: while

 void IFlickrParsable.Load(XmlReader reader)
 {
     while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "ready":
     this.Ready = reader.Value == "1";
     continue;
       case "failed":
     this.Failed = reader.Value == "1";
     continue;
       case "pending":
     this.Pending = reader.Value == "1";
     continue;
       case "duration":
     this.Duration = !string.IsNullOrEmpty(reader.Value) ? reader.ReadContentAsInt() : -1;
     continue;
       case "width":
     this.Width = !string.IsNullOrEmpty(reader.Value) ? reader.ReadContentAsInt() : -1;
     continue;
       case "height":
     this.Height = !string.IsNullOrEmpty(reader.Value) ? reader.ReadContentAsInt() : -1;
     continue;
       default:
     continue;
     }
       }
       reader.Read();
 }
开发者ID:rmck,项目名称:FlickrNet,代码行数:30,代码来源:VideoInfo.cs

示例3: while

 void IFlickrParsable.Load(XmlReader reader)
 {
     if (!(reader.LocalName != "subscription"))
     ;
       while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "topic":
     this.Topic = reader.Value;
     continue;
       case "callback":
     this.Callback = reader.Value;
     continue;
       case "pending":
     this.IsPending = reader.Value == "1";
     continue;
       case "date_create":
     this.DateCreated = UtilityMethods.UnixTimestampToDate(reader.Value);
     continue;
       case "lease_seconds":
     this.LeaseSeconds = reader.ReadContentAsInt();
     continue;
       case "expiry":
     this.Expiry = UtilityMethods.UnixTimestampToDate(reader.Value);
     continue;
       case "verify_attempts":
     this.VerifyAttempts = reader.ReadContentAsInt();
     continue;
       default:
     continue;
     }
       }
       reader.Read();
 }
开发者ID:rmck,项目名称:FlickrNet,代码行数:35,代码来源:Subscription.cs

示例4: while

 void IFlickrParsable.Load(XmlReader reader)
 {
     while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "usage":
     this.Usage = reader.ReadContentAsInt();
     continue;
       case "predicate":
     this.PredicateName = reader.Value;
     continue;
       case "namespace":
     this.NamespaceName = reader.Value;
     continue;
       case "first_added":
     this.DateFirstAdded = new DateTime?(UtilityMethods.UnixTimestampToDate(reader.Value));
     continue;
       case "last_added":
     this.DateLastUsed = new DateTime?(UtilityMethods.UnixTimestampToDate(reader.Value));
     continue;
       default:
     continue;
     }
       }
       reader.Read();
       if (reader.NodeType == XmlNodeType.Text)
     this.ValueText = reader.ReadContentAsString();
       reader.Read();
 }
开发者ID:rmck,项目名称:FlickrNet,代码行数:30,代码来源:Value.cs

示例5: while

        void IFlickrParsable.Load(XmlReader reader)
        {
            if (reader.LocalName != "place_type")
                UtilityMethods.CheckParsingException(reader);

            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "place_type_id":
                    case "id":
                        Id = reader.ReadContentAsInt();
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        break;
                }
            }

            reader.Read();

            Name = reader.ReadContentAsString();

            reader.Skip();
        }
开发者ID:JamieKitson,项目名称:flickrnet-experimental,代码行数:25,代码来源:PlaceTypeInfo.cs

示例6: readInt

 public static int readInt(XmlReader reader, string nodeName)
 {
     reader.ReadStartElement(nodeName);
     int i = reader.ReadContentAsInt();
     reader.ReadEndElement();
     return i;
 }
开发者ID:wico-,项目名称:Code,代码行数:7,代码来源:Level.cs

示例7: while

 void IFlickrParsable.Load(XmlReader reader)
 {
     while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "id":
     this.LicenseId = (LicenseType) reader.ReadContentAsInt();
     continue;
       case "name":
     this.LicenseName = reader.Value;
     continue;
       case "url":
     if (!string.IsNullOrEmpty(reader.Value))
     {
       this.LicenseUrl = reader.Value;
       continue;
     }
     else
       continue;
       default:
     continue;
     }
       }
       reader.Read();
 }
开发者ID:rmck,项目名称:FlickrNet,代码行数:26,代码来源:License.cs

示例8: while

        void IFlickrParsable.Load(XmlReader reader)
        {
            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "usage":
                        Usage = reader.ReadContentAsInt();
                        break;
                    case "predicate":
                        PredicateName = reader.Value;
                        break;
                    case "namespace":
                        NamespaceName = reader.Value;
                        break;
                    case "first_added":
                        DateFirstAdded = UtilityMethods.UnixTimestampToDate(reader.Value);
                        break;
                    case "last_added":
                        DateLastUsed = UtilityMethods.UnixTimestampToDate(reader.Value);
                        break;
                }
            }

            reader.Read();

            if (reader.NodeType == XmlNodeType.Text)
                ValueText = reader.ReadContentAsString();

            reader.Read();
        }
开发者ID:JamieKitson,项目名称:flickrnet-experimental,代码行数:31,代码来源:Value.cs

示例9: while

        void IFlickrParsable.Load(XmlReader reader)
        {
            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "usage":
                        Usage = reader.ReadContentAsInt();
                        break;
                    case "predicate":
                        PredicateName = reader.Value;
                        break;
                    case "namespace":
                        NamespaceName = reader.Value;
                        break;
                }
            }

            reader.Read();

            if (reader.NodeType == XmlNodeType.Text)
                PairName = reader.ReadContentAsString();

            reader.Read();
        }
开发者ID:JamieKitson,项目名称:flickrnet-experimental,代码行数:25,代码来源:Pair.cs

示例10: DeserializeSpecVersion

 //public static string HostAddress
 //{
 //    get
 //    {
 //        foreach (IPAddress address in Dns.GetHostAddresses (Dns.GetHostName ())) {
 //            if (address.AddressFamily == AddressFamily.InterNetwork) {
 //                return address;
 //            }
 //        }
 //    }
 //}
 public static Version DeserializeSpecVersion(XmlReader reader)
 {
     try {
         // We assume the elements appear in this order
         reader.ReadToFollowing ("major");
         reader.Read ();
         var major = reader.ReadContentAsInt ();
         reader.ReadToFollowing ("minor");
         reader.Read ();
         var minor = reader.ReadContentAsInt ();
         return new Version (major, minor);
     } catch (Exception e) {
         throw new UpnpDeserializationException ("There was a problem deserializing a spec version.", e);
     } finally {
         reader.Close ();
     }
 }
开发者ID:MustafaUzumcuCom,项目名称:mono-upnp,代码行数:28,代码来源:Helper.cs

示例11: FromXml

 public void FromXml(XmlReader reader)
 {
     while (reader.MoveToNextAttribute())
     {
         if (reader.Name == "Width")
             Width = reader.ReadContentAsInt();
         else if (reader.Name == "Height")
             Height = reader.ReadContentAsInt();
         else if (reader.Name == "Name")
             Name = reader.ReadContentAsString();
         else if (reader.Name == "PositionNaming")
         {
             var index = reader.ReadContentAsInt();
             if (index < PositionNamings.Defined.Length) PositionNaming = PositionNamings.Defined[index];
         }
     }
     reader.MoveToElement();
 }
开发者ID:m1ch4ls,项目名称:microplate,代码行数:18,代码来源:Format.cs

示例12: ResponseXmlException

        void IFlickrParsable.Load(XmlReader reader)
        {
            if (reader == null) throw new ArgumentNullException("reader");

            if (!reader.ReadToFollowing("photos"))
                throw new ResponseXmlException("Unable to find \"photos\" element in response.");

            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "maxdisplaypx":
                        MaximumDisplayPixels = reader.ReadContentAsInt();
                        break;
                    case "maxupload":
                        MaximumPhotoUpload = reader.ReadContentAsLong();
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        break;
                }
            }

            if (!reader.ReadToFollowing("videos"))
                throw new ResponseXmlException("Unable to find \"videos\" element in response.");

            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "maxduration":
                        MaximumVideoDuration = reader.ReadContentAsInt();
                        break;
                    case "maxupload":
                        MaximumVideoUpload = reader.ReadContentAsLong();
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        break;
                }
            }

            reader.Skip();
        }
开发者ID:JamieKitson,项目名称:flickrnet-experimental,代码行数:44,代码来源:PersonLimits.cs

示例13: while

 void IFlickrParsable.Load(XmlReader reader)
 {
     while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "count":
     this.Count = reader.ReadContentAsInt();
     continue;
       case "mode":
     this.Mode = GroupThrottleInfo.ParseMode(reader.Value);
     continue;
       case "remaining":
     this.Remaining = reader.ReadContentAsInt();
     continue;
       default:
     continue;
     }
       }
       reader.Read();
 }
开发者ID:rmck,项目名称:FlickrNet,代码行数:21,代码来源:GroupThrottleInfo.cs

示例14: while

 void IFlickrParsable.Load(XmlReader reader)
 {
     while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "usage":
     this.Usage = reader.ReadContentAsInt();
     continue;
       case "predicates":
     this.Predicates = reader.ReadContentAsInt();
     continue;
       default:
     continue;
     }
       }
       reader.Read();
       if (reader.NodeType == XmlNodeType.Text)
     this.NamespaceName = reader.ReadContentAsString();
       reader.Read();
 }
开发者ID:rmck,项目名称:FlickrNet,代码行数:21,代码来源:Namespace.cs

示例15: load

 public static Firewall load(XmlReader reader)
 {
     while (reader.Name != "firewall")
         reader.Read();
     var complexity = 0;
     string solution = null;
     var additionalTime = 0.0f;
     if (reader.MoveToAttribute("complexity"))
         complexity = reader.ReadContentAsInt();
     if (reader.MoveToAttribute("solution"))
         solution = reader.ReadContentAsString();
     if (reader.MoveToAttribute("additionalDelay"))
         additionalTime = reader.ReadContentAsFloat();
     return new Firewall(complexity, solution, additionalTime);
 }
开发者ID:strangea,项目名称:OpenHacknet,代码行数:15,代码来源:Firewall.cs


注:本文中的System.Xml.XmlReader.ReadContentAsInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。