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


C# XmlRpcStruct.ContainsKey方法代码示例

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


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

示例1: toBool

 /// <summary>
 /// robust convert a data bit to a bool 
 /// </summary>
 /// <param name="data"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 internal bool? toBool(XmlRpcStruct data, string name)
 {
     if (data.ContainsKey(name))
     {
         object val = data[name];
         if (val is string)
         {
             bool result;
             bool good = bool.TryParse(val as string, out result);
             return result;
         }
         return data[name] as bool?;
     }
     return null;
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:21,代码来源:TL_Data.cs

示例2: toInt

 /// <summary>
 /// robust convert to int. can take int strings as well as ints 
 /// </summary>
 /// <param name="data"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 internal int toInt(XmlRpcStruct data, string name)
 {
     if (data.ContainsKey(name))
     {
         int n;
         object val = data[name];
         if (val is string)
         {
             bool good = int.TryParse((string)val, out n);
             if (good)
                 return n;
         }
         else if (val is int)
             return (int)(val);
     }
     return 0;
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:23,代码来源:TL_Data.cs

示例3: decodeSingleError

 private TLErrorMessage decodeSingleError(XmlRpcStruct message)
 {
     if (message.ContainsKey("code") && message.ContainsKey("message"))
         return new TLErrorMessage(message);
     else
         return null;
 }
开发者ID:krukovskiy,项目名称:STUPS,代码行数:7,代码来源:TestLink.cs

示例4: Metadata

 public Metadata(XmlRpcStruct md)
 {
     if (md.ContainsKey("Artist"))
         Artist = (string)md["Artist"];
     if (md.ContainsKey("Album"))
         Album = (string)md["Album"];
     if (md.ContainsKey("Title"))
         Track = (string)md["Title"];
     if (md.ContainsKey("Uri"))
         Uri = (string)md["Uri"];
     if (md.ContainsKey("AlbumArtUri"))
         AlbumArtUri = (string)md["AlbumArtUri"];
     if (md.ContainsKey("PlayTime"))
         PlayTime = (int)md["PlayTime"];
 }
开发者ID:joaoAvno,项目名称:Sonar,代码行数:15,代码来源:SonosClient.cs

示例5: Event

 public Event(XmlRpcStruct x)
 {
     if (x.ContainsKey("Name"))
         Name = (string)x["Name"];
     Args = new List<object>();
     if (x.ContainsKey("Args"))
     {
         object o = x["Args"];
         object[] array = (object[])o;
         Args.AddRange(array);
     }
 }
开发者ID:joaoAvno,项目名称:Sonar,代码行数:12,代码来源:SonosClient.cs

示例6: toExecStatus

 /// <summary>
 /// parse an execution status 
 /// </summary>
 /// <param name="data"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 internal TestCaseResultStatus toExecStatus(XmlRpcStruct data, string name)
 {
     TestCaseResultStatus result = TestCaseResultStatus.undefined;
     if (data.ContainsKey(name))
     {
         char c = toChar(data, name);
         switch (c)
         {
             case 'f':
             case 'F': result = TestCaseResultStatus.Fail;
                 break;
             case 'b':
             case 'B': result = TestCaseResultStatus.Blocked;
                 break;
             case 'p':
             case 'P': result = TestCaseResultStatus.Pass;
                 break;
         }
     }
     return result;
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:27,代码来源:TL_Data.cs

示例7: GeneralResult

 internal GeneralResult(XmlRpcStruct data)
 {
     operation = (string)data["operation"];
     status = (bool)(data["status"]);
     id = toInt(data, "id");
     message = (string)data["message"];
     if ((data.ContainsKey("additionalInfo") &&
       (data["additionalInfo"] is XmlRpcStruct)))
         additionalInfo = new AdditionalInfo(data["additionalInfo"] as XmlRpcStruct);
     else
         additionalInfo = null;         
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:12,代码来源:TL_Data.cs

示例8: TestCaseFromTestSuite

 internal TestCaseFromTestSuite(XmlRpcStruct data)
 {
     active = int.Parse((string)data["active"]) == 1;
     id = toInt(data, "id");
     name = (string)data["name"];
     version = toInt(data, "version");
     tcversion_id = toInt(data, "tcversion_id");
     //steps = (string)data["steps"];
     //expected_results = (string)data["expected_results"];
     external_id = (string)data["tc_external_id"];
     testSuite_id = toInt(data, "parent_id");
     is_open = int.Parse((string)data["is_open"]) == 1;
     modification_ts = base.toDate(data, "modification_ts");
     updater_id = toInt(data, "updater_id");
     execution_type = toInt(data, "execution_type");
     summary = (string)data["summary"];
     if (data.ContainsKey("details"))
         details = (string)data["details"];
     else
         details = "";
     author_id = toInt(data, "author_id");
     creation_ts = base.toDate(data, "creation_ts");
     importance = toInt(data, "importance");
     parent_id = toInt(data, "parent_id");
     node_type_id = toInt(data, "node_type_id");
     node_order = toInt(data, "node_order");
     node_table = (string)data["node_table"];
     layout = (string)data["layout"];
     status = toInt(data, "status");
     preconditions = (string)data["preconditions"];
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:31,代码来源:TL_Data.cs

示例9: toChar

 /// <summary>
 /// convert a data value to a single char
 /// </summary>
 /// <param name="data"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 internal char toChar(XmlRpcStruct data, string name)
 {
     if (data.ContainsKey(name) && (data[name] is string))
     {
         string s = (string)(data[name]);
         return s[0];
     }
     return '\x00';
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:15,代码来源:TL_Data.cs

示例10: toDate

 /// <summary>
 ///  robust convert a date string
 /// </summary>
 /// <param name="data">key value dictionary</param>
 /// <param name="name">name of field to use</param>
 /// <returns></returns>
 internal DateTime toDate(XmlRpcStruct data, string name)
 {
     if (data.ContainsKey(name))
     {
         DateTime n;
         bool good = DateTime.TryParse((string)data[name], out n);
         if (good)
             return n;
     }
     return DateTime.MinValue;
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:17,代码来源:TL_Data.cs

示例11: TestPlanTotal

        internal TestPlanTotal(XmlRpcStruct data)
        {
            Total_tc = toInt(data, "total_tc");
            if (data.ContainsKey("type"))
                Type = (string)data["type"];    
            if (data.ContainsKey("name"))
                Name = (string)data["name"];
          
            XmlRpcStruct xdetails = data["details"] as XmlRpcStruct;

            foreach (string key in xdetails.Keys)
            {
                XmlRpcStruct val = xdetails[key] as XmlRpcStruct;
                int qty = toInt(val,"qty");
                Details.Add(key, qty);
            }
        }        
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:17,代码来源:TL_Data.cs

示例12: Output

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="output">The output from the server request.</param>
        protected Output( XmlRpcStruct output )
        {
            if ( output.ContainsKey( "status" ) )
                this.StatusString = ( string ) output[ "status" ];
            else
                this.StatusString = "200 OK";

            this.Status = ConvertStatusToStatusCode( StatusString );
            this.Seconds = ( double ) output[ "seconds" ];
        }
开发者ID:Wolf-Code,项目名称:Videre,代码行数:14,代码来源:Output.cs

示例13: AttemptStructDeserialization

 public static object AttemptStructDeserialization(XmlRpcStruct response, Type output)
 {
     MemberInfo[] outputMembers = output.GetMembers();
     object result = Activator.CreateInstance(output);
     PropertyInfo[] properties = output.GetProperties();
     foreach(PropertyInfo property in properties)
     {
         Console.WriteLine (property.Name);
         if(response.ContainsKey (property.Name))
         {
             Console.WriteLine("Declaring type:{0}, output type:{1}", property.PropertyType, response[property.Name].GetType());
             if(Type.Equals(property.PropertyType, response[property.Name].GetType()))
             {
                 Console.WriteLine ("Identical Type! Woot! Value is " + response[property.Name]);
                 property.SetValue(result, response[property.Name], null);
             }
         }
     }
     return result;
 }
开发者ID:skyronic,项目名称:splatter,代码行数:20,代码来源:BugService.cs

示例14: StructToPost

        private static Post StructToPost(Post p, XmlRpcStruct x, bool publish)
        {
            /*
             *    1. struct {
                   2.     string postid;
                   3.     DateTime dateCreated;
                   4.     string title;
                   5.     string description;
                   6.     string[] categories;
                   7.     bool publish;
                   8. }
             */
            if (p == null)
            {
                p = new Post();
                p.Id = x.ContainsKey("postid") ? Convert.ToInt32(x["postid"]) : 0;
            }

            p.Approved = publish;
            p.Body = x["description"].ToString();
            p.Title = x["title"].ToString();

            if (x.ContainsKey("categories"))
            {
                IEnumerable categories = x["categories"] as IEnumerable;

                if (categories != null)
                {
                    foreach(object category in categories)
                    {
                        if (category != null)
                        {
                            Tag tag = new Tag { TagName = category.ToString() };
                            p.AddTag(tag);
                        }
                    }
                }
            }

            return p;
        }
开发者ID:madaboutcode,项目名称:Chronicles,代码行数:41,代码来源:MetaWeblogAPI.cs


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