本文整理汇总了C#中IAction.GetActionDef方法的典型用法代码示例。如果您正苦于以下问题:C# IAction.GetActionDef方法的具体用法?C# IAction.GetActionDef怎么用?C# IAction.GetActionDef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAction
的用法示例。
在下文中一共展示了IAction.GetActionDef方法的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;
}
示例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;
}
示例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();
}