private void toolStripDropDownButton_menu_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { //LogManager.AddLogMessage(Name, "toolStripDropDownButton_menu_DropDownItemClicked", e.GetType() + " | " + e.ClickedItem.GetType(), LogManager.LogMessageType.DEBUG); if (e.ClickedItem.GetType() == typeof(ToolStripMenuItem)) { //if () ToolStripMenuItem menuItem = e.ClickedItem as ToolStripMenuItem; if (!menuItem.Tag.ToString().Contains("Font")) { //LogManager.AddLogMessage(Name, "toolStripDropDownButton_menu_DropDownItemClicked", menuItem.Tag.ToString() + " | " + menuItem.Text, LogManager.LogMessageType.DEBUG); toolStripDropDownButton_menu.HideDropDown(); FormManager.OpenForm(menuItem.Tag.ToString(), menuItem.Text); } else { switch (menuItem.Tag.ToString()) { case "Font": FontDialog dialog = new FontDialog() { Font = ParentForm.Font }; DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { if (PreferenceManager.SetFormFont(ParentForm, dialog.Font)) { UpdateUI(true); } } UpdateUI(true); break; case "FontIncrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size + 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "FontDecrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style))) { UpdateUI(true); } break; default: // NOTHING break; } } } }
private void toolStripDropDownButton_menu_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.GetType() == typeof(ToolStripMenuItem)) { ToolStripMenuItem menuItem = e.ClickedItem as ToolStripMenuItem; //LogManager.AddLogMessage(Name, "toolStripDropDownButton_menu_DropDownItemClicked", menuItem.Tag.ToString() + " | " + menuItem.Text, LogManager.LogMessageType.DEBUG); switch (menuItem.Tag.ToString()) { case "Font": FontDialog dialog = new FontDialog() { Font = ParentForm.Font }; DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { if (PreferenceManager.SetFormFont(ParentForm, dialog.Font)) { UpdateUI(true); } } UpdateUI(true); break; case "FontIncrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size + 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "FontDecrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "CopyAll": StringBuilder s = new StringBuilder(); foreach (LogMessage message in LogManager.MessageList) { s.AppendLine(message.ToString()); } Clipboard.SetText(s.ToString()); break; default: // NOTHING break; } } }
private void toolStripDropDownButton_menu_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.GetType() == typeof(ToolStripMenuItem)) { ToolStripMenuItem menuItem = e.ClickedItem as ToolStripMenuItem; toolStripDropDownButton_menu.HideDropDown(); //LogManager.AddLogMessage(Name, "toolStripDropDownButton_menu_DropDownItemClicked", menuItem.Tag.ToString() + " | " + menuItem.Text, LogManager.LogMessageType.DEBUG); switch (menuItem.Tag.ToString()) { case "Font": FontDialog dialog = new FontDialog() { Font = ParentForm.Font }; DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { if (PreferenceManager.SetFormFont(ParentForm, dialog.Font)) { UpdateUI(true); } } //UpdateUI(true); break; case "FontIncrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size + 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "FontDecrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "ClearData": PreferenceManager.WalletPreferences.WalletForks.Clear(); PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Wallet); UpdateUI(); break; default: // NOTHING break; } } }
private void toolStripDropDownButton_menu_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.GetType() == typeof(ToolStripMenuItem)) { ToolStripMenuItem menuItem = e.ClickedItem as ToolStripMenuItem; //LogManager.AddLogMessage(Name, "toolStripDropDownButton_menu_DropDownItemClicked", menuItem.Tag.ToString() + " | " + menuItem.Text, LogManager.LogMessageType.DEBUG); switch (menuItem.Tag.ToString()) { case "Font": FontDialog dialog = new FontDialog() { Font = ParentForm.Font }; DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { if (PreferenceManager.SetFormFont(ParentForm, dialog.Font)) { UpdateUI(true); } } UpdateUI(true); break; case "FontIncrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size + 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "FontDecrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "AddAccount": Form form = new Form() { Text = "EarnGG Account Editor" }; EarnGGAccountEditorControl control = new EarnGGAccountEditorControl() { Dock = DockStyle.Fill }; form.Controls.Add(control); form.Show(); break; case "Update": UpdateUI(); break; default: // NOTHING break; } } }
private void toolStripDropDownButton_menu_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.GetType() == typeof(ToolStripMenuItem)) { ToolStripMenuItem menuItem = e.ClickedItem as ToolStripMenuItem; //LogManager.AddLogMessage(Name, "toolStripDropDownButton_menu_DropDownItemClicked", menuItem.Tag.ToString() + " | " + menuItem.Text, LogManager.LogMessageType.DEBUG); switch (menuItem.Tag.ToString()) { case "Font": FontDialog dialog = new FontDialog() { Font = ParentForm.Font }; DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { if (PreferenceManager.SetFormFont(ParentForm, dialog.Font)) { UpdateUI(true); } } //UpdateUI(true); break; case "FontIncrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size + 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "FontDecrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "RemoveAll": //ToggleCharts(); PreferenceManager.preferences.SymbolWatchList.Clear(); PreferenceManager.UpdatePreferenceFile(); InitializeSymbolList(); break; case "SortSymbol": sort = "Symbol"; UpdateUI(); break; case "SortValue": sort = "Value"; UpdateUI(); break; default: // NOTHING break; } } }
private void toolStripDropDownButton_options_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { //LogManager.AddLogMessage(Name, "toolStripDropDownButton_options_DropDownItemClicked", e.ClickedItem.Text + " | " + e.ClickedItem.Tag, LogManager.LogMessageType.OTHER); string propertyName = e.ClickedItem.Tag.ToString(); switch (propertyName) { case "hide_top_toolbar": case "withdateranges": case "allow_symbol_change": case "save_image": case "hide_side_toolbar": case "hideideas": case "hideideasbutton": case "enable_publishing": case "ShowWatchlist": case "ShowIndicators": case "details": case "stocktwits": case "headlines": case "hotlist": case "calendar": { Type type = PreferenceManager.TradingViewPreferences.AdvancedChartParameters.GetType(); PropertyInfo prop = type.GetProperty(propertyName); bool value = (bool)(prop.GetValue(PreferenceManager.TradingViewPreferences.AdvancedChartParameters, null)); prop.SetValue(PreferenceManager.TradingViewPreferences.AdvancedChartParameters, !value, null); //LogManager.AddLogMessage(Name, "toolStripDropDownButton_options_DropDownItemClicked", "SWITCH : " + propertyName + " : " + value, LogManager.LogMessageType.OTHER); UpdateOptionsMenu(); PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView); SetFullView(); break; } case "light": case "dark": { //LogManager.AddLogMessage(Name, "toolStripDropDownButton_options_DropDownItemClicked", "LIGHT OR DARK : " + propertyName, LogManager.LogMessageType.OTHER); if (propertyName == "light") { PreferenceManager.TradingViewPreferences.AdvancedChartParameters.theme = TradingViewColorTheme.Light; } else { PreferenceManager.TradingViewPreferences.AdvancedChartParameters.theme = TradingViewColorTheme.Dark; } UpdateOptionsMenu(); PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView); SetFullView(); SetCustomView(); UpdateUI(true); break; } case "Font": FontDialog dialog = new FontDialog() { Font = ParentForm.Font }; DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { if (PreferenceManager.SetFormFont(ParentForm, dialog.Font)) { UpdateUI(true); } } UpdateUI(true); break; case "FontIncrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size + 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "FontDecrease": if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style))) { UpdateUI(true); } break; case "EditOverviewList": LogManager.AddLogMessage(Name, "toolStripDropDownButton_options_DropDownItemClicked", "EDIT OVERVIEWS", LogManager.LogMessageType.OTHER); Form form = new Form() { Text = "Edit TradingView Overviews List", Width = 950, Height = 600 }; TradingViewOverviewsListEditorControl control = new TradingViewOverviewsListEditorControl() { Dock = DockStyle.Fill }; control.tradingViewManagerControl = this; form.Controls.Add(control); PreferenceManager.SetTheme(PreferenceManager.preferences.Theme.type, form); form.Show(); /* * if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style))) * { * UpdateUI(true); * } */ break; default: { LogManager.AddLogMessage(Name, "toolStripDropDownButton_options_DropDownItemClicked", "NOTDEFINED : " + propertyName, LogManager.LogMessageType.OTHER); break; } } }