コード例 #1
0
        public void OnChangedPassword(object sender, EventArgs e)
        {
            frmSetPassword form = WorkItem.Items.Get <frmSetPassword>(Constants.SetPasswordForm);

            if (form == null)
            {
                form = WorkItem.Items.AddNew <frmSetPassword>(Constants.SetPasswordForm);
            }
            form.UserName = Thread.CurrentPrincipal.Identity.Name; // 获取当前登录的帐户名称
            form.ShowDialog();
        }
コード例 #2
0
 public void OnSetPassword(object sender, EventArgs e)
 {
     if (View.UsersList.Selection.Count > 0)
     {
         frmSetPassword form = WorkItem.Items.Get <frmSetPassword>(Constants.SetPasswordForm);
         if (form == null)
         {
             form = WorkItem.Items.AddNew <frmSetPassword>(Constants.SetPasswordForm);
         }
         form.UserName = View.UsersList.Selection[0].GetDisplayText(0); // 直接获取当前选定帐户的名称
         form.ShowDialog();
     }
 }