public void DeleteSetting(string SettingTitle) { OnBeforeMoonbyteCommandsEventArgs onBeforeRequest = new OnBeforeMoonbyteCommandsEventArgs() { SettingDirectory = this.SettingsDirectory }; OnBeforeDeleteSetting?.Invoke(this, onBeforeRequest); if (onBeforeRequest.CancelRequest == BaseCommands.MoonbyteCancelRequest.Continue) { if (CheckValues()) { BaseCommands.BaseDeleteSetting(SettingTitle, settings); } } OnAfterDeleteSetting?.Invoke(this, new EventArgs()); }
public string ReadSetting(string SettingTitle) { OnBeforeMoonbyteCommandsEventArgs onBeforeRequest = new OnBeforeMoonbyteCommandsEventArgs() { SettingDirectory = this.SettingsDirectory }; OnBeforeReadSetting?.Invoke(this, onBeforeRequest); if (onBeforeRequest.CancelRequest == BaseCommands.MoonbyteCancelRequest.Continue) { if (CheckValues()) { OnAfterReadSetting?.Invoke(this, new EventArgs()); return(BaseCommands.BaseReadSetting(SettingTitle, settings)); } } OnAfterReadSetting?.Invoke(this, new EventArgs()); return(null); }
public void EditSetting(string SettingTitle, string SettingValue) { OnBeforeMoonbyteCommandsEventArgs OnBeforeRequest = new OnBeforeMoonbyteCommandsEventArgs() { SettingDirectory = this.SettingsDirectory }; OnBeforeEditSetting?.Invoke(this, OnBeforeRequest); if (OnBeforeRequest.CancelRequest == BaseCommands.MoonbyteCancelRequest.Continue) { if (CheckValues()) { List <string> Settings = LoadSettings(); BaseCommands.BaseEditSetting(SettingTitle, SettingValue, Settings); SaveSettings(Settings); } } OnAfterEditSetting?.Invoke(this, new EventArgs()); }
public bool CheckSetting(string SettingTitle) { OnBeforeMoonbyteCommandsEventArgs OnBeforeRequest = new OnBeforeMoonbyteCommandsEventArgs() { SettingDirectory = this.SettingsDirectory }; OnBeforeCheckSetting?.Invoke(this, OnBeforeRequest); if (OnBeforeRequest.CancelRequest == BaseCommands.MoonbyteCancelRequest.Continue) { if (CheckValues()) { List <string> Settings = LoadSettings(); OnAfterCheckSetting?.Invoke(this, new EventArgs()); return(BaseCommands.BaseCheckSetting(SettingTitle, Settings, true)); } } OnAfterCheckSetting?.Invoke(this, new EventArgs()); return(false); }