本文整理汇总了C#中IWorkContextAccessor.GetContext方法的典型用法代码示例。如果您正苦于以下问题:C# IWorkContextAccessor.GetContext方法的具体用法?C# IWorkContextAccessor.GetContext怎么用?C# IWorkContextAccessor.GetContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWorkContextAccessor
的用法示例。
在下文中一共展示了IWorkContextAccessor.GetContext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DateTokens
public DateTokens(
IClock clock,
IDateTimeLocalization dateTimeLocalization,
IWorkContextAccessor workContextAccessor) {
_clock = clock;
_dateTimeLocalization = dateTimeLocalization;
_workContextAccessor = workContextAccessor;
_cultureInfo = new Lazy<CultureInfo>(() => CultureInfo.GetCultureInfo(_workContextAccessor.GetContext().CurrentCulture));
_timeZone = new Lazy<TimeZoneInfo>(() => _workContextAccessor.GetContext().CurrentTimeZone);
T = NullLocalizer.Instance;
}
示例2: UrlFilter
public UrlFilter(IWorkContextAccessor wca,
IRepository<FilteredRequestRecord> filteredRequestRecords,
ICachedUrlProtectorRules cachedUrlProtectorRules,
IOrchardServices orchardServices)
{
_wca = wca;
_filteredRequestRecords = filteredRequestRecords;
_cachedUrlProtectorRules = cachedUrlProtectorRules;
_orchardServices = orchardServices;
Logger = NullLogger.Instance;
UserAgent = _wca.GetContext().HttpContext.Request.UserAgent;
UserHostAddress = _wca.GetContext().HttpContext.Request.UserHostAddress;
RequestUrl = _wca.GetContext().HttpContext.Request.Url;
}
示例3: CampaignController
public CampaignController(
ICampaignService campaignService,
ITShirtCostService tshirtService,
IProductService productService,
IPromotionService promotionService,
IRepository<CurrencyRecord> currencyRepository,
IWorkContextAccessor wca,
INotifier notifier,
IOrchardServices services,
ICookieCultureService cookieCultureService,
ICountryService countryService)
{
_currencyRepository = currencyRepository;
Services = services;
_tshirtService = tshirtService;
_productService = productService;
_campaignService = campaignService;
_promotionService = promotionService;
_wca = wca;
_notifier = notifier;
Logger = NullLogger.Instance;
_cookieCultureService = cookieCultureService;
//var culture = _wca.GetContext().CurrentCulture.Trim();
_cultureUsed = _wca.GetContext().CurrentCulture.Trim();
//cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY");
_countryService = countryService;
}
示例4: MissingSettingsBanner
public MissingSettingsBanner(IOrchardServices orchardServices, IWorkContextAccessor workContextAccessor)
{
_orchardServices = orchardServices;
_workContext = workContextAccessor.GetContext();
T = NullLocalizer.Instance;
}
示例5: AdminCultureSelectorFactory
public AdminCultureSelectorFactory(
IWorkContextAccessor workContextAccessor,
IShapeFactory shapeFactory,
ICultureManager cultureManager) {
_cultureManager = cultureManager;
_workContext = workContextAccessor.GetContext();
Shape = shapeFactory;
}
示例6: LocalizationBucket
public LocalizationBucket(ICultureManager cultureManager, IWorkContextAccessor workContextAccessor)
{
var currentCultureName = cultureManager.GetCurrentCulture(workContextAccessor.GetContext().HttpContext);
var defaultCultureName = cultureManager.GetSiteCulture();
CurrentCulture = cultureManager.GetCultureByName(currentCultureName);
DefaultCulture = cultureManager.GetCultureByName(defaultCultureName);
IsCurrentCultureDefault = CurrentCulture != null && CurrentCulture.Id == DefaultCulture.Id;
}
示例7: PaymentController
public PaymentController(IWorkContextAccessor workContextAccessor, IPaymentSettingsService paymentSettingsService, IOrchardServices services)
{
_workContextAccessor = workContextAccessor;
_paymentSettingsService = paymentSettingsService;
Services = services;
var culture = _workContextAccessor.GetContext().CurrentCulture.Trim();
cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY");
}
示例8: InlineShapeFactory
public InlineShapeFactory(IAuthorizer authorizer,
IWorkContextAccessor workContextAccessor,
IShapeTableManager shapeTableManager,
IThemeManager themeManager) {
_authorizer = authorizer;
_shapeTableManager = shapeTableManager;
_themeManager = themeManager;
_workContext = workContextAccessor.GetContext();
}
示例9: AdminCostController
public AdminCostController(ITShirtCostService costService, IOrchardServices services, IWorkContextAccessor workContextAccessor)
{
_costService = costService;
Services = services;
_workContextAccessor = workContextAccessor;
culture = _workContextAccessor.GetContext().CurrentCulture.Trim();
cultureSearch = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY");
}
示例10: AdminWizardController
public AdminWizardController(IFontService fontService, IOrchardServices services, IWorkContextAccessor workContextAccessor)
{
_fontService = fontService;
Services = services;
_workContextAccessor = workContextAccessor;
var culture = _workContextAccessor.GetContext().CurrentCulture.Trim();
cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY");
}
示例11: TinyMceShapeDisplayEvent
public TinyMceShapeDisplayEvent(
ICacheManager cacheManager,
IVirtualPathProvider virtualPathProvider,
IWorkContextAccessor workContextAccessor,
ISignals signals) {
_signals = signals;
_cacheManager = cacheManager;
_virtualPathProvider = virtualPathProvider;
_workContext = workContextAccessor.GetContext();
}
示例12: FieldTokens
public FieldTokens(
IDateTimeLocalization dateTimeLocalization,
IWorkContextAccessor workContextAccessor) {
_dateTimeLocalization = dateTimeLocalization;
_workContextAccessor = workContextAccessor;
_cultureInfo = new Lazy<CultureInfo>(() => CultureInfo.GetCultureInfo(_workContextAccessor.GetContext().CurrentCulture));
T = NullLocalizer.Instance;
}
示例13: RemoteStorageSettingsPartHandler
public RemoteStorageSettingsPartHandler(IRepository<RemoteStorageSettingsPartRecord> repository, IWorkContextAccessor workContextAccessor) {
T = NullLocalizer.Instance;
Filters.Add(new ActivatingFilter<RemoteStorageSettingsPart>("Site"));
Filters.Add(StorageFilter.For(repository));
Filters.Add(new TemplateFilterForRecord<RemoteStorageSettingsPartRecord>("RemoteStorageSettings", "Parts/MediaFolder.RemoteStorageSettings", "media"));
OnInitializing<RemoteStorageSettingsPart>(
(context, part) => {
part.Record.MediaLocation =
workContextAccessor.GetContext().HttpContext.Server.MapPath("~/Media");
});
}
示例14: ShapeTracingFactory
public ShapeTracingFactory(
IWorkContextAccessor workContextAccessor,
IShapeTableManager shapeTableManager,
IThemeManager themeManager,
IWebSiteFolder webSiteFolder,
IAuthorizer authorizer
) {
_workContext = workContextAccessor.GetContext();
_shapeTableManager = shapeTableManager;
_themeManager = themeManager;
_webSiteFolder = webSiteFolder;
_authorizer = authorizer;
}
示例15: SnippetElementHarvester
public SnippetElementHarvester(
IWorkContextAccessor workContextAccessor,
Work<IShapeFactory> shapeFactory,
Work<ISiteThemeService> siteThemeService,
Work<IShapeTableLocator> shapeTableLocator,
Work<IElementFactory> elementFactory) {
_shapeFactory = shapeFactory;
_siteThemeService = siteThemeService;
_shapeTableLocator = shapeTableLocator;
_elementFactory = elementFactory;
workContextAccessor.GetContext();
}