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


C# ICondition.GetConditionDef方法代码示例

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


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

示例1: WriteConditionToXmlNode

 private XmlNode WriteConditionToXmlNode(ICondition condition)
 {
     string conditionName = condition.GetConditionDef().GetConditionName();
     XmlElement conditionElement = m_doc.CreateElement(conditionName);
     if (condition is AbstractCompositeCondition)
     {
         if (condition is AbstractMultipleCondition)
         {
             var multipleCondition = condition as AbstractMultipleCondition;
             foreach (ICondition subCondition in multipleCondition.ConditionList)
             {
                 conditionElement.AppendChild(WriteConditionToXmlNode(subCondition));
             }
         }
         else
         {
             var singleCondition = condition as AbstractSingleCondition;
             conditionElement.AppendChild(
                 WriteConditionToXmlNode(singleCondition.ConditionList[0]));
         }
     }
     else
     {
         var atomicCondition = condition as AbstractAtomicCondition;
         conditionElement.SetAttribute(RuleFileConstants.Operator,
             atomicCondition.Operator.GetOperatorName());
         conditionElement.SetAttribute(RuleFileConstants.Value, atomicCondition.Value);
     }
     return conditionElement;
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:30,代码来源:RuleFileWriter.cs

示例2: InitBeforeShow

 public void InitBeforeShow(TreeNode modifiedTreeNode, 
     ICategory fixedCategory, ICondition fixedCondition)
 {
     m_modifiedTreeNode = modifiedTreeNode;
     m_fixedCategory = fixedCategory;
     m_fixedCondition = fixedCondition;
     // Init conditionComboBox
     List<IConditionDef> conditionDefList =
         RuleEngine.GetConditionManager().GetPossibleConditionDefList(m_fixedCategory);
     conditionComboBox.Items.Clear();
     foreach (IConditionDef conditionDef in conditionDefList)
     {
         conditionComboBox.Items.Add(conditionDef.GetConditionName());
     }
     if (m_fixedCondition != null)
     {
         // Select the inital one.
         // And this line, will call conditionComboBox_SelectedIndexChanged synchronously.
         conditionComboBox.SelectedItem =
             m_fixedCondition.GetConditionDef().GetConditionName();
         //ResizeControl();
         //UpdateOperatorComboBox();
         //UpdateValueComboBox();
         if (m_fixedCondition is AbstractAtomicCondition)
         {
             var atomicCondition = (AbstractAtomicCondition) m_fixedCondition;
             operatorComboBox.SelectedItem = atomicCondition.Operator.GetOperatorName();
             if (m_fixedCondition is NativeParameterIndexCondition)
             {
                 parameterIndexNumericUpDown.Value = Int32.Parse(
                     atomicCondition.Value, CultureInfo.InvariantCulture);
             }
             else
             {
                 valueComboBox.Text = atomicCondition.Value;
             }
         }
     }
     else
     {
         SetControlVisibility();
     }
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:43,代码来源:ConditionInPlaceEditor.cs

示例3: CheckCondition

 private bool CheckCondition(ICondition condition)
 {
     if (condition is AbstractCompositeCondition)
     {
         var compositeCondition = (AbstractCompositeCondition) condition;
         List<ICondition> list = compositeCondition.ConditionList;
         if (list.Count == 0)
         {
             MessageBox.Show(Resource.FormatString("Wrn_EmptyCompositeCondition",
                                                   condition.GetConditionDef().GetConditionName()));
             return false;
         }
         return list.All(t => CheckCondition(t));
     }
     else
     {
         return true;
     }
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:19,代码来源:MainForm.cs

示例4: CanConditionApplyToCategory

 private bool CanConditionApplyToCategory(ICondition condition, ICategory category)
 {
     if (condition is AbstractAtomicCondition)
         return condition.GetConditionDef().CanApplyToCategory(category);
     else
     {
         // AbstractCompositeCondition
         var compositeCondition = condition as AbstractCompositeCondition;
         foreach (ICondition subCondition in compositeCondition.ConditionList)
         {
             if (!subCondition.GetConditionDef().CanApplyToCategory(category))
                 return false;
         }
         return condition.GetConditionDef().CanApplyToCategory(category);
     }
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:16,代码来源:MainForm.cs

示例5: GetConditionTreeNode

        public static TreeNode GetConditionTreeNode(ICondition condition)
        {
            TreeNode conditionNode = new TreeNode();
            if (condition is AbstractCompositeCondition)
            {
                var compositeCondition = (AbstractCompositeCondition) condition;

                foreach (ICondition subCondition in compositeCondition.ConditionList)
                {
                    conditionNode.Nodes.Add(GetConditionTreeNode(subCondition));
                }

                // Append the "<Empty>" node.
                AbstractCompositeConditionDef compositeConditionDef =
                    (AbstractCompositeConditionDef) condition.GetConditionDef();
                if (conditionNode.Nodes.Count < compositeConditionDef.GetMaxSubconditionNumber())
                {
                    conditionNode.Nodes.Add(GetEmptyConditionTreeNode());
                }
            }
            conditionNode.Text = GetConditionNodeText(condition);
            conditionNode.Tag = condition;
            SetRuleTreeNodeImage(conditionNode);
            return conditionNode;
        }
开发者ID:dbremner,项目名称:clrinterop,代码行数:25,代码来源:RuleSet2TreeNodeProcessor.cs


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