示例#1
0
        private new void Refresh()
        {
            listView1.View = View.List;
            listView1.Clear();
            CustomGrouping cg = new CustomGrouping(new MessageQueue());

            foreach (KeyValuePair <string, Tuple <string, string> > group in cg)
            {
                try
                {
                    listView1.Items.Add(new ListViewItem()
                    {
                        Name = group.Key, Text = group.Value.Item1
                    });
                }
                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 { }
        }
示例#2
0
 private void simpleButton2_Click(object sender, EventArgs e)
 {
     System.Windows.Forms.DialogResult result = DevExpress.XtraEditors.XtraMessageBox.Show(Translations.TranslationGet("STR_DEFINEGROUPREMOVENOTICCE", "DE", "Are you sure you want to remove grouping:") + " " + listView1.SelectedItems[0].Text + "?", "WOT Statistics", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
     // Confirm user wants to delete
     if (result == System.Windows.Forms.DialogResult.Yes)
     {
         CustomGrouping cg = new CustomGrouping(new MessageQueue());
         cg.Remove(listView1.SelectedItems[0].Name);
         listView1.SelectedItems[0].Remove();
         Refresh();
     }
 }
示例#3
0
 public CustomGroupings(MessageQueue message, string groupName)
 {
     InitializeComponent();
     _message         = message;
     _tDescription    = new TankDescriptions(_message);
     _cDescription    = new CountryDescriptions(_message);
     _typeDescription = new TankTypeDescription(_message);
     _customGrouping  = new CustomGrouping(_message);
     _ID = groupName.Replace(" ", "_");
     txtGroupName.Text = _customGrouping.Description(_ID);
     ListViewSettings();
 }
示例#4
0
 private void BuildCustomGrouping(string playerName)
 {
     CustomGrouping cg = new CustomGrouping(_message);
     WriteHTMLDocument("CustomGroupings", playerName, cg, null);
 }
示例#5
0
        private void WriteHTMLDocument(string pageName, string playerName, CustomGrouping customGrouping, Tank tank)
        {
            WOTCompare wotCompare;

            _currentStatsFile.TryGetValue(playerName.Replace("_", "*"), out wotCompare);
            if (wotCompare != null)
            {

                if (pageName == "Global")
                {
                    _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("Global", wotCompare.WOTCurrent, wotCompare.WOTPrevious, wotCompare.Delta);
                }
                else
                    if (pageName == "Tanks")
                    {
                        _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("Tanks", wotCompare.WOTCurrent, wotCompare.WOTPrevious, wotCompare.Delta);
                    }
                    else
                        if (pageName == "KillCounts") //add new stats for tab
                        {
                            _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("KillCounts", wotCompare.WOTCurrent, wotCompare.WOTPrevious, wotCompare.Delta);
                        }
                        else
                            if (pageName == "CustomGroupings") //add new stats for tab
                            {
                                _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("CustomGroupings", customGrouping, wotCompare.WOTCurrent, wotCompare.WOTPrevious, wotCompare.Delta);
                            }
                            else
                                if (pageName == "KillSummary") //add new stats for tab
                                {
                                    _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("KillSummary", wotCompare.WOTCurrent, wotCompare.WOTPrevious, wotCompare.Delta);
                                }
                                else
                                    if (pageName == "LastPlayedTanks") //add new stats for tab
                                    {
                                        _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("LastPlayedTanks", playerName);
                                        if (_browser.DocumentText.StartsWith("<HTML></HTML>"))
                                            _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("LastPlayedTanks", playerName);

                                    }
                                    else
                                        if (pageName == "TankInfo")
                                        {
                                            _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("TankInfo", tank);
                                        }
                                        else
                                            if (pageName == "Achievements")
                                            {
                                                _browser.DocumentText = new WOTHtml(_message).GetGlobalHTML("Achievements", wotCompare.WOTCurrent, wotCompare.WOTPrevious, wotCompare.Delta);
                                            }
            }
        }