Esempio n. 1
0
 public HomeViewModel(IAuthenticationModel modelAuth)
 {
     _modelAuth = modelAuth;
     _modelAuth.LoadUserComplete += new EventHandler <LoadUserOperationEventArgs>(_modelAuth_LoadUserComplete);
     _modelAuth.GetListAuthenticationMenuComplete += new EventHandler <ComplexResultsArgs <Authentication> >(_modelAuth_GetListAuthenticationMenuComplete);
     _modelAuth.LogoutComplete += new EventHandler <LogoutOperationEventArgs>(_modelAuth_LogoutComplete);
 }
Esempio n. 2
0
 public HomeViewModel(IAuthenticationModel modelAuth)
 {
     _modelAuth = modelAuth;
     _modelAuth.LoadUserComplete += new EventHandler<LoadUserOperationEventArgs>(_modelAuth_LoadUserComplete);
     _modelAuth.GetListAuthenticationMenuComplete += new EventHandler<ComplexResultsArgs<Authentication>>(_modelAuth_GetListAuthenticationMenuComplete);
     _modelAuth.LogoutComplete += new EventHandler<LogoutOperationEventArgs>(_modelAuth_LogoutComplete);
 }
 public override void Cleanup()
 {
     if (_modelAuth != null)
     {
         _modelAuth.ChangePasswordComplete -= new EventHandler <InvokeOperationEventArgs>(_modelAuth_ChangePasswordComplete);
         _modelAuth = null;
     }
     if (DialogSended != null)
     {
         DialogSended = null;
     }
     base.Cleanup();
 }
Esempio n. 4
0
 public override void Cleanup()
 {
     if (_modelAuth != null)
     {
         _modelAuth.LoginComplete -= new EventHandler <LoginOperationEventArgs>(_modelAuth_LoginComplete);
         _modelAuth = null;
     }
     _itemEdit = null;
     if (_dialogSended != null)
     {
         _dialogSended = null;
     }
     base.Cleanup();
 }
Esempio n. 5
0
        /// <summary>
        /// Get an oAuth token for a given user account
        /// </summary>
        /// <param name="user"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        private static async Task <TokenModel> getToken(IAuthenticationModel authModel)
        {
            using (HttpClient client = new HttpClient())
            {
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Base64Encode(clientId + ":" + secret));

                var content = new FormUrlEncodedContent(authModel.ToDictionary());

                HttpResponseMessage response = await client.PostAsync(new Uri(oAuthTokenEndPoint), content);

                return((await handleResponse <TokenModel>(response)).Content);
            }
        }
Esempio n. 6
0
 public override void Cleanup()
 {
     if (_modelAuth != null)
     {
         _modelAuth.LoadUserComplete -= new EventHandler <LoadUserOperationEventArgs>(_modelAuth_LoadUserComplete);
         _modelAuth.GetListAuthenticationMenuComplete -= new EventHandler <ComplexResultsArgs <Authentication> >(_modelAuth_GetListAuthenticationMenuComplete);
         _modelAuth.LogoutComplete -= new EventHandler <LogoutOperationEventArgs>(_modelAuth_LogoutComplete);
         _modelAuth = null;
     }
     ListAuth = null;
     if (DialogSended != null)
     {
         DialogSended = null;
     }
     base.Cleanup();
 }
Esempio n. 7
0
 public override void Cleanup()
 {
     if (_modelAuth != null)
     {
         _modelAuth.LoadUserComplete -= new EventHandler<LoadUserOperationEventArgs>(_modelAuth_LoadUserComplete);
         _modelAuth.GetListAuthenticationMenuComplete -= new EventHandler<ComplexResultsArgs<Authentication>>(_modelAuth_GetListAuthenticationMenuComplete);
         _modelAuth.LogoutComplete -= new EventHandler<LogoutOperationEventArgs>(_modelAuth_LogoutComplete);
         _modelAuth = null;
     }
     ListAuth = null;
     if (DialogSended != null)
         DialogSended = null;
     base.Cleanup();
 }
 public RestSharpCommon(string baseUrl, IAuthenticationModel authenticationModel = null)
 {
     _baseUrl             = baseUrl;
     _authenticationModel = authenticationModel;
 }
Esempio n. 9
0
 public override void Cleanup()
 {
     if (_modelAuth != null)
     {
         _modelAuth.LoginComplete -= new EventHandler<LoginOperationEventArgs>(_modelAuth_LoginComplete);
         _modelAuth = null;
     }
     _itemEdit = null;
     if (_dialogSended != null)
         _dialogSended = null;
     base.Cleanup();
 }
Esempio n. 10
0
 public LoginViewModel(IAuthenticationModel modelAuth)
 {
     _modelAuth = modelAuth;
     _modelAuth.LoginComplete += new EventHandler<LoginOperationEventArgs>(_modelAuth_LoginComplete);
 }
Esempio n. 11
0
 public MainPageViewModel(IAuthenticationModel modelAuth, ITrainingModel modelTrain, ISettingModel modelSetting)
 {
     _modelAuth = modelAuth;
     _modelTrain = modelTrain;
     _modelSetting = modelSetting;
 }
 public ChangePasswordViewModel(IAuthenticationModel modelAuth)
 {
     _modelAuth = modelAuth;
     _modelAuth.ChangePasswordComplete += new EventHandler <InvokeOperationEventArgs>(_modelAuth_ChangePasswordComplete);
 }
 public override void Cleanup()
 {
     if (_modelAuth != null)
     {
         _modelAuth.ChangePasswordComplete -= new EventHandler<InvokeOperationEventArgs>(_modelAuth_ChangePasswordComplete);
         _modelAuth = null;
     }
     if (DialogSended != null)
         DialogSended = null;
     base.Cleanup();
 }
 public ChangePasswordViewModel(IAuthenticationModel modelAuth)
 {
     _modelAuth = modelAuth;
     _modelAuth.ChangePasswordComplete += new EventHandler<InvokeOperationEventArgs>(_modelAuth_ChangePasswordComplete);
 }
Esempio n. 15
0
 public MainPageViewModel(IAuthenticationModel modelAuth, ITrainingModel modelTrain, ISettingModel modelSetting)
 {
     _modelAuth    = modelAuth;
     _modelTrain   = modelTrain;
     _modelSetting = modelSetting;
 }
Esempio n. 16
0
 public LoginViewModel(IAuthenticationModel modelAuth)
 {
     _modelAuth = modelAuth;
     _modelAuth.LoginComplete += new EventHandler <LoginOperationEventArgs>(_modelAuth_LoginComplete);
 }
Esempio n. 17
0
 public AppContext(IAuthenticationModel authModel)
 {
     _authModel = authModel;
 }
Esempio n. 18
0
 public AppContext(IAuthenticationModel authModel) 
 {
     _authModel = authModel;
 }