예제 #1
0
        static void StopAllRules(StopAllRulesOptions options)
        {
            foreach (var item in BGWorker.Rules)
            {
                BGWorker.StopRule(item.RuleID);
            }

            Console.WriteLine("All rules stopped!");
        }
예제 #2
0
        static void RemoveAllRules(RemoveAllRulesOptions options)
        {
            foreach (var item in BGWorker.Rules)
            {
                BGWorker.StopRule(item.RuleID);
            }

            BGWorker.Rules.Clear();
            Console.WriteLine("Rules removed");
        }
예제 #3
0
 static void GetAllRules(GetAllRulesOptions options)
 {
     BGWorker.writeRulesToConsole();
 }
예제 #4
0
 static void RemoveRule(RemoveRuleOptions options)
 {
     BGWorker.StopRule(int.Parse(options.RemoveRuleID));
     BGWorker.RemoveRule(int.Parse(options.RemoveRuleID));
 }
예제 #5
0
 static void StartRule(StartRuleOptions options)
 {
     BGWorker.StartRule(int.Parse(options.StartRuleID));
 }
예제 #6
0
 static void SaveFile(SaveFileOptions options)
 {
     BGWorker.RulesFileName = options.SaveFilePath;
     BGWorker.SaveRules();
 }
예제 #7
0
 static void LoadFile(LoadFileOptions options)
 {
     BGWorker.RulesFileName = options.LoadFilePath;
     BGWorker.LoadRules();
 }
예제 #8
0
 static void AddRule(AddRuleOptions options)
 {
     BGWorker.AddRule(options.Type, options.URL, int.Parse(options.Time), options.Content);
 }