Ejemplo n.º 1
0
        private void columnsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveDo(() =>
            {
                var shownRawColumns             = _settings.ActiveColumnSet.Columns;
                Dialogs.ChooseColumnsDialog ccd =
                    new Dialogs.ChooseColumnsDialog(
                        CalculatorFactory.GetAllCalulators().Except(shownRawColumns).Select(calc => CalculatorToTaggedObject(calc)),
                        shownRawColumns.Select(calc => CalculatorToTaggedObject(calc)),
                        _settings.ActiveColumnSet.Name);
                ccd.Translate(_translator);
                if (ccd.ShowDialog() == DialogResult.OK)
                {
                    IList <IPlayerStatisticCalculator <IEnumerable <MatchAppearance> > > myList = GetCalculatorsListFromDialog(ccd);
                    _settings.ActiveColumnSet.Name    = ccd.MyName;
                    _settings.ActiveColumnSet.Columns = myList;
                    _settings.ColumnSets      = _settings.ColumnSets;      // TODO: force save another way
                    _settings.ActiveColumnSet = _settings.ActiveColumnSet; // TODO: force save another way

                    RefreshColumnSetComboBox();

                    SetColumns(_settings.ActiveColumnSet);
                }
            });
        }
Ejemplo n.º 2
0
        private void CreateNewColumnSet()
        {
            SaveDo(() =>
            {
                Dialogs.ChooseColumnsDialog ccd = new Dialogs.ChooseColumnsDialog(
                    CalculatorFactory.GetAllCalulators().Select(calc => CalculatorToTaggedObject(calc)),
                    null,
                    String.Format("Custom set #{0}", comboBoxColumnSets.Items.Count + 1));
                ccd.Translate(_translator);
                if (ccd.ShowDialog() == DialogResult.OK)
                {
                    IList <IPlayerStatisticCalculator <IEnumerable <MatchAppearance> > > myList = GetCalculatorsListFromDialog(ccd);

                    ColumnSet set = new ColumnSet(ccd.MyName, myList);
                    _settings.ColumnSets.Add(set);
                    _settings.ActiveColumnSet = set;

                    RefreshColumnSetComboBox();

                    SetColumns(_settings.ActiveColumnSet);
                }
            });
        }