private void CloseAndRevertPreset(bool revertPreset) { mTimer.Stop(); if (revertPreset) { DisplayPresetRecorderAndApplier.ApplyPreset(mRevertPreset); } Close(); }
static public void ApplyPreset() { Console.Write("Enter name of preset to apply: "); string presetName = Console.ReadLine(); DisplayPresetCollection displayPresetCollection = DisplayPresetCollection.GetDisplayPresetCollection(); DisplayPreset targetPreset = displayPresetCollection.GetPreset(presetName); if (targetPreset == null) { Console.WriteLine("Preset with name '" + presetName + "' does not exist."); return; } Console.WriteLine("Applying preset '" + presetName + "'..."); DisplayPresetRecorderAndApplier.ApplyPreset(targetPreset); }
public static void ApplyPreset(string[] args) { if (args.Length < 2) { Console.WriteLine("Insufficient arguments."); return; } // Trim quotes in case the preset name has spaces string presetName = args[1].Trim(new char[] { '"', '\'' }); DisplayPresetCollection displayPresetCollection = DisplayPresetCollection.GetDisplayPresetCollection(); DisplayPreset displayPreset = displayPresetCollection.GetPreset(presetName); if (displayPreset == null) { Console.WriteLine(String.Format("Preset '{0}' does not exist.", presetName)); return; } DisplayPresetRecorderAndApplier.ApplyPreset(displayPreset); }