本文整理汇总了C#中acUI.acUI.GetSnip方法的典型用法代码示例。如果您正苦于以下问题:C# acUI.acUI.GetSnip方法的具体用法?C# acUI.acUI.GetSnip怎么用?C# acUI.acUI.GetSnip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类acUI.acUI
的用法示例。
在下文中一共展示了acUI.acUI.GetSnip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: wmGetClips
public string wmGetClips()
{
dataAccess dc = new dataAccess();
FunctionTemplates.HTMLTemplates ft = new FunctionTemplates.HTMLTemplates();
acUI.acUI ui = new acUI.acUI();
try
{
string sUserID = ui.GetSessionUserID();
string sErr = "";
//note: some literal values are selected here. That's because DrawReadOnlyStep
//requires a more detailed record, but the snip doesn't have some of those values
//so we hardcode them.
string sSQL = "select s.clip_dt, s.step_id, s.step_desc, s.function_name, s.function_xml," +
" f.function_label, f.category_name, c.category_label, f.icon," +
" s.output_parse_type, s.output_row_delimiter, s.output_column_delimiter, s.variable_xml," +
" -1 as step_order, 0 as commented " +
" from task_step_clipboard s" +
" join lu_task_step_function f on s.function_name = f.function_name" +
" join lu_task_step_function_category c on f.category_name = c.category_name" +
" where s.user_id = '" + sUserID + "'" +
" and s.codeblock_name is null" +
" order by s.clip_dt desc";
DataTable dt = new DataTable();
if (!dc.sqlGetDataTable(ref dt, sSQL, ref sErr))
{
throw new Exception(sErr);
}
string sHTML = "";
foreach (DataRow dr in dt.Rows)
{
string sStepID = dr["step_id"].ToString();
string sLabel = dr["function_label"].ToString();
string sIcon = dr["icon"].ToString();
string sClipDT = dr["clip_dt"].ToString();
string sDesc = ui.GetSnip(dr["step_desc"].ToString(), 75);
sHTML += "<li" +
" id=\"clip_" + sStepID + "\"" +
" name=\"clip_" + sStepID + "\"" +
" class=\"command_item function clip\"" +
">";
//a table for the label so the clear icon can right align
sHTML += "<table width=\"99%\" border=\"0\"><tr>";
sHTML += "<td width=\"1px\"><img alt=\"\" src=\"../images/" + sIcon + "\" /></td>";
sHTML += "<td style=\"vertical-align: middle; padding-left: 5px;\">" + sLabel + "</td>";
sHTML += "<td width=\"1px\" style=\"vertical-align: middle;\">";
//view icon
//due to the complexity of telling the core routines to look in the clipboard table, it
//it not possible to easily show the complex command types
// without a redesign of how this works. NSC 4-19-2011
//due to several reasons, most notable being that the XML node for each of those commands
//that contains the step_id is hardcoded and the node names differ.
//and GetSingleStep requires a step_id which must be mined from the XML.
//so.... don't show a preview icon for them
string sFunction = dr["function_name"].ToString();
if (!"loop,exists,if,while".Contains(sFunction))
{
sHTML += "<span id=\"btn_view_clip\" view_id=\"v_" + sStepID + "\">" +
"<img src=\"../images/icons/search.png\" style=\"width: 16px; height: 16px;\" alt=\"\" />" +
"</span>";
}
sHTML += "</td></tr>";
sHTML += "<tr><td> </td><td><span class=\"code\">" + sClipDT + "</span></td>";
sHTML += "<td>";
//delete icon
sHTML += "<span id=\"btn_clear_clip\" remove_id=\"" + sStepID + "\">" +
"<img src=\"../images/icons/fileclose.png\" style=\"width: 16px; height: 16px;\" alt=\"\" />" +
"</span>";
sHTML += "</td></tr></table>";
sHTML += "<div class=\"hidden\" id=\"help_text_clip_" + sStepID + "\">" + sDesc + "</div>";
//we use this function because it draws a smaller version than DrawReadOnlyStep
string sStepHTML = "";
//and don't draw those complex ones either
if (!"loop,exists,if,while".Contains(sFunction))
sStepHTML = ft.DrawEmbeddedReadOnlyStep(dr, true);
sHTML += "<div class=\"hidden\" id=\"v_" + sStepID + "\">" + sStepHTML + "</div>";
sHTML += "</li>";
}
return sHTML;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
示例2: 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>";
}
}
//.........这里部分代码省略.........
示例3: wmGetClips
public string wmGetClips()
{
FunctionTemplates.HTMLTemplates ft = new FunctionTemplates.HTMLTemplates();
acUI.acUI ui = new acUI.acUI();
try
{
string sUserID = ui.GetSessionUserID();
string sHTML = "";
ClipboardSteps oCSteps = new ClipboardSteps(sUserID);
if (oCSteps != null)
{
foreach (ClipboardStep cs in oCSteps.Values)
{
string sStepID = cs.ID;
string sLabel = cs.Function.Label;
string sIcon = cs.Function.Icon;
string sDesc = ui.GetSnip(cs.Description, 75);
string sClipDT = cs.ClipDT;
sHTML += "<li" +
" id=\"clip_" + sStepID + "\"" +
" name=\"clip_" + sStepID + "\"" +
" class=\"command_item function clip\"" +
">";
//a table for the label so the clear icon can right align
sHTML += "<table width=\"99%\" border=\"0\"><tr>";
sHTML += "<td width=\"1px\"><img alt=\"\" src=\"../images/" + sIcon + "\" /></td>";
sHTML += "<td style=\"vertical-align: middle; padding-left: 5px;\">" + sLabel + "</td>";
sHTML += "<td width=\"1px\" style=\"vertical-align: middle;\">";
//view icon
//due to the complexity of telling the core routines to look in the clipboard table, it
//it not possible to easily show the complex command types
// without a redesign of how this works. NSC 4-19-2011
//due to several reasons, most notable being that the XML node for each of those commands
//that contains the step_id is hardcoded and the node names differ.
//and GetSingleStep requires a step_id which must be mined from the XML.
//so.... don't show a preview icon for them
string sFunction = cs.Function.Name;
if (!"loop,exists,if,while".Contains(sFunction))
{
sHTML += "<span id=\"btn_view_clip\" view_id=\"v_" + sStepID + "\">" +
"<img src=\"../images/icons/search.png\" style=\"width: 16px; height: 16px;\" alt=\"\" />" +
"</span>";
}
sHTML += "</td></tr>";
sHTML += "<tr><td> </td><td><span class=\"code\">" + sClipDT + "</span></td>";
sHTML += "<td>";
//delete icon
sHTML += "<span id=\"btn_clear_clip\" remove_id=\"" + sStepID + "\">" +
"<img src=\"../images/icons/fileclose.png\" style=\"width: 16px; height: 16px;\" alt=\"\" />" +
"</span>";
sHTML += "</td></tr></table>";
sHTML += "<div class=\"hidden\" id=\"help_text_clip_" + sStepID + "\">" + sDesc + "</div>";
//we use this function because it draws a smaller version than DrawReadOnlyStep
string sStepHTML = "";
//and don't draw those complex ones either
if (!"loop,exists,if,while".Contains(sFunction))
sStepHTML = ft.DrawClipboardStep(cs, true);
sHTML += "<div class=\"hidden\" id=\"v_" + sStepID + "\">" + sStepHTML + "</div>";
sHTML += "</li>";
}
}
return sHTML;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}