Exemplo n.º 1
0
 private void ShowHide()
 {
     foreach (Control cb in tlPanel.Controls)
     {
         cb.Visible = FRParser.DefaultDBSect(cb.Text) || cbAll.Checked;
     }
 }
Exemplo n.º 2
0
 public EditDBForm(FRParser afrp)
 {
     InitializeComponent();
     frp = afrp;
     Init();
     FillDbContextMenu();
 }
Exemplo n.º 3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            FRParser   frp = new FRParser();
            EditDBForm f   = new EditDBForm(frp);

            if (f.ShowDialog() == DialogResult.OK)
            {
                frp.doc.Save(FRParser.GetFRConfPathName());
            }
        }
Exemplo n.º 4
0
        private void btnDodaj_Click(object sender, EventArgs e)
        {
            Trace.Assert(File.Exists(edtOpen.Text), "Brak wkazanego pliku Ini.");
            Trace.Assert(!edtGroupName.Enabled || edtGroupName.Text != "", "Pusta nazwa grupy.");
            FRParser frp = new FRParser();
            Dictionary <string, DBHeaderObj> dictDBHeaders = frp.GetBiuSectChooseDict(edtOpen.Text);

            //Formatka wyboru baz do dodania
            ChooseForm f = new ChooseForm(dictDBHeaders);

            if (f.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            //server + dataBase
            XmlNode srvNode;
            DBNode  dbNode;

            foreach (KeyValuePair <string, DBHeaderObj> pair in dictDBHeaders)
            {
                if (pair.Value.blSelect)
                {
                    dbNode = frp.GetDBFromSection(pair.Value.stSection, pair.Value.stFile, frp.NextDBId());
                    if (cbDodGrupe.Checked)
                    {
                        srvNode = frp.ServerNode(dbNode.server.ToUpper() + "_" + edtGroupName.Text, dbNode.server);
                    }
                    else
                    {
                        srvNode = frp.ServerNode(dbNode.server.ToUpper(), dbNode.server);
                    }
                    //jeśli w node serwera jest już baza danych o daneej path, to nie tworzymy duplikatu
                    if (frp.GetDBNodeByName(dbNode.path, srvNode) == null)
                    {
                        frp.AddDBNode(srvNode, dbNode);
                    }
                }
            }
            frp.doc.Save(FRParser.GetFRConfPathName());
        }
Exemplo n.º 5
0
        public ChooseForm(Dictionary <string, DBHeaderObj> adictChoosen)
        {
            InitializeComponent();
            choosen = adictChoosen;
            CheckBox cb = null;

            tlPanel.RowCount = (int)Math.Ceiling(adictChoosen.Count / 2.0);
            tlPanel.RowStyles.Clear();
            //Wypełniam w 2 przebiegach, aby wpierw sosać bazy podstawowe, a dopiero potem te, które są ukrywane (nadzorca jest wyjątkiem)
            foreach (KeyValuePair <string, DBHeaderObj> pair in adictChoosen)
            {
                if (FRParser.SystemDB(pair.Key))
                {
                    cb                 = new CheckBox();
                    cb.Text            = pair.Key;
                    cb.Checked         = pair.Value.blSelect;
                    cb.Dock            = DockStyle.Top;
                    cb.CheckedChanged += CBCheckChange;
                    tlPanel.Controls.Add(cb);
                    tlPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 23));
                }
            }

            foreach (KeyValuePair <string, DBHeaderObj> pair in adictChoosen)
            {
                if (!FRParser.SystemDB(pair.Key))
                {
                    cb                 = new CheckBox();
                    cb.Text            = pair.Key;
                    cb.Checked         = pair.Value.blSelect;
                    cb.Dock            = DockStyle.Top;
                    cb.CheckedChanged += CBCheckChange;
                    tlPanel.Controls.Add(cb);
                    tlPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 23));
                }
            }
            Height = pnlButtons.Height + ((25 + 6) * tlPanel.RowCount);
            ShowHide();
        }