Exemplo n.º 1
0
        public SqlConnectionSettingsViewPresenter(ISqlConnectionSettingsView view,
                                                  IWindowsIdentityProvider windowsIdentityProvider)
        {
            _view = view;

            _view.AuthMode = SqlAuthMode.Windows;
            _view.UserName = windowsIdentityProvider.CurrentUserName;
            _view.DisableUserNameAndPassword();
            _view.AuthModeChanged += view_AuthModeChanged;
        }
        public SqlConnectionSettingsViewPresenter(ISqlConnectionSettingsView view, 
            IWindowsIdentityProvider windowsIdentityProvider)
        {
            _view = view;

            _view.AuthMode = SqlAuthMode.Windows;
            _view.UserName = windowsIdentityProvider.CurrentUserName;
            _view.DisableUserNameAndPassword();
            _view.AuthModeChanged += view_AuthModeChanged;
        }
Exemplo n.º 3
0
 void view_AuthModeChanged(object sender, EventArgs e)
 {
     if (_view.AuthMode == SqlAuthMode.SqlServer)
     {
         _view.EnableUserNameAndPassword();
     }
     else
     {
         _view.DisableUserNameAndPassword();
     }
 }