Ejemplo n.º 1
0
        public void FillComboBox(MetroToolbarDropDownButton PrefList)
        {
            // For design mode
            if (GlobalInfo.SqlConnection == null)
            {
                return;
            }

            PrefList.Items.Clear();

            RRReadAllPreference DRRead = new RRReadAllPreference();

            if (DRRead.Find(PrefType, ComputerName, UserName, ApplicationName))
            {
                for (int t = 0; t < DRRead.Count; t++)
                {
                    string computer    = DRRead.GetValue <string>(EF_Preferences.Computer, t);
                    string user        = DRRead.GetValue <string>(EF_Preferences.Username, t);
                    string application = DRRead.GetValue <string>(EF_Preferences.Application, t);

                    MyToolStripItem tsi = new MyToolStripItem(computer, user, application);
                    PrefList.AddDropDownItem(tsi);
                }
            }
        }
Ejemplo n.º 2
0
 public T ReadPreference(MyToolStripItem tsi)
 {
     currentToolStripItem = tsi;
     currentToolStripItem.CreateText();
     UpdateToolbarButton(tsi);
     return(ReadPreference(tsi.Computer, tsi.User, tsi.Application));
 }
 protected override void OnFindData(MyToolStripItem tsi)
 {
     Preferences = Preference.ReadPreference(tsi);
     AttachData(Preferences);
     OnPrepareAuxData();
     Validate();
 }
Ejemplo n.º 4
0
 private void UpdateToolbarButton(MyToolStripItem tsi)
 {
     ButtonComputer.Checked    = tsi.HasComputer;
     ButtonUser.Checked        = tsi.HasUser;
     ButtonApplication.Checked = tsi.HasApplication;
 }
Ejemplo n.º 5
0
 public void Clear()
 {
     currentToolStripItem = new MyToolStripItem();
     UpdateToolbarButton(currentToolStripItem);
 }
Ejemplo n.º 6
0
 protected virtual void OnFindData(MyToolStripItem tsi)
 {
 }