コード例 #1
0
        private void toolStripButtonEdit_Click(object sender, EventArgs e)
        {
            int ret = Errors.SUCCESS;

            log.Debug("-- toolStripButtonEdit_Click()");
            this.actionBeforeStartDisableAllActions();
            log.Debug("lpa: " + ProfileManagerBusinessLayer.listProfileViewToString(this.lpa));
            log.Debug("lpd: " + ProfileManagerBusinessLayer.listProfileViewToString(this.lpd));
            ProfileViewData   pvd     = getSelected(this.lpa, this.lpd);
            ProfileViewData   newProf = new ProfileViewData();
            FormProfileEditor editor  = new FormProfileEditor();

            editor.ShowDialog();
            if (!editor.wasCancelled())
            {
                newProf.name  = editor.getName();
                newProf.color = editor.getColor();
                if (pvd != null)
                {
                    string errMsg = "";
                    ret = this.managerBusinessLayer.action_updateProfile(newProf, pvd, out errMsg);
                    this.analyzeReturn(ret, errMsg);
                }
                // * POST ACTION FORM UPDATE
                this.postActionUpdate();
                this.updateToolStripButtons();
            }
            else
            {
                log.Debug("** Edit process was CANCELLED!");
            }
        }
コード例 #2
0
 private void fillDataGrids()
 {
     log.Debug("-- fillDataGrids");
     if (ENABLE_TESTING)
     {
         this.lpd = this.managerBusinessLayer.test_getDesactivated(0);
         this.lpa = this.managerBusinessLayer.test_getActive(0);
     }
     else
     {
         this.managerBusinessLayer.reloadProfiles();
         this.lpd = this.managerBusinessLayer.getDesactivatedProfiles();
         this.lpa = this.managerBusinessLayer.getActiveProfiles();
         log.Debug("fillDataGrids >> lpd:" + ProfileManagerBusinessLayer.listProfileViewToString(this.lpd));
         log.Debug("fillDataGrids >> lpa:" + ProfileManagerBusinessLayer.listProfileViewToString(this.lpa));
     }
     // update allowed actions
     this.bindingSourceActive.DataSource       = this.lpa;
     this.bindingSourceDesactivated.DataSource = this.lpd;
     this.loadDatagrid(ref this.dataGridViewDesactivated, ref this.bindingSourceDesactivated,
                       ref this.panelDesactivatedGrid, ref lpd, this.dataGridViewDesactivated_CellMouseClick);
     this.loadDatagrid(ref this.dataGridViewActive, ref this.bindingSourceActive,
                       ref this.panelActivatedGrid, ref lpa, this.dataGridViewActive_CellMouseClick);
     this.updateToolStripButtons();
 }
コード例 #3
0
        private void toolStripComboBoxSelectGame_SelectedIndexChanged(object sender, EventArgs e)
        {
            log.Debug("-- toolStripComboBoxSelectGame_SelectedIndexChanged");
            log.Info("SELECTED GAME: " + this.toolStripComboBoxSelectGame.Text);
            string selected = this.toolStripComboBoxSelectGame.Text;

            this.managerBusinessLayer = new ProfileManagerBusinessLayer(selected);
        }
コード例 #4
0
        public FormMain()
        {
            log = Log4NetLogger.getInstance(LogAppender.APP_UI, Consts.DIR_SETTINGS);
            log.Debug("###############################################################################");
            log.Debug("# INITIALIZE FormMain");
            log.Debug("###############################################################################");
            this.availableGames = ProfileManagerBusinessLayer.availableGames();
            if (availableGames.Length == 0)
            {
                this.availableGames = new string[] { "*NO GAME DEFINED*" };
            }
            string startGame = this.availableGames[0];

            this.managerBusinessLayer = new ProfileManagerBusinessLayer(startGame);
            InitializeComponent();
            // update game list
            this.updateDropdownGameMenu();
            // enable testing panel
            this.panelTests.Visible = ENABLE_TESTING;
            // select first item as default
            log.Debug("-- select first item as default");
            this.toolStripComboBoxSelectGame.SelectedIndex = 0;
        }