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


C# IAction.GetParameterValue方法代码示例

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


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

示例1: GetActionTreeNode

        public static TreeNode GetActionTreeNode(IAction action)
        {
            TreeNode actionNode = new TreeNode();
            actionNode.Text = ACTION_NODE_TEXT + " : " + action.GetActionDef().GetActionName();
            if (!action.IsInitialized)
            {
                actionNode.Text += " <" + Resource.FormatString("Msg_EditUninitializedActionTip") + ">";
            }
            actionNode.Tag = action;

            IActionDef actionDef =
                RuleEngine.GetActionManager().GetActionDef(action.GetActionDef().GetActionName());
            List<string> paramNameList = actionDef.GetParameterNames();
            foreach (string paramName in paramNameList)
            {
                TreeNode actionParameterNode = new TreeNode();
                StringBuilder sb = new StringBuilder();
                sb.Append(paramName);
                sb.Append(" = '");
                if (action.IsInitialized)
                    sb.Append(action.GetParameterValue(paramName));
                else
                    sb.Append(TreeNodeConstants.Uninitialized_Value);
                sb.Append("'");
                actionParameterNode.Text = sb.ToString();
                actionParameterNode.Tag = action;
                SetRuleTreeNodeImage(actionParameterNode);
                actionNode.Nodes.Add(actionParameterNode);
            }

            SetRuleTreeNodeImage(actionNode);
            return actionNode;
        }
开发者ID:dbremner,项目名称:clrinterop,代码行数:33,代码来源:RuleSet2TreeNodeProcessor.cs

示例2: WriteActionToXmlNode

        private XmlNode WriteActionToXmlNode(IAction action)
        {
            // <Action>
            XmlElement actionNode = m_doc.CreateElement(RuleFileConstants.ActionElementName);
            actionNode.SetAttribute(RuleFileConstants.Name, action.GetActionDef().GetActionName());

            AbstractActionManager actionManager = RuleEngine.GetActionManager();
            IActionDef actionDef = actionManager.GetActionDef(action.GetActionDef().GetActionName());
            List<string> paramList = actionDef.GetParameterNames();
            foreach (string paramName in paramList)
            {
                // <Param>
                XmlElement newNameParamNode = m_doc.CreateElement(RuleFileConstants.Parameter);
                newNameParamNode.SetAttribute(RuleFileConstants.Key, paramName);
                newNameParamNode.SetAttribute(RuleFileConstants.Value,
                    action.GetParameterValue(paramName));
                actionNode.AppendChild(newNameParamNode);
            }
            return actionNode;
        }
开发者ID:dbremner,项目名称:clrinterop,代码行数:20,代码来源:RuleFileWriter.cs

示例3: GetActionParamString

 private static string GetActionParamString(IAction action)
 {
     StringBuilder sb = new StringBuilder();
     IActionDef actionDef =
         RuleEngine.GetActionManager().GetActionDef(action.GetActionDef().GetActionName());
     List<string> paramNameList = actionDef.GetParameterNames();
     foreach (string paramName in paramNameList)
     {
         if (sb.Length != 0)
             sb.Append(", ");
         sb.Append(paramName);
         sb.Append("='");
         sb.Append(action.GetParameterValue(paramName));
         sb.Append("'");
     }
     return sb.ToString();
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:17,代码来源:RuleSet2TreeNodeProcessor.cs


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