本文整理汇总了C#中CookComputing.XmlRpc.XmlRpcStruct.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# XmlRpcStruct.Contains方法的具体用法?C# XmlRpcStruct.Contains怎么用?C# XmlRpcStruct.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CookComputing.XmlRpc.XmlRpcStruct
的用法示例。
在下文中一共展示了XmlRpcStruct.Contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseHashtable
Object ParseHashtable(
XmlNode node,
Type valueType,
ParseStack parseStack,
MappingAction mappingAction)
{
XmlRpcStruct retObj = new XmlRpcStruct();
parseStack.Push("struct mapped to XmlRpcStruct");
try
{
XmlNodeList members = node.SelectNodes("./member");
foreach (XmlNode member in members)
{
if (member.Name != "member")
continue;
XmlNode nameNode;
bool dupName;
XmlNode valueNode;
bool dupValue;
SelectTwoNodes(member, "name", out nameNode, out dupName, "value",
out valueNode, out dupValue);
if (nameNode == null)
throw new XmlRpcInvalidXmlRpcException(parseStack.ParseType
+ " contains a member with missing name element"
+ " " + StackDump(parseStack));
if (dupName)
throw new XmlRpcInvalidXmlRpcException(parseStack.ParseType
+ " contains member with more than one name element"
+ " " + StackDump(parseStack));
string rpcName = nameNode.FirstChild.Value;
if (valueNode == null)
throw new XmlRpcInvalidXmlRpcException(parseStack.ParseType
+ " contains struct member " + rpcName + " with missing value "
+ " " + StackDump(parseStack));
if (dupValue)
throw new XmlRpcInvalidXmlRpcException(parseStack.ParseType
+ " contains member with more than one value element"
+ " " + StackDump(parseStack));
if (retObj.Contains(rpcName))
{
if (!IgnoreDuplicateMembers)
throw new XmlRpcInvalidXmlRpcException(parseStack.ParseType
+ " contains struct value with duplicate member "
+ nameNode.FirstChild.Value
+ " " + StackDump(parseStack));
else
continue;
}
object valObj;
parseStack.Push(String.Format("member {0}", rpcName));
try
{
XmlNode vvNode = valueNode.SelectSingleNode("./*");
if (vvNode == null)
vvNode = valueNode.FirstChild;
valObj = ParseValue(vvNode, null, parseStack,
mappingAction);
}
finally
{
parseStack.Pop();
}
retObj.Add(rpcName, valObj);
}
}
finally
{
parseStack.Pop();
}
return retObj;
}
开发者ID:molotovbliss,项目名称:csharlibformagexmlrpcapi,代码行数:71,代码来源:Copy+of+XmlRpcSerializer+-+preservewhitepace.cs