コード例 #1
0
ファイル: GroupQuery.cs プロジェクト: swaros/projector
        //########################
        private void iterateOverProfiles(bool singleFire)
        {
            toolStripButton1.Enabled = false;
            richTextBox1.Enabled     = false;
            MainView.Controls.Clear();
            sqlProgress.Visible = true;
            listViewExports     = new List <ListView>();
            listLabelExports    = new List <string>();

            sqlProgress.Maximum = databasesListView.Items.Count;

            runningMaxEvents     = 0;
            runningCurrentEvents = 0;
            for (int i = 0; i < databasesListView.Items.Count; i++)
            {
                if (databasesListView.Items[i].Checked)
                {
                    currentProfileName = databasesListView.Items[i].Text;
                    profil.changeProfil(databasesListView.Items[i].Text);

                    toolStrip1.Refresh();
                    statusLabel.Text = "Running SQL @ " + currentProfileName + "  " + i + " / " + (databasesListView.Items.Count - 1);


                    //fireSql(profil, richTextBox1.Text);
                    if (runAsync.Checked)
                    {
                        fireAsyncQuery(profil, richTextBox1.Text, singleFire);
                    }
                    else
                    {
                        sqlProgress.Value = i + 1;
                        Application.DoEvents();
                        fireSql(profil, richTextBox1.Text);
                    }
                }
            }
            statusLabel.Text = "Idle";
            if (!runAsync.Checked)
            {
                sqlProgress.Visible      = false;
                toolStripButton1.Enabled = true;
                richTextBox1.Enabled     = true;
            }

            /*
             * if (lvExporter != null)
             * {
             *  lvExporter.GenerateDynamicExcelSheet();
             *  lvExporter = null;
             * }
             */
        }
コード例 #2
0
ファイル: ProfilGroup.cs プロジェクト: swaros/projector
        private void selectExistsTables()
        {
            Profil    dbProf  = new Profil();
            ColorCalc cCalc   = new ColorCalc();
            string    groupId = groupName.Text;

            if (this.currentGroups.Contains(groupId))
            {
                groupName.ForeColor = Color.DarkGreen;
                groupName.BackColor = Color.LightSeaGreen;
                List <string> members = Config.getListWidthDefault(PConfig.KEY_GROUPS_MEMBERS + "." + groupId, new List <string>());

                for (int i = 0; i < this.GroupedDatabases.Items.Count; i++)
                {
                    this.GroupedDatabases.Items[i].Checked = (members.Contains(this.GroupedDatabases.Items[i].Text));

                    dbProf.changeProfil(this.GroupedDatabases.Items[i].Text);
                    if (dbProf.getProperty("set_bgcolor") != null && dbProf.getProperty("set_bgcolor").Length > 2)
                    {
                        Color rowCol = Color.FromArgb(int.Parse(dbProf.getProperty("set_bgcolor")));
                        cCalc.setBaseColor(rowCol);
                        this.GroupedDatabases.Items[i].BackColor = cCalc.LightenBy(50);
                        this.GroupedDatabases.Items[i].ForeColor = cCalc.DarkenBy(50);
                    }
                }
                manipulateBtn.Image      = Projector.Properties.Resources.delete_16;
                GroupedDatabases.Enabled = true;
            }
            else
            {
                groupName.ForeColor = Color.DarkRed;
                groupName.BackColor = Color.LightYellow;
                manipulateBtn.Image = Projector.Properties.Resources.add16;
                for (int i = 0; i < this.GroupedDatabases.Items.Count; i++)
                {
                    this.GroupedDatabases.Items[i].Checked = false;
                }
                GroupedDatabases.Enabled = false;
            }
        }