private new void Refresh() { listView1.View = View.List; listView1.Clear(); GraphsSettings cg = new GraphsSettings(new MessageQueue()); foreach (KeyValuePair <string, GraphFields> group in cg) { try { listView1.Items.Add(new ListViewItem() { Name = group.Key, Text = group.Value.Caption }); } catch { } } BTN_EDIT.Enabled = (listView1.Items.Count > 0) && (listView1.SelectedItems.Count > 0); BTN_REMOVE.Enabled = (listView1.Items.Count > 0) && (listView1.SelectedItems.Count > 0); //try //{ // listView1.Items[0].Selected = true; //} //catch { } }
private void butSave_Click(object sender, EventArgs e) { if (textName.Text != "" && comboDataField.Text != "") { if (radioGroup1.EditValue.ToString() == "Tanks" && listTanks.CheckedItems.Count == 0) { DevExpress.XtraEditors.XtraMessageBox.Show(Translations.TranslationGet("STR_CHARTTANKSAVENOTICE", "DE", "Please select tank/s to be displayed in the chart."), "WOT Statistics", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (_ID == "") { _ID = Guid.NewGuid().ToString(); } GraphsSettings gs = new GraphsSettings(_message); GraphFields gf = new GraphFields() { Caption = textName.Text, Type = "Line", DataField = comboDataField.Text, Name = _ID, StatsBase = radioGroup1.EditValue.ToString(), InnerText = CreateInnerText(), Period = int.Parse(radioGroupPeriod.EditValue.ToString()) }; gs.Save(gf); Close(); } } else { DevExpress.XtraEditors.XtraMessageBox.Show(Translations.TranslationGet("STR_CHARTFIELDSSAVENOTICE", "DE", "Please complete all fields."), "WOT Statistics", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void simpleButton2_Click(object sender, EventArgs e) { System.Windows.Forms.DialogResult result = DevExpress.XtraEditors.XtraMessageBox.Show(Translations.TranslationGet("", "DE", "Are you sure you want to remove chart:") + " " + listView1.SelectedItems[0].Text + "?", "WOT Statistics", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // Confirm user wants to delete if (result == System.Windows.Forms.DialogResult.Yes) { GraphsSettings cg = new GraphsSettings(new MessageQueue()); cg.Remove(listView1.SelectedItems[0].Name); listView1.SelectedItems[0].Remove(); //listView1.Items.Remove(listView1.SelectedIndices[0]); Refresh(); } }
public GraphSetup(MessageQueue message, string graphID) { InitializeComponent(); _message = message; _ID = graphID; //textName.Text = graphName; //textName.Enabled = false; _tDescription = new TankDescriptions(_message); _cDescription = new CountryDescriptions(_message); _typeDescription = new TankTypeDescription(_message); _graphSettings = new GraphsSettings(_message); ListViewSettings(); LoadSettings(); }
public GraphSetup(MessageQueue message) { InitializeComponent(); _message = message; _tDescription = new TankDescriptions(_message); _cDescription = new CountryDescriptions(_message); _typeDescription = new TankTypeDescription(_message); _graphSettings = new GraphsSettings(_message); helpProvider1.HelpNamespace = Path.Combine(WOTHelper.GetEXEPath(), "Help", "WoT_Stats.chm"); helpProvider1.SetHelpNavigator(this, HelpNavigator.TopicId); helpProvider1.SetHelpKeyword(this, "520"); ListViewSettings(); LoadSettings(); }
private void LoadSettings() { GraphsSettings gs = new GraphsSettings(_message); GraphFields gf = gs.FieldValues(_ID); textName.Text = gf.Caption; radioGroup1.EditValue = gf.StatsBase; if (gf.StatsBase == "Tanks") { Width = 684; Location = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - Width / 2, Screen.PrimaryScreen.WorkingArea.Height / 2 - Height / 2); } radioGroupPeriod.EditValue = gf.Period.ToString(); comboDataField.Text = gf.DataField; }
private new void Refresh() { listView1.View = View.List; listView1.Clear(); GraphsSettings cg = new GraphsSettings(new MessageQueue()); foreach (KeyValuePair<string, GraphFields> group in cg) { try { listView1.Items.Add(new ListViewItem() { Name = group.Key, Text = group.Value.Caption}); } catch { } } BTN_EDIT.Enabled = (listView1.Items.Count > 0) && (listView1.SelectedItems.Count > 0); BTN_REMOVE.Enabled = (listView1.Items.Count > 0) && (listView1.SelectedItems.Count > 0); //try //{ // listView1.Items[0].Selected = true; //} //catch { } }
public static void GetChartData(string playerName, string chartID, string statsBase, ChartControl chartControl) { chartControl.ClearCache(); chartControl.AppearanceNameSerializable = UserSettings.ChartAppearance; chartControl.PaletteName = UserSettings.ChartPalette; GraphFields gf = new GraphsSettings(new MessageQueue()).FieldValues(chartID); string newChart = chartID + gf.Caption + gf.DataField + gf.InnerText + gf.Name + gf.Period + gf.StatsBase + gf.Type + playerName + UserSettings.BattleMode; if (_currentChart != newChart) { _currentChart = chartID + gf.Caption + gf.DataField + gf.InnerText + gf.Name + gf.Period + gf.StatsBase + gf.Type + playerName; if (statsBase == "Overall") { OverallChart(playerName, chartID, gf, chartControl); } else { TankChart(playerName, chartID, gf, chartControl); } } }
private void butSave_Click(object sender, EventArgs e) { if (textName.Text != "" && comboDataField.Text != "") { if (radioGroup1.EditValue.ToString() == "Tanks" && listTanks.CheckedItems.Count == 0) { DevExpress.XtraEditors.XtraMessageBox.Show(Translations.TranslationGet("STR_CHARTTANKSAVENOTICE", "DE", "Please select tank/s to be displayed in the chart."), "WOT Statistics", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (_ID == "") _ID = Guid.NewGuid().ToString(); GraphsSettings gs = new GraphsSettings(_message); GraphFields gf = new GraphFields() { Caption = textName.Text, Type = "Line", DataField = comboDataField.Text, Name = _ID, StatsBase = radioGroup1.EditValue.ToString(), InnerText = CreateInnerText(), Period = int.Parse(radioGroupPeriod.EditValue.ToString()) }; gs.Save(gf); Close(); } } else { DevExpress.XtraEditors.XtraMessageBox.Show(Translations.TranslationGet("STR_CHARTFIELDSSAVENOTICE", "DE", "Please complete all fields."), "WOT Statistics", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void BuildGraphForm(string playerName) { _chart.AppearanceNameSerializable = "Dark"; navBarCharts.Items.Clear(); navBarCharts.Groups.Clear(); GraphsSettings gs = new GraphsSettings(_message); NavBarGroup group = null; NavBarItem groupItem = null; foreach (KeyValuePair<string, GraphFields> graph in gs.OrderBy(x => x.Value.StatsBase)) { if (group == null) { group = new NavBarGroup(graph.Value.StatsBase); group.Name = "graph_" + graph.Value.StatsBase; navBarCharts.Groups.Add(group); } if (group.Name != "graph_" + graph.Value.StatsBase) { group = new NavBarGroup(graph.Value.StatsBase); group.Name = "graph_" + graph.Value.StatsBase; navBarCharts.Groups.Add(group); groupItem = new NavBarItem(graph.Value.Caption); groupItem.Name = graph.Key; group.ItemLinks.Add(groupItem); } else { groupItem = new NavBarItem(graph.Value.Caption); groupItem.Name = graph.Key; group.ItemLinks.Add(groupItem); } groupItem.LinkClicked += GraphItem_LinkClicked; } NavBarGroup activeGroup; if (_currentChartGroup == null) activeGroup = navBarCharts.ActiveGroup; else activeGroup = navBarCharts.Groups[_currentChartGroup]; try { bool found = false; activeGroup.Expanded = true; foreach (NavBarItemLink item in activeGroup.ItemLinks) { if (item.ItemName == _currentSelectedChart) { item.PerformClick(); activeGroup.SelectedLink = item; found = true; break; } } if (!found) { activeGroup.ItemLinks[0].PerformClick(); activeGroup.SelectedLink = activeGroup.ItemLinks[0]; } } catch { try { if (splashScreenManagerWaitForm.IsSplashFormVisible) { splashScreenManagerWaitForm.CloseWaitForm(); } } catch { } finally { _chart.Series.Clear(); _chart.Titles.Clear(); ; } } }