Esempio n. 1
0
        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 {            }
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 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();
     }
 }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
        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();
        }
Esempio n. 7
0
        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;
        }
Esempio n. 8
0
        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 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 {            }
        }
Esempio n. 10
0
        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);
                }
            }
        }
Esempio n. 11
0
 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);
     }
 }
Esempio n. 12
0
        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;
        }
Esempio n. 13
0
        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(); ;
                }
            }
        }
Esempio n. 14
0
 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();
     }
 }