本文整理汇总了C#中IAuthenticationContext类的典型用法代码示例。如果您正苦于以下问题:C# IAuthenticationContext类的具体用法?C# IAuthenticationContext怎么用?C# IAuthenticationContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IAuthenticationContext类属于命名空间,在下文中一共展示了IAuthenticationContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RequestParameters
protected RequestParameters(
IAuthenticationContext authenticationContext,
RequestHeaders headers)
{
AuthenticationContext = authenticationContext;
Headers = headers;
}
示例2: TreeVirtualCatalogViewModel
public TreeVirtualCatalogViewModel(
IViewModelsFactory<ITreeCategoryViewModel> vmFactory,
IViewModelsFactory<IVirtualCatalogViewModel> virtualCatalogVmFactory,
IViewModelsFactory<ICatalogDeleteViewModel> catalogDeleteVmFactory,
CatalogBase item,
IRepositoryFactory<ICatalogRepository> repositoryFactory,
IAuthenticationContext authContext,
INavigationManager navigationManager)
: base(repositoryFactory, authContext)
{
InnerItem = item;
_vmFactory = vmFactory;
_catalogDeleteVmFactory = catalogDeleteVmFactory;
EmbeddedHierarchyEntry = this;
ViewTitle = new ViewTitleBase
{
SubTitle = "VIRTUAL CATALOG",
Title = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name : ""
};
OpenItemCommand = new DelegateCommand(() =>
{
if (NavigationData == null)
{
var editVM = virtualCatalogVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("item", InnerItem)
, new KeyValuePair<string, object>("parentTreeVM", this));
NavigationData = ((IClosable)editVM).NavigationData;
}
navigationManager.Navigate(NavigationData);
});
}
示例3: TestSignInWithTwitter
private static void TestSignInWithTwitter(IAuthenticationContext authenticationContext)
{
IAuthenticationContext requestTokens = GetRequestTokens(authenticationContext);
string oauthToken = requestTokens.AccessToken;
authenticationContext.MergeWith(requestTokens);
HttpWebRequest authenticationRequest = GetAuthenticationRequest(authenticationContext, oauthToken);
// Copied from "https://github.com/djmc/SimpleOAuth.Net/blob/master/SimpleOAuthTester/Program.cs"
Process.Start(authenticationRequest.RequestUri.ToString());
Console.Out.WriteLine("Web browser is starting. When you have logged in, enter your Verifier code...");
Console.Out.Write("Verifier> ");
string oauthVerifier = Console.In.ReadLine();
HttpWebRequest accessTokenRequest = GetAccessTokenRequest(authenticationContext, oauthVerifier);
using (HttpWebResponse response = accessTokenRequest.GetResponse() as HttpWebResponse)
using (Stream dataStream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(dataStream))
{
//Read the content.
string responseFromServer = reader.ReadToEnd();
}
}
示例4: TreeCatalogViewModel
public TreeCatalogViewModel(
IViewModelsFactory<ICatalogViewModel> vmFactory,
catalogModel.Catalog item,
IRepositoryFactory<ICatalogRepository> repositoryFactory,
IAuthenticationContext authContext,
INavigationManager navigationManager,
IViewModelsFactory<ICatalogDeleteViewModel> catalogDeleteVmFactory,
IViewModelsFactory<ITreeCategoryViewModel> treeCategoryVmFactory,
IDataManagementService exportService)
: base(repositoryFactory, authContext)
{
InnerItem = item;
EmbeddedHierarchyEntry = this;
_catalogDeleteVmFactory = catalogDeleteVmFactory;
_treeCategoryVmFactory = treeCategoryVmFactory;
_exportService = exportService;
OpenItemCommand = new DelegateCommand(() =>
{
if (NavigationData == null)
{
var editVM = vmFactory.GetViewModelInstance(new KeyValuePair<string, object>("item", InnerItem)
, new KeyValuePair<string, object>("parentTreeVM", this));
NavigationData = ((IClosable)editVM).NavigationData;
}
navigationManager.Navigate(NavigationData);
});
ExportItemCommand = new DelegateCommand(() => RaiseExportItemCommand());
}
示例5: CustomerDetailViewModel
public CustomerDetailViewModel(ISecurityService securityService, IViewModelsFactory<IPhoneNumberDialogViewModel> phoneVmFactory, IViewModelsFactory<IEmailDialogViewModel> emailVmFactory, IViewModelsFactory<ICreateUserDialogViewModel> wizardUserVmFactory, IViewModelsFactory<IAddressDialogViewModel> addressVmFactory, ICustomerEntityFactory entityFactory,
IAuthenticationContext authContext, CustomersDetailViewModel parentViewModel, Contact innerContact,
ICustomerRepository customerRepository, IRepositoryFactory<ISecurityRepository> securityRepositoryFactory,
IRepositoryFactory<ICountryRepository> countryRepositoryFactory, IRepositoryFactory<IOrderRepository> orderRepositoryFactory, ILoginViewModel loginViewModel)
{
_securityService = securityService;
_loginViewModel = loginViewModel;
_parentViewModel = parentViewModel;
_authContext = authContext;
_customerRepository = customerRepository;
_orderRepositoryFactory = orderRepositoryFactory;
_securityRepositoryFactory = securityRepositoryFactory;
_countryRepositoryFactory = countryRepositoryFactory;
_entityFactory = entityFactory;
_addressVmFactory = addressVmFactory;
_wizardUserVmFactory = wizardUserVmFactory;
_emailVmFactory = emailVmFactory;
_phoneVmFactory = phoneVmFactory;
_fileDialogService = new FileDialogService();
InnerItem = innerContact;
InnerItem.PropertyChanged += _innerContact_PropertyChanged;
CommandsInit();
RequestInit();
CollectionInit();
HasCurrentContactLoginAndSuspendAccessCheck();
}
示例6: GetAuthenticationRequest
private static HttpWebRequest GetAuthenticationRequest(
IAuthenticationContext authenticationContext, string oauthToken)
{
RequestParameters authenticateRequestParameters =
new AuthenticateRequestParameters(authenticationContext, oauthToken);
return GetWebRequest(authenticationContext, authenticateRequestParameters);
}
示例7: AppConfigMainSettingsViewModel
public AppConfigMainSettingsViewModel(IAppConfigSettingsViewModel appConfigSetting, ISystemJobsViewModel systemJobSetting, IEmailTemplatesViewModel emailTemplates, IDisplayTemplatesViewModel displayTemplates, ILocalizationMainViewModel localizationHome, ICacheViewModel cacheViewModel, IAuthenticationContext authContext)
{
var items = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigSettings))
{
items.Add(new ItemTypeHomeTab { Caption = "Settings", Category = NavigationNames.ModuleName, ViewModel = appConfigSetting });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigSystemJobs))
{
items.Add(new ItemTypeHomeTab { Caption = "System jobs", Category = NavigationNames.ModuleName, ViewModel = systemJobSetting });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigEmailTemplates))
{
items.Add(new ItemTypeHomeTab { Caption = "Email templates", Category = NavigationNames.ModuleName, ViewModel = emailTemplates });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigDisplayTemplates))
{
items.Add(new ItemTypeHomeTab { Caption = "Display templates", Category = NavigationNames.ModuleName, ViewModel = displayTemplates });
}
items.Add(new ItemTypeHomeTab { Caption = "Localization", Category = NavigationNames.ModuleName, ViewModel = localizationHome });
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigSettings))
{
items.Add(new ItemTypeHomeTab { Caption = "Cache", Category = NavigationNames.ModuleName, ViewModel = cacheViewModel });
}
SubItems = items;
if (SubItems.Count > 0)
{
CurrentTab = SubItems[0];
}
}
示例8: MainFulfillmentViewModel
public MainFulfillmentViewModel(
IInventoryHomeViewModel inventoryVm,
IPicklistHomeViewModel picklistVm,
IRmaHomeViewModel rmaVm,
IViewModelsFactory<ICompleteShipmentViewModel> completeShipmentVmFactory,
IRepositoryFactory<IOrderRepository> orderRepositoryFactory,
IOrderService orderService,
IAuthenticationContext authContext)
{
ViewTitle = new ViewTitleBase { Title = "Fulfillment", SubTitle = "FULFILLMENT SERVICE" };
_inventoryHomeVm = inventoryVm;
_inventoryHomeVm.ParentViewModel = this;
_picklistHomeVm = picklistVm;
_picklistHomeVm.ParentViewModel = this;
_rmaHomeVm = rmaVm;
_rmaHomeVm.ParentViewModel = this;
_completeShipmentVmFactory = completeShipmentVmFactory;
_orderRepositoryFactory = orderRepositoryFactory;
_authContext = authContext;
_orderService = orderService;
PopulateTabItems();
CompleteShipmentCommand = new DelegateCommand(RaiseCompleteShipment);
CommonConfirmRequest = new InteractionRequest<Confirmation>();
CommonNotifyRequest = new InteractionRequest<Notification>();
}
示例9: CatalogImportJobHomeViewModel
public CatalogImportJobHomeViewModel(
IRepositoryFactory<IImportRepository> importRepository,
IViewModelsFactory<ICreateImportJobViewModel> wizardVmFactory,
IViewModelsFactory<IImportJobRunViewModel> runVmFactory,
IViewModelsFactory<IImportJobViewModel> itemVmFactory,
IImportJobEntityFactory entityFactory,
IAuthenticationContext authContext,
IImportService importService,
SubTabsDefaultViewModel parentViewModel)
: base(importRepository, wizardVmFactory, runVmFactory, itemVmFactory, entityFactory, authContext, importService, parentViewModel)
{
AvailableImporters = new[]
{
ImportEntityType.Product,
ImportEntityType.Bundle,
ImportEntityType.Category,
ImportEntityType.Association,
ImportEntityType.DynamicKit,
ImportEntityType.Package,
ImportEntityType.Sku,
ImportEntityType.ItemRelation,
ImportEntityType.ItemAsset,
ImportEntityType.Seo
};
DefaultImporter = AvailableImporters.First().ToString();
}
示例10: PostHandler
public PostHandler(
IAuthenticationContext authContext,
IUserData userdata)
{
this.authContext = authContext;
this.userData = userdata;
}
示例11: OrganizationApi
/// <summary>
/// Construct OrganizationApi instance.
/// </summary>
/// <param name="authenticationContext"></param>
/// <param name="platformConfiguration"></param>
/// <param name="hierarchyApi"></param>
public OrganizationApi(IAuthenticationContext authenticationContext, IPlatformConfiguration platformConfiguration, IHierarchyApi hierarchyApi)
: base(authenticationContext)
{
this.authenticationContext = authenticationContext;
this.platformConfiguration = platformConfiguration;
this.hierarchyApi = hierarchyApi;
}
示例12: TaxesMainSettingsViewModel
public TaxesMainSettingsViewModel(
ITaxCategorySettingsViewModel taxCategorySettingsViewModel,
ITaxSettingsViewModel taxSettingsViewModel,
IViewModelsFactory<IJurisdictionSettingsViewModel> jSettingsVmFactory,
IViewModelsFactory<IJurisdictionGroupSettingsViewModel> jGroupVmFactory,
IViewModelsFactory<ITaxImportHomeViewModel> importVmFactory,
IAuthenticationContext authContext)
{
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxCategories))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Tax categories", Category = NavigationNames.ModuleName, ViewModel = taxCategorySettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdiction))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdictions", Category = NavigationNames.ModuleName, ViewModel = jSettingsVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Taxes)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdictionGroups))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdiction groups", Category = NavigationNames.ModuleName, ViewModel = jGroupVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Taxes)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxes))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Taxes", Category = NavigationNames.ModuleName, ViewModel = taxSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxImport))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = Configuration.NavigationNames.HomeName, Caption = "Import", Category = NavigationNames.ModuleName, ViewModel = importVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("parentViewModel", this)) });
}
CurrentTab = SubItems[0];
}
示例13: ShippingMainSettingsViewModel
public ShippingMainSettingsViewModel(
IShippingOptionSettingsViewModel shippingOptionSettingsViewModel,
IShippingMethodSettingsViewModel shippingMethodSettingsViewModel,
IShippingPackageSettingsViewModel shippingPackageSettingsViewModel,
IViewModelsFactory<IJurisdictionSettingsViewModel> jurisdictionSettingsVmFactory,
IViewModelsFactory<IJurisdictionGroupSettingsViewModel> jGroupVmFactory,
IAuthenticationContext authContext)
{
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingOptions))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping options", ViewModel = shippingOptionSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingMethods))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping methods", ViewModel = shippingMethodSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingPackages))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping packages", ViewModel = shippingPackageSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdiction))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdictions", ViewModel = jurisdictionSettingsVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Shipping)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdictionGroups))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdiction groups", ViewModel = jGroupVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Shipping)) });
}
CurrentTab = SubItems[0];
}
示例14: TimelineRequestParameters
public TimelineRequestParameters(IAuthenticationContext authenticationContext)
: base(authenticationContext)
{
Count = DEFAULT_COUNT;
ScreenName = string.Empty;
ScreenName = DEFAULT_COUNT;
}
示例15: SetUp
public void SetUp()
{
doorStaff = MockRepository.GenerateStub<IDoorStaff>();
authContext = MockRepository.GenerateStub<IAuthenticationContext>();
writer = MockRepository.GenerateStub<IHttpWriter>();
endpoint = new LoginEndpoint(doorStaff, authContext, writer);
userName = "harryBrown";
}