本文整理汇总了C#中acUI.acUI.FixBreaks方法的典型用法代码示例。如果您正苦于以下问题:C# acUI.acUI.FixBreaks方法的具体用法?C# acUI.acUI.FixBreaks怎么用?C# acUI.acUI.FixBreaks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类acUI.acUI
的用法示例。
在下文中一共展示了acUI.acUI.FixBreaks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: wmGetParameters
public string wmGetParameters(string sType, string sID, bool bEditable, bool bSnipValues)
{
dataAccess dc = new dataAccess();
acUI.acUI ui = new acUI.acUI();
try
{
string sErr = "";
string sParameterXML = "";
string sSQL = "";
string sTable = "";
if (sType == "ecosystem")
sTable = "ecosystem";
else if (sType == "task")
sTable = "task";
sSQL = "select parameter_xml from " + sTable + " where " + sType + "_id = '" + sID + "'";
if (!dc.sqlGetSingleString(ref sParameterXML, sSQL, ref sErr))
{
throw new Exception(sErr);
}
if (sParameterXML != "")
{
XDocument xDoc = XDocument.Parse(sParameterXML);
if (xDoc == null)
throw new Exception("Parameter XML data for " + sType + " [" + sID + "] is invalid.");
XElement xParams = xDoc.XPathSelectElement("/parameters");
if (xParams == null)
throw new Exception("Parameter XML data for " + sType + " [" + sID + "] does not contain 'parameters' root node.");
string sHTML = "";
foreach (XElement xParameter in xParams.XPathSelectElements("parameter"))
{
string sPID = xParameter.Attribute("id").Value;
string sName = xParameter.Element("name").Value;
string sDesc = xParameter.Element("desc").Value;
bool bEncrypt = false;
if (xParameter.Attribute("encrypt") != null)
bEncrypt = dc.IsTrue(xParameter.Attribute("encrypt").Value);
sHTML += "<div class=\"parameter\">";
sHTML += " <div class=\"ui-state-default parameter_header\">";
sHTML += "<div class=\"step_header_title\"><span class=\"parameter_name";
sHTML += (bEditable ? " pointer" : ""); //make the name a pointer if it's editable
sHTML += "\" id=\"" + sPID + "\">";
sHTML += sName;
sHTML += "</span></div>";
sHTML += "<div class=\"step_header_icons\">";
sHTML += "<img class=\"parameter_help_btn pointer trans50\"" +
" src=\"../images/icons/info.png\" alt=\"\" style=\"width: 12px; height: 12px;\"" +
" title=\"" + sDesc.Replace("\"", "") + "\" />";
if (bEditable)
{
sHTML += "<img class=\"parameter_remove_btn pointer\" remove_id=\"" + sPID + "\"" +
" src=\"../images/icons/fileclose.png\" alt=\"\" style=\"width: 12px; height: 12px;\" />";
}
sHTML += "</div>";
sHTML += "</div>";
sHTML += "<div class=\"ui-widget-content ui-corner-bottom clearfloat parameter_detail\">";
//desc - a short snip is shown here... 75 chars.
//if (!string.IsNullOrEmpty(sDesc))
// if (bSnipValues)
// sDesc = ui.GetSnip(sDesc, 75);
// else
// sDesc = ui.FixBreaks(sDesc);
//sHTML += "<div class=\"parameter_desc hidden\">" + sDesc + "</div>";
//values
XElement xValues = xParameter.XPathSelectElement("values");
if (xValues != null)
{
foreach (XElement xValue in xValues.XPathSelectElements("value"))
{
string sValue = (string.IsNullOrEmpty(xValue.Value) ? "" : xValue.Value);
//only show stars IF it's encrypted, but ONLY if it has a value
if (bEncrypt && !string.IsNullOrEmpty(sValue))
sValue = "********";
else
if (bSnipValues)
sValue = ui.GetSnip(xValue.Value, 64);
else
sValue = ui.FixBreaks(xValue.Value);
sHTML += "<div class=\"ui-widget-content ui-corner-tl ui-corner-bl parameter_value\">" + sValue + "</div>";
}
}
//.........这里部分代码省略.........
示例2: wmGetCloudObjectList
//.........这里部分代码省略.........
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
sHTML += "Result is valid XML.";
//test the record xpath
sHTML += "<div>Checking Record Xpath [" + cot.XMLRecordXPath + "]... ";
if (cot.XMLRecordXPath != "")
{
XElement xe = xDoc.XPathSelectElement(cot.XMLRecordXPath);
if (xe == null) {
sHTML += "<span class=\"ui-state-info\">Record XPath [" + cot.XMLRecordXPath + "] was not found.</span><br />";
sHTML += "<span class=\"ui-state-info\">(This may be a normal condition if the Cloud doesn't contain any objects of this type.)</span>";
}
else
sHTML += "Record XPath matched [" + xe.Nodes().Count() + "] items.";
}
else
sHTML += "Record XPath is not defined.";
sHTML += "</div>";
sHTML += "<div class=\"ui-state-default\"><span id=\"api_results_toggler\" class=\"ui-icon-circle-triangle-e ui-icon floatleft\"></span>Result XML</div>";
sHTML += "<div id=\"api_results_div\" class=\"hidden\">";
sHTML += "<pre><code>";
sHTML += ui.FixBreaks(ui.SafeHTML(sXML));
sHTML += "</code></pre>";
sHTML += "</div>";
}
else
{
sHTML = "<span class=\"ui-widget-content ui-state-error\">Cloud Object Type definition for [" + sObjectType + "] is incomplete.</span>";
}
//end API RESULTS
sHTML += "</div>";
return sHTML;
}