static void StopAllRules(StopAllRulesOptions options) { foreach (var item in BGWorker.Rules) { BGWorker.StopRule(item.RuleID); } Console.WriteLine("All rules stopped!"); }
static void RemoveAllRules(RemoveAllRulesOptions options) { foreach (var item in BGWorker.Rules) { BGWorker.StopRule(item.RuleID); } BGWorker.Rules.Clear(); Console.WriteLine("Rules removed"); }
static void GetAllRules(GetAllRulesOptions options) { BGWorker.writeRulesToConsole(); }
static void RemoveRule(RemoveRuleOptions options) { BGWorker.StopRule(int.Parse(options.RemoveRuleID)); BGWorker.RemoveRule(int.Parse(options.RemoveRuleID)); }
static void StartRule(StartRuleOptions options) { BGWorker.StartRule(int.Parse(options.StartRuleID)); }
static void SaveFile(SaveFileOptions options) { BGWorker.RulesFileName = options.SaveFilePath; BGWorker.SaveRules(); }
static void LoadFile(LoadFileOptions options) { BGWorker.RulesFileName = options.LoadFilePath; BGWorker.LoadRules(); }
static void AddRule(AddRuleOptions options) { BGWorker.AddRule(options.Type, options.URL, int.Parse(options.Time), options.Content); }