本文整理汇总了C#中acUI.acUI.GetSelectedCloudProvider方法的典型用法代码示例。如果您正苦于以下问题:C# acUI.acUI.GetSelectedCloudProvider方法的具体用法?C# acUI.acUI.GetSelectedCloudProvider怎么用?C# acUI.acUI.GetSelectedCloudProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类acUI.acUI
的用法示例。
在下文中一共展示了acUI.acUI.GetSelectedCloudProvider方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: wmGetCloudObjectList
public static string wmGetCloudObjectList(string sCloudID, string sObjectType)
{
acUI.acUI ui = new acUI.acUI();
awsMethods acAWS = new awsMethods();
string sXML = "";
string sErr = "";
string sHTML = "";
//get the cloud object type from the session
Provider p = ui.GetSelectedCloudProvider();
CloudObjectType cot = ui.GetCloudObjectType(p, sObjectType);
if (cot != null)
{
if (string.IsNullOrEmpty(cot.ID))
{ sErr = "Cannot find definition for requested object type [" + sObjectType + "]"; return null; }
}
else
{
sErr = "GetCloudObjectType failed for [" + sObjectType + "]";
return null;
}
sXML = acAWS.GetCloudObjectsAsXML(sCloudID, cot, ref sErr, null);
if (!string.IsNullOrEmpty(sErr))
{
return "GetCloudObjectsAsXML failed with error: " + sErr;
}
if (string.IsNullOrEmpty(sXML))
{
return "Cloud connection was successful, but the query returned no data.";
}
//try a few debugging things:
//Peek at our object type definition
sHTML += "<div class=\"ui-state-default\">Cloud Object Type Definition</div>";
sHTML += "<div class=\"ui-widget-content\">";
if (cot != null)
{
string sReq = "<span class=\"ui-widget-content ui-state-error\">required</span>";
//product stuff
sHTML += "<span class=\"property\">Product:</span> <span class=\"code\">" + (string.IsNullOrEmpty(cot.ParentProduct.Name) ? sReq : cot.ParentProduct.Name).ToString() + "</span><br />";
sHTML += "<span class=\"property\">APIVersion:</span> <span class=\"code\">" + (string.IsNullOrEmpty(cot.ParentProduct.APIVersion) ? sReq : cot.ParentProduct.APIVersion).ToString() + "</span><br />";
//type stuff
sHTML += "<span class=\"property\">Name:</span> <span class=\"code\">" + (string.IsNullOrEmpty(cot.ID) ? sReq : cot.ID).ToString() + "</span>";
sHTML += "<span class=\"property\">Label:</span> <span class=\"code\">" + cot.Label + "</span><br />";
sHTML += "<span class=\"property\">API:</span> <span class=\"code\">" + cot.APICall + "</span>";
sHTML += "<span class=\"property\">APIUrlPrefix:</span> <span class=\"code\">" + cot.ParentProduct.APIUrlPrefix.ToString() + "</span>";
sHTML += "<span class=\"property\">APICall:</span> <span class=\"code\">" + cot.APICall.ToString() + "</span><br />";
sHTML += "<span class=\"property\">APIRequestGroupFilter:</span> <span class=\"code\">" + (string.IsNullOrEmpty(cot.APIRequestGroupFilter) ? "N/A" : cot.APIRequestGroupFilter) + "</span><br />";
sHTML += "<span class=\"property\">APIRequestRecordFilter:</span> <span class=\"code\">" + (string.IsNullOrEmpty(cot.APIRequestRecordFilter) ? "N/A" : cot.APIRequestRecordFilter) + "</span><br />";
sHTML += "<span class=\"property\">XMLRecordXPath:</span> <span class=\"code\">" + (string.IsNullOrEmpty(cot.XMLRecordXPath) ? sReq : cot.XMLRecordXPath).ToString() + "</span><br />";
sHTML += "<div class=\"properties\">";
if (cot.Properties.Count > 0)
{
foreach (CloudObjectTypeProperty cop in cot.Properties)
{
sHTML += "<div class=\"ui-state-default\">" + cop.Name + "</div>";
sHTML += "<div class=\"ui-widget-content ui-corner-bottom\">";
sHTML += "<span class=\"property\">Label: <span class=\"code\">" + (string.IsNullOrEmpty(cop.Label) ? "N/A" : cop.Label) + "</span></span>";
sHTML += "<span class=\"property\">XPath: <span class=\"code\">" + cop.XPath + "</span></span>";
sHTML += "<span class=\"property\">HasIcon: <span class=\"code\">" + cop.HasIcon + "</span></span>";
sHTML += "<span class=\"property\">IsID: <span class=\"code\">" + cop.IsID + "</span></span>";
sHTML += "<span class=\"property\">ShortList: <span class=\"code\">" + cop.ShortList + "</span></span>";
sHTML += "</div>";
}
}
else
{
sHTML += "<span class=\"ui-widget-content ui-state-error\">At least one Property is required.</span>";
}
sHTML += "</div>";
}
else
sHTML = "<span class=\"ui-widget-content ui-state-error\">GetCloudObjectType failed for [" + sObjectType + "].</span>";
//end object type definition box
sHTML += "</div>";
sHTML += "<hr />";
//API RESULTS
sHTML += "<div class=\"ui-state-default\">API Results</div>";
sHTML += "<div class=\"ui-widget-content\">";
//this will return false if the object doesn't have enough information to form a call
if (cot.IsValidForCalls())
{
//we have a complete enough object type to make a call.
//can it be parsed?
sXML = ui.RemoveNamespacesFromXML(sXML);
XElement xDoc = XElement.Parse(sXML);
if (xDoc == null)
sHTML += "<span class=\"ui-widget-content ui-state-error\">Cloud Response XML document is invalid.</span>.";
else
//.........这里部分代码省略.........