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()
 {
     if (RRAllPref.Find(PrefType, GlobalInfo.ComputerInfo.ComputerName, GlobalInfo.UserInfo.User, ApplicationName))
     {
         return(Deserialize(RRAllPref.GetValue <string>(EF_Preferences.Preferences)));
     }
     return(new T());
 }