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


C# acUI.acUI.SafeHTML方法代码示例

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


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

示例1: 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;
        }
开发者ID:you8,项目名称:cato,代码行数:101,代码来源:cloudAPITester.aspx.cs


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