ISettingsChange Method (SettingsKey, String) |
Namespace: AskiaPortalCmn.Common
Add or update AskiaPortal settings.
var context = ContextFactory.CreateByLoginAndPassword("username", "secret"); var contextValidation = context.Validate(); if (!contextValidation.Success) { Console.Error.Write(contextValidation.Exception.Message); return; } var user = context.User; var userSettings = user.Settings; var changeResult = userSettings.Change(SettingsKey.AllowConcurrentSessions, true.ToString()); if (changeResult.Success) { Console.WriteLine("User settings `AllowConcurrentSessions` successfully changed."); } else { Console.Error.WriteLine(changeResult.Exception.Message); } // To complete the action save the settings var saveResult = userSettings.Save(); if (saveResult.Success) { Console.WriteLine("User settings successfully saved!"); } else { Console.WriteLine(saveResult.Exception.Message); }