示例#1
0
文件: RuleEditFrm.cs 项目: mzh99/BUM
        private void AddRuleBtn_Click(object sender, EventArgs e)
        {
            ExcludeRule rule = null;

            if (SampleRulesCB.SelectedIndex >= 0)
            {
                switch ((RuleAppliesTo)ApplyToCB.SelectedIndex)
                {
                case RuleAppliesTo.Files:
                    rule = CommonRules.RulesFiles[SampleRulesCB.SelectedIndex];
                    break;

                case RuleAppliesTo.FolderAndSubfolders:
                    rule = CommonRules.RulesFoldersAndSubs[SampleRulesCB.SelectedIndex];
                    break;

                case RuleAppliesTo.ParentFolderOnly:
                    rule = CommonRules.RulesParentFolder[SampleRulesCB.SelectedIndex];
                    break;
                }
                if (rule != null)
                {
                    RuleTB.Text += Environment.NewLine + @"// " + rule.Desc + Environment.NewLine + rule.RuleCode;
                    if (DescTB.Text == string.Empty)
                    {
                        DescTB.Text = rule.Desc;
                    }
                }
            }
        }
示例#2
0
文件: RuleEditFrm.cs 项目: mzh99/BUM
 public RuleEditFrm(ExcludeRule init, bool addMode)
 {
     InitializeComponent();
     this.Text   = addMode ? "Add Exclusion Rule" : "Edit Exclusion Rule";
     Result      = init ?? new ExcludeRule();
     RuleTB.Text = Result.RuleCode;
     DescTB.Text = Result.Desc;
     DiagTB.Text = string.Empty;
     //SampleRulesCB.DataSource = CommonRules.AllRules.Select(r => r.Desc).ToArray();
     ApplyToCB.DataSource        = Enum.GetNames(typeof(RuleAppliesTo));
     ApplyToCB.SelectedIndex     = (int)Result.AppliesTo;
     SampleRulesCB.SelectedIndex = -1;
 }
示例#3
0
文件: ScriptRunner.cs 项目: mzh99/BUM
 public CompiledExclusionRule(ExcludeRule rule) : this(rule.AppliesTo, rule.RuleCode)
 {
 }