当前位置: 首页>>代码示例>>C#>>正文


C# IWorkContextAccessor.GetContext方法代码示例

本文整理汇总了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;
        }
开发者ID:wezmag,项目名称:Coevery,代码行数:13,代码来源:DateTokens.cs

示例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;
 }
开发者ID:rijkshuisstijl,项目名称:Rijkshuisstijl.UrlProtector,代码行数:14,代码来源:UrlFilter.cs

示例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;
        }
开发者ID:omidam81,项目名称:Ver1.0,代码行数:28,代码来源:CampaignController.cs

示例4: MissingSettingsBanner

        public MissingSettingsBanner(IOrchardServices orchardServices, IWorkContextAccessor workContextAccessor)
        {
            _orchardServices = orchardServices;
            _workContext = workContextAccessor.GetContext();

            T = NullLocalizer.Instance;
        }
开发者ID:fengweijp,项目名称:Orchard.Disqus,代码行数:7,代码来源:MissingSettingsBanner.cs

示例5: AdminCultureSelectorFactory

 public AdminCultureSelectorFactory(
     IWorkContextAccessor workContextAccessor, 
     IShapeFactory shapeFactory,
     ICultureManager cultureManager) {
     _cultureManager = cultureManager;
     _workContext = workContextAccessor.GetContext();
     Shape = shapeFactory;
 }
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:8,代码来源:AdminCultureSelectorFactory.cs

示例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;
 }
开发者ID:qt1,项目名称:orchard_contrib-RM.Localization,代码行数:8,代码来源:LocalizedTagsService.cs

示例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");
        }
开发者ID:omidam81,项目名称:Ver1.0,代码行数:9,代码来源:PaymentController.cs

示例8: InlineShapeFactory

 public InlineShapeFactory(IAuthorizer authorizer, 
     IWorkContextAccessor workContextAccessor,
     IShapeTableManager shapeTableManager,
     IThemeManager themeManager) {
     _authorizer = authorizer;
     _shapeTableManager = shapeTableManager;
     _themeManager = themeManager;
     _workContext = workContextAccessor.GetContext();
 }
开发者ID:Jetski5822,项目名称:Orchard.InlineEditing,代码行数:9,代码来源:InlineShapeFactory.cs

示例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");
        }
开发者ID:omidam81,项目名称:Ver1.0,代码行数:9,代码来源:AdminCostController.cs

示例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");
        }
开发者ID:omidam81,项目名称:Ver1.0,代码行数:9,代码来源:AdminwizardController.cs

示例11: TinyMceShapeDisplayEvent

 public TinyMceShapeDisplayEvent(
     ICacheManager cacheManager,
     IVirtualPathProvider virtualPathProvider,
     IWorkContextAccessor workContextAccessor,
     ISignals signals) {
     _signals = signals;
     _cacheManager = cacheManager;
     _virtualPathProvider = virtualPathProvider;
     _workContext = workContextAccessor.GetContext();
 }
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:10,代码来源:TinyMceShapeDisplayEvent.cs

示例12: FieldTokens

        public FieldTokens(
            IDateTimeLocalization dateTimeLocalization, 
            IWorkContextAccessor workContextAccessor) {
            _dateTimeLocalization = dateTimeLocalization;
            _workContextAccessor = workContextAccessor;

            _cultureInfo = new Lazy<CultureInfo>(() => CultureInfo.GetCultureInfo(_workContextAccessor.GetContext().CurrentCulture));

            T = NullLocalizer.Instance;
        }
开发者ID:bigfont,项目名称:CertifiedOverheadCrane,代码行数:10,代码来源:FieldTokens.cs

示例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");
                });
        }
开发者ID:prakasha,项目名称:Orchard1.6,代码行数:12,代码来源:RemoteStorageSettingsPartHandler.cs

示例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;
 }
开发者ID:Higea,项目名称:Orchard,代码行数:13,代码来源:ShapeTracingFactory.cs

示例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();
        }
开发者ID:mikmakcar,项目名称:orchard_fork_learning,代码行数:13,代码来源:SnippetElementHarvester.cs


注:本文中的IWorkContextAccessor.GetContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。