private void InitializeQuickSettingsMenu() { this.contextmenu_quicksettings.DropDownItems.Clear(); // screenshot destination ToolStripMenuSelectList selectList = new ToolStripMenuSelectList("destination", true); selectList.Text = lang.GetString(LangKey.settings_destination); selectList.AddItem(lang.GetString(LangKey.settings_destination_editor), Destination.Editor, conf.OutputDestinations.Contains(Destination.Editor)); selectList.AddItem(lang.GetString(LangKey.settings_destination_clipboard), Destination.Clipboard, conf.OutputDestinations.Contains(Destination.Clipboard)); selectList.AddItem(lang.GetString(LangKey.quicksettings_destination_file), Destination.FileDefault, conf.OutputDestinations.Contains(Destination.FileDefault)); selectList.AddItem(lang.GetString(LangKey.settings_destination_fileas), Destination.FileWithDialog, conf.OutputDestinations.Contains(Destination.FileWithDialog)); selectList.AddItem(lang.GetString(LangKey.settings_destination_printer), Destination.Printer, conf.OutputDestinations.Contains(Destination.Printer)); selectList.AddItem(lang.GetString(LangKey.settings_destination_email), Destination.EMail, conf.OutputDestinations.Contains(Destination.EMail)); selectList.CheckedChanged += new EventHandler(this.QuickSettingItemChanged); this.contextmenu_quicksettings.DropDownItems.Add(selectList); // print options selectList = new ToolStripMenuSelectList("printoptions", true); selectList.Text = lang.GetString(LangKey.settings_printoptions); selectList.AddItem(lang.GetString(LangKey.printoptions_allowshrink), "AllowPrintShrink", conf.OutputPrintAllowShrink); selectList.AddItem(lang.GetString(LangKey.printoptions_allowenlarge), "AllowPrintEnlarge", conf.OutputPrintAllowEnlarge); selectList.AddItem(lang.GetString(LangKey.printoptions_allowrotate), "AllowPrintRotate", conf.OutputPrintAllowRotate); selectList.AddItem(lang.GetString(LangKey.printoptions_allowcenter), "AllowPrintCenter", conf.OutputPrintCenter); selectList.CheckedChanged += new EventHandler(this.QuickSettingItemChanged); this.contextmenu_quicksettings.DropDownItems.Add(selectList); // effects selectList = new ToolStripMenuSelectList("effects", true); selectList.Text = lang.GetString(LangKey.settings_visualization); selectList.AddItem(lang.GetString(LangKey.settings_playsound), "PlaySound", conf.PlayCameraSound); selectList.CheckedChanged += new EventHandler(this.QuickSettingItemChanged); this.contextmenu_quicksettings.DropDownItems.Add(selectList); }
private void InitializeQuickSettingsMenu() { this.contextmenu_quicksettings.DropDownItems.Clear(); // screenshot destination ToolStripMenuSelectList sel = new ToolStripMenuSelectList("destination", true); sel.Text = lang.GetString("settings_destination"); sel.AddItem(lang.GetString("settings_destination_editor"), ScreenshotDestinations.Editor, (conf.Output_Destinations & ScreenshotDestinations.Editor) == ScreenshotDestinations.Editor); sel.AddItem(lang.GetString("settings_destination_clipboard"), ScreenshotDestinations.Clipboard, (conf.Output_Destinations & ScreenshotDestinations.Clipboard) == ScreenshotDestinations.Clipboard); sel.AddItem(lang.GetString("quicksettings_destination_file"), ScreenshotDestinations.FileDefault, (conf.Output_Destinations & ScreenshotDestinations.FileDefault) == ScreenshotDestinations.FileDefault); sel.AddItem(lang.GetString("settings_destination_fileas"), ScreenshotDestinations.FileWithDialog, (conf.Output_Destinations & ScreenshotDestinations.FileWithDialog) == ScreenshotDestinations.FileWithDialog); sel.AddItem(lang.GetString("settings_destination_printer"), ScreenshotDestinations.Printer, (conf.Output_Destinations & ScreenshotDestinations.Printer) == ScreenshotDestinations.Printer); sel.CheckedChanged += new EventHandler(this.QuickSettingItemChanged); this.contextmenu_quicksettings.DropDownItems.Add(sel); // print options sel = new ToolStripMenuSelectList("printoptions", true); sel.Text = lang.GetString("settings_printoptions"); sel.AddItem(lang.GetString("printoptions_allowshrink"), "AllowPrintShrink", (bool)conf.Output_Print_AllowShrink); sel.AddItem(lang.GetString("printoptions_allowenlarge"), "AllowPrintEnlarge", (bool)conf.Output_Print_AllowEnlarge); sel.AddItem(lang.GetString("printoptions_allowrotate"), "AllowPrintRotate", (bool)conf.Output_Print_AllowRotate); sel.AddItem(lang.GetString("printoptions_allowcenter"), "AllowPrintCenter", (bool)conf.Output_Print_Center); sel.CheckedChanged += new EventHandler(this.QuickSettingItemChanged); this.contextmenu_quicksettings.DropDownItems.Add(sel); // effects sel = new ToolStripMenuSelectList("effects", true); sel.Text = lang.GetString("settings_visualization"); sel.AddItem(lang.GetString("settings_playsound"), "PlaySound", (bool)conf.Ui_Effects_CameraSound); sel.AddItem(lang.GetString("settings_showflashlight"), "ShowFlashlight", (bool)conf.Ui_Effects_Flashlight); sel.CheckedChanged += new EventHandler(this.QuickSettingItemChanged); this.contextmenu_quicksettings.DropDownItems.Add(sel); }
private void InitializeQuickSettingsMenu() { this.contextmenu_quicksettings.DropDownItems.Clear(); // screenshot destination ToolStripMenuSelectList selectList = new ToolStripMenuSelectList("destinations", true); selectList.Text = Language.GetString(LangKey.settings_destination); // Working with IDestination: foreach (IDestination destination in DestinationHelper.GetAllDestinations()) { selectList.AddItem(destination.Description, destination, conf.OutputDestinations.Contains(destination.Designation)); } selectList.CheckedChanged += new EventHandler(this.QuickSettingDestinationChanged); this.contextmenu_quicksettings.DropDownItems.Add(selectList); // Capture Modes selectList = new ToolStripMenuSelectList("capturemodes", false); selectList.Text = Language.GetString(LangKey.settings_window_capture_mode); string enumTypeName = typeof(WindowCaptureMode).Name; foreach (WindowCaptureMode captureMode in Enum.GetValues(typeof(WindowCaptureMode))) { selectList.AddItem(Language.GetString(enumTypeName + "." + captureMode.ToString()), captureMode, conf.WindowCaptureMode == captureMode); } selectList.CheckedChanged += new EventHandler(this.QuickSettingCaptureModeChanged); this.contextmenu_quicksettings.DropDownItems.Add(selectList); // print options selectList = new ToolStripMenuSelectList("printoptions", true); selectList.Text = Language.GetString(LangKey.settings_printoptions); IniValue iniValue; foreach (string propertyName in conf.Values.Keys) { if (propertyName.StartsWith("OutputPrint")) { iniValue = conf.Values[propertyName]; if (iniValue.Attributes.LanguageKey != null) { selectList.AddItem(Language.GetString(iniValue.Attributes.LanguageKey), iniValue, (bool)iniValue.Value); } } } selectList.CheckedChanged += new EventHandler(this.QuickSettingBoolItemChanged); this.contextmenu_quicksettings.DropDownItems.Add(selectList); // effects selectList = new ToolStripMenuSelectList("effects", true); selectList.Text = Language.GetString(LangKey.settings_visualization); iniValue = conf.Values["PlayCameraSound"]; selectList.AddItem(Language.GetString(iniValue.Attributes.LanguageKey), iniValue, (bool)iniValue.Value); iniValue = conf.Values["ShowTrayNotification"]; selectList.AddItem(Language.GetString(iniValue.Attributes.LanguageKey), iniValue, (bool)iniValue.Value); selectList.CheckedChanged += new EventHandler(this.QuickSettingBoolItemChanged); this.contextmenu_quicksettings.DropDownItems.Add(selectList); }
void QuickSettingItemChanged(object sender, EventArgs e) { ToolStripMenuSelectList selectList = (ToolStripMenuSelectList)sender; ToolStripMenuSelectListItem item = ((ItemCheckedChangedEventArgs)e).Item;; if (selectList.Identifier.Equals("destination")) { IEnumerator en = selectList.DropDownItems.GetEnumerator(); ScreenshotDestinations dest = 0; while (en.MoveNext()) { ToolStripMenuSelectListItem i = (ToolStripMenuSelectListItem)en.Current; if (i.Checked) { dest |= (ScreenshotDestinations)i.Data; } } conf.Output_Destinations = dest; conf.Store(); } else if (selectList.Identifier.Equals("printoptions")) { if (item.Data.Equals("AllowPrintShrink")) { conf.Output_Print_AllowShrink = (bool?)item.Checked; } else if (item.Data.Equals("AllowPrintEnlarge")) { conf.Output_Print_AllowEnlarge = (bool?)item.Checked; } else if (item.Data.Equals("AllowPrintRotate")) { conf.Output_Print_AllowRotate = (bool?)item.Checked; } else if (item.Data.Equals("AllowPrintCenter")) { conf.Output_Print_Center = (bool?)item.Checked; } conf.Store(); } else if (selectList.Identifier.Equals("effects")) { if (item.Data.Equals("PlaySound")) { conf.Ui_Effects_CameraSound = (bool?)item.Checked; } else if (item.Data.Equals("ShowFlashlight")) { conf.Ui_Effects_Flashlight = (bool?)item.Checked; } conf.Store(); } }
void QuickSettingItemChanged(object sender, EventArgs e) { ToolStripMenuSelectList selectList = (ToolStripMenuSelectList)sender; ToolStripMenuSelectListItem item = ((ItemCheckedChangedEventArgs)e).Item; if (selectList.Identifier.Equals("destination")) { Destination selectedDestination = (Destination)item.Data; if (item.Checked && !conf.OutputDestinations.Contains(selectedDestination)) { conf.OutputDestinations.Add(selectedDestination); } if (!item.Checked && conf.OutputDestinations.Contains(selectedDestination)) { conf.OutputDestinations.Remove(selectedDestination); } IniConfig.Save(); } else if (selectList.Identifier.Equals("printoptions")) { if (item.Data.Equals("AllowPrintShrink")) { conf.OutputPrintAllowShrink = item.Checked; } else if (item.Data.Equals("AllowPrintEnlarge")) { conf.OutputPrintAllowEnlarge = item.Checked; } else if (item.Data.Equals("AllowPrintRotate")) { conf.OutputPrintAllowRotate = item.Checked; } else if (item.Data.Equals("AllowPrintCenter")) { conf.OutputPrintCenter = item.Checked; } IniConfig.Save(); } else if (selectList.Identifier.Equals("effects")) { if (item.Data.Equals("PlaySound")) { conf.PlayCameraSound = item.Checked; } IniConfig.Save(); } }