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); } }
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); } }
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); } } } }
void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs lastLogonParametersWritingEventArgs) { ((WebApplication) sender).LastLogonParametersWriting-=ApplicationOnLastLogonParametersWriting; lastLogonParametersWritingEventArgs.Handled = lastLogonParametersWritingEventArgs.SettingsStorage is SettingsStorageOnCookies; }
void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs lastLogonParametersWritingEventArgs) { ((WebApplication)sender).LastLogonParametersWriting -= ApplicationOnLastLogonParametersWriting; lastLogonParametersWritingEventArgs.Handled = lastLogonParametersWritingEventArgs.SettingsStorage is SettingsStorageOnCookies; }
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; } } }