コード例 #1
0
ファイル: FormLogOn.cs プロジェクト: ChemBrain/OpenDental
 ///<summary>Set userNumSelected to automatically select the corresponding user in the list (if available).
 ///Set isSimpleSwitch true if temporarily switching users for some reason.  This will leave Security.CurUser alone and will instead
 ///indicate which user was chosen / successfully logged in via CurUserSimpleSwitch.</summary>
 public FormLogOn(long userNumSelected = 0, bool isSimpleSwitch = false, bool doRefreshSecurityCache = true)
 {
     InitializeComponent();
     Plugins.HookAddCode(this, "FormLogOn.InitializeComponent_end");
     Lan.F(this);
     if (userNumSelected > 0)
     {
         _userNameAutoSelect = Userods.GetUserNameNoCache(userNumSelected);
     }
     else if (Security.CurUser != null)
     {
         _userNameAutoSelect = Security.CurUser.UserName;
     }
     _isSimpleSwitch         = isSimpleSwitch;
     _doRefreshSecurityCache = doRefreshSecurityCache;
     if (!isSimpleSwitch)             //Not a temporary login.
     {
         try {
             //Use office default theme after we have the database data and until the user logs in below (the user may have a them override set).
             ODColorTheme.SetTheme((OdTheme)PrefC.GetInt(PrefName.ColorTheme));
         }
         catch {
             //try/catch in case you are trying to convert from an older version of OD and need to update the DB.
         }
     }
 }