本文整理汇总了C#中CookComputing.XmlRpc.XmlRpcStruct.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# XmlRpcStruct.GetEnumerator方法的具体用法?C# XmlRpcStruct.GetEnumerator怎么用?C# XmlRpcStruct.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CookComputing.XmlRpc.XmlRpcStruct
的用法示例。
在下文中一共展示了XmlRpcStruct.GetEnumerator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrderingEnumerator
public void OrderingEnumerator()
{
var xps = new XmlRpcStruct();
xps.Add("1", "a");
xps.Add("3", "c");
xps.Add("2", "b");
IDictionaryEnumerator enumerator = xps.GetEnumerator();
enumerator.MoveNext();
Assert.AreEqual("1", enumerator.Key);
Assert.AreEqual("a", enumerator.Value);
Assert.IsInstanceOfType(typeof(DictionaryEntry), enumerator.Current);
DictionaryEntry de = (DictionaryEntry)enumerator.Current;
Assert.AreEqual("1", de.Key);
Assert.AreEqual("a", de.Value);
enumerator.MoveNext();
Assert.AreEqual("3", enumerator.Key);
Assert.AreEqual("c", enumerator.Value);
Assert.IsInstanceOfType(typeof(DictionaryEntry), enumerator.Current);
de = (DictionaryEntry)enumerator.Current;
Assert.AreEqual("3", de.Key);
Assert.AreEqual("c", de.Value);
enumerator.MoveNext();
Assert.AreEqual("2", enumerator.Key);
Assert.AreEqual("b", enumerator.Value);
Assert.IsInstanceOfType(typeof(DictionaryEntry), enumerator.Current);
de = (DictionaryEntry)enumerator.Current;
Assert.AreEqual("2", de.Key);
Assert.AreEqual("b", de.Value);
}
示例2: CheckOrdersPrintingStatus
/// <summary>
/// Check if order is printing or not and update order status in orderlist
/// </summary>
/// <param name="ordersList">array of orders represented in XmlRpcStruct </param>
/// <returns>updated array of orders represented in XmlRpcStruct</returns>
private XmlRpcStruct[] CheckOrdersPrintingStatus(XmlRpcStruct[] ordersList)
{
// Select all the outstanding print jobs.
string query = "SELECT * FROM Win32_PrintJob";
ManagementObjectSearcher jobQuery =
new ManagementObjectSearcher(query);
ManagementObjectCollection jobs = jobQuery.Get();
IEnumerator ol = ordersList.GetEnumerator();
for (int count = 0; count < orderslist.Length; count++)
{
XmlRpcStruct order = (XmlRpcStruct)orderslist[count];
order["status"] = AppUtilities.IsDocumentPrinting(AppName + order["order_id"]).ToString();
orderslist[count] = order;
}
return ordersList;
}