Esempio n. 1
0
        /// <summary>
        /// Creates the shell agent.
        /// </summary>
        /// <returns></returns>
        private static IShellAgent CreateShellAgent()
        {
            var agt = ShellAgentFactory.CreateAgent(ShellAgentKey);

            agt.OnLoginUserCompleted += (snd, e) => _shellForm.ConfigureForUser(e.Info);
            return(agt);
        }
Esempio n. 2
0
        public SettingItem GetSettings(string accountId, string applicationFunctionId, string roleId, string objectId)
        {
            SettingItem req = new SettingItem()
            {
                ApplicationFunctionId = applicationFunctionId,
                AccountId             = accountId,
                RoleId   = roleId,
                ObjectId = objectId
            };

            return(ShellAgentFactory
                   .CreateAgent()
                   .GetSettings(req));
        }
Esempio n. 3
0
        /// <summary>
        /// Reads the settings.
        /// </summary>
        /// <returns></returns>
        public static void GetSettingsAsync(string accountId, string applicationFunctionId, string roleId, string objectId, Action <SettingItem> onSettingChanged)
        {
            _onSettingChanged = onSettingChanged;
            SettingItem req = new SettingItem()
            {
                ApplicationFunctionId = applicationFunctionId,
                AccountId             = accountId,
                RoleId   = roleId,
                ObjectId = objectId
            };

            ShellAgentFactory
            .CreateAgent()
            .GetSettingsAsync(req, ChangeSetting);
        }
Esempio n. 4
0
 /// <summary>
 /// Saves the settings.
 /// </summary>
 /// <param name="settings">The settings.</param>
 public static void SaveSettings(string accountId, string applicationFunctionId, string roleId, string objectId, XElement settings, Action <SettingItem> onSettingChanged = null)
 {
     _onSettingChanged = onSettingChanged;
     ShellAgentFactory
     .CreateAgent()
     .SaveSettingsAsync(new SettingItem()
     {
         Id                    = Guid.NewGuid().ToString(),
         AccountId             = accountId,
         ApplicationFunctionId = applicationFunctionId,
         RoleId                = roleId,
         ObjectId              = objectId,
         SettingInfo           = settings
     }, ChangeSetting);
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LoginViewModel"/> class.
 /// </summary>
 public LoginViewModel()
 {
     _shellAgent = ShellAgentFactory.CreateAgent(ShellAgentFactory.Key.Instance);
     _shellAgent.GetAuthenticationModesCompleted += (p) => { AuthenticationModes = p.ToList(); };
     _shellAgent.LoginUserCompleted += (s) => { PMSSession.Current = s; };
 }