コード例 #1
0
 private void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs e){
     var windowsCredentialStorage = e.SettingsStorage as EncryptedSettingsStorage;
     if (windowsCredentialStorage != null){
         ObjectSerializer.WriteObjectPropertyValues(e.DetailView, e.SettingsStorage, e.LogonObject);
         var contents = windowsCredentialStorage.GetContent();
         File.WriteAllBytes(Path.Combine(_logonParametersFilePath, "LogonParameters.bin"), contents);
     }
 }
コード例 #2
0
        private void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs e)
        {
            var windowsCredentialStorage = e.SettingsStorage as EncryptedSettingsStorage;

            if (windowsCredentialStorage != null)
            {
                ObjectSerializer.WriteObjectPropertyValues(e.DetailView, e.SettingsStorage, e.LogonObject);
                var contents = windowsCredentialStorage.GetContent();
                File.WriteAllBytes(Path.Combine(_logonParametersFilePath, "LogonParameters.bin"), contents);
            }
        }
コード例 #3
0
 private void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs e)
 {
     if (((IModelOptionsAuthentication)Application.Model.Options).Athentication.AutoAthentication.Enabled)
     {
         if (e.SettingsStorage is EncryptedSettingsStorage windowsCredentialStorage)
         {
             var path = Path.Combine(_logonParametersFilePath, LogonParametersFile);
             if (((XpandLogonParameters)e.LogonObject).RememberMe)
             {
                 ObjectSerializer.WriteObjectPropertyValues(e.DetailView, e.SettingsStorage, e.LogonObject);
                 var contents = windowsCredentialStorage.GetContent();
                 File.WriteAllBytes(path, contents);
             }
             else
             {
                 File.Delete(path);
             }
         }
     }
 }
コード例 #4
0
ファイル: Authentication.cs プロジェクト: paulute/eXpand
 void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs lastLogonParametersWritingEventArgs) {
     ((WebApplication) sender).LastLogonParametersWriting-=ApplicationOnLastLogonParametersWriting;
     lastLogonParametersWritingEventArgs.Handled = lastLogonParametersWritingEventArgs.SettingsStorage is SettingsStorageOnCookies;
 }
コード例 #5
0
 void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs lastLogonParametersWritingEventArgs)
 {
     ((WebApplication)sender).LastLogonParametersWriting -= ApplicationOnLastLogonParametersWriting;
     lastLogonParametersWritingEventArgs.Handled          = lastLogonParametersWritingEventArgs.SettingsStorage is SettingsStorageOnCookies;
 }
コード例 #6
0
ファイル: WinApplication.cs プロジェクト: Rukhlov/DataStudio
 private void Application_LastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs e)
 {
     CustomLogonParameters parameters = e.LogonObject as CustomLogonParameters;
     if (parameters != null)
     {
         Employee lastEmployee = parameters.Employee;
         if (lastEmployee != null)
         {// записываем вы конфиг id последнего входившего пользователя
             e.SettingsStorage.SaveOption("", "Employee", lastEmployee.Oid.ToString());
             e.Handled = true;
         }
     }
 }