• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IResourceLoader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IResourceLoader的典型用法代码示例。如果您正苦于以下问题:C# IResourceLoader类的具体用法?C# IResourceLoader怎么用?C# IResourceLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IResourceLoader类属于命名空间,在下文中一共展示了IResourceLoader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CheckoutSummaryPageViewModel

        public CheckoutSummaryPageViewModel(INavigationService navigationService,
            IOrderService orderService,
            IOrderRepository orderRepository,
            IShippingMethodService shippingMethodService,
            ICheckoutDataRepository checkoutDataRepository,
            IShoppingCartRepository shoppingCartRepository,
            IAccountService accountService,
            IResourceLoader resourceLoader,
            IAlertMessageService alertMessageService,
            ISignInUserControlViewModel signInUserControlViewModel)
        {
            _navigationService = navigationService;
            _orderService = orderService;
            _orderRepository = orderRepository;
            _shippingMethodService = shippingMethodService;
            _checkoutDataRepository = checkoutDataRepository;
            _shoppingCartRepository = shoppingCartRepository;
            _resourceLoader = resourceLoader;
            _accountService = accountService;
            _alertMessageService = alertMessageService;
            _signInUserControlViewModel = signInUserControlViewModel;

            SubmitCommand = DelegateCommand.FromAsyncHandler(SubmitAsync, CanSubmit);

            EditCheckoutDataCommand = new DelegateCommand(EditCheckoutData);
            SelectCheckoutDataCommand = new DelegateCommand(async () => await SelectCheckoutDataAsync());
            AddCheckoutDataCommand = new DelegateCommand(AddCheckoutData);
        }
开发者ID:CruzerBoon,项目名称:Prism-Samples-Windows,代码行数:28,代码来源:CheckoutSummaryPageViewModel.cs


示例2: Inform

 // TODO: this should use inputstreams from the loader, not File!
 public virtual void Inform(IResourceLoader loader)
 {
     if (mapping != null)
     {
         IList<string> wlist = null;
         if (File.Exists(mapping))
         {
             wlist = new List<string>(GetLines(loader, mapping));
         }
         else
         {
             var files = SplitFileNames(mapping);
             wlist = new List<string>();
             foreach (string file in files)
             {
                 var lines = GetLines(loader, file.Trim());
                 wlist.AddRange(lines);
             }
         }
         NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
         ParseRules(wlist, builder);
         normMap = builder.Build();
         if (normMap.map == null)
         {
             // if the inner FST is null, it means it accepts nothing (e.g. the file is empty)
             // so just set the whole map to null
             normMap = null;
         }
     }
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:31,代码来源:MappingCharFilterFactory.cs


示例3: MenuViewModel

        public MenuViewModel(IEventAggregator eventAggregator, INavigationService navigationService, IResourceLoader resourceLoader, ISessionStateService sessionStateService)
        {
            eventAggregator.GetEvent<NavigationStateChangedEvent>().Subscribe(OnNavigationStateChanged);
            _navigationService = navigationService;
            _sessionStateService = sessionStateService;

            Commands = new ObservableCollection<MenuItemViewModel>
            {
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("MainPageMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToPage(PageTokens.Main), () => CanNavigateToPage(PageTokens.Main)) },
            };

            _canNavigateLookup = new Dictionary<PageTokens, bool>();

            foreach (PageTokens pageToken in Enum.GetValues(typeof(PageTokens)))
            {
                _canNavigateLookup.Add(pageToken, true);
            }

            if (_sessionStateService.SessionState.ContainsKey(CurrentPageTokenKey))
            {
                // Resuming, so update the menu to reflect the current page correctly
                PageTokens currentPageToken;
                if (Enum.TryParse(_sessionStateService.SessionState[CurrentPageTokenKey].ToString(), out currentPageToken))
                {
                    UpdateCanNavigateLookup(currentPageToken);
                    RaiseCanExecuteChanged();
                }
            }
        }
开发者ID:ali-hk,项目名称:Toolkit,代码行数:29,代码来源:MenuViewModel.cs


示例4: GooglePlayCSVGenerator

 public GooglePlayCSVGenerator (IEditorUtil util, ProductIdRemapper remapper, InventoryDatabase db, IResourceLoader loader) {
     this.util = util;
     this.remapper = remapper;
     this.db = db;
     remapper.initialiseForPlatform(BillingPlatform.GooglePlay);
     this.inventory = XDocument.Load(loader.openTextFile("unibillInventory"));
 }
开发者ID:nhhoang,项目名称:shooting,代码行数:7,代码来源:GooglePlayCSVGenerator.cs


示例5: ShoppingCartPageViewModel

        public ShoppingCartPageViewModel(IShoppingCartRepository shoppingCartRepository,
            INavigationService navigationService,
            IAccountService accountService,
            ISignInUserControlViewModel signInUserControlViewModel,
            IResourceLoader resourceLoader,
            IAlertMessageService alertMessageService,
            ICheckoutDataRepository checkoutDataRepository,
            IOrderRepository orderRepository,
            IEventAggregator eventAggregator)
        {
            _shoppingCartRepository = shoppingCartRepository;
            _navigationService = navigationService;
            _accountService = accountService;
            _signInUserControlViewModel = signInUserControlViewModel;
            _resourceLoader = resourceLoader;
            _alertMessageService = alertMessageService;
            _checkoutDataRepository = checkoutDataRepository;
            _orderRepository = orderRepository;

            CheckoutCommand = DelegateCommand.FromAsyncHandler(CheckoutAsync, CanCheckout);
            RemoveCommand = DelegateCommand<ShoppingCartItemViewModel>.FromAsyncHandler(Remove);
            IncrementCountCommand = DelegateCommand.FromAsyncHandler(IncrementCount);
            DecrementCountCommand = DelegateCommand.FromAsyncHandler(DecrementCount, CanDecrementCount);

            // Subscribe to the ShoppingCartUpdated event
            if (eventAggregator != null)
            {
                eventAggregator.GetEvent<ShoppingCartUpdatedEvent>().Subscribe(UpdateShoppingCartAsync);
            }
        }
开发者ID:CruzerBoon,项目名称:Prism-Samples-Windows,代码行数:30,代码来源:ShoppingCartPageViewModel.cs


示例6: RemoteConfigManager

 public RemoteConfigManager(IResourceLoader loader, IStorage storage, ILogger logger, RuntimePlatform platform)
 {
     this.storage = storage;
     logger.prefix = "Unibill.RemoteConfigManager";
     this.XML = loader.openTextFile ("unibillInventory.json").ReadToEnd ();
     Config = new UnibillConfiguration(XML, platform, logger);
     if (Config.UseHostedConfig) {
         string val = storage.GetString (CACHED_CONFIG_PATH, string.Empty);
         if (string.IsNullOrEmpty (val)) {
             logger.Log ("No cached config available. Using bundled");
         } else {
             logger.Log ("Cached config found, attempting to parse");
             try {
                 Config = new UnibillConfiguration(val, platform, logger);
                 if (Config.inventory.Count == 0) {
                     logger.LogError ("No purchasable items in cached config, ignoring.");
                     Config = new UnibillConfiguration (XML, platform, logger);
                 } else {
                     logger.Log (string.Format ("Using cached config with {0} purchasable items", Config.inventory.Count));
                     XML = val;
                 }
             } catch (Exception e) {
                 logger.LogError ("Error parsing inventory: {0}", e.Message);
                 Config = new UnibillConfiguration(XML, platform, logger);
             }
         }
         refreshCachedConfig (Config.HostedConfigUrl, logger);
     } else {
         logger.Log ("Not using cached inventory, using bundled.");
         Config = new UnibillConfiguration(XML, platform, logger);
     }
 }
开发者ID:jhillkwaj,项目名称:WordsOnWords,代码行数:32,代码来源:RemoteConfigManager.cs


示例7: LoadAsync

        public override Task LoadAsync(IConfiguration configuration, IResourceLoader loader)
        {
            var link = Link;
            var request = link.CreateRequestFor(Url);
            var download = loader.DownloadAsync(request);
            SetDownload(download);

            return link.ProcessResponse(download, response =>
            {
                var type = link.Type ?? MimeTypeNames.Css;
                var engine = configuration.GetStyleEngine(type);

                if (engine != null)
                {
                    var options = new StyleOptions
                    {
                        Element = link,
                        IsDisabled = link.IsDisabled,
                        IsAlternate = link.RelationList.Contains(Keywords.Alternate),
                        Configuration = configuration
                    };

                    _sheet = engine.ParseStylesheet(response, options);
                    _sheet.Media.MediaText = link.Media ?? String.Empty;
                }
            });
        }
开发者ID:fjwuyongzhi,项目名称:AngleSharp,代码行数:27,代码来源:StyleSheetLinkRelation.cs


示例8: LoadAsync

        /// <summary>
        /// See http://www.w3.org/TR/html-imports/#dfn-import-request.
        /// </summary>
        public override async Task LoadAsync(IConfiguration configuration, IResourceLoader loader)
        {
            var link = Link;
            var document = link.Owner;
            var list = ImportLists.GetOrCreateValue(document);
            var location = Url;
            var request = link.CreateRequestFor(location);
            var item = new ImportEntry 
            { 
                Relation = this,
                IsCycle = CheckCycle(document, location)
            };
            _isasync = link.HasAttribute(AttributeNames.Async);
            list.Add(item);
            
            if (!item.IsCycle)
            {
                var nestedStatus = new TaskCompletionSource<Boolean>();
                var download = loader.DownloadAsync(request);
                SetDownload(download);

                await link.ProcessResponse(download, async response =>
                {
                    var context = new BrowsingContext(document.Context, Sandboxes.None);
                    var options = new CreateDocumentOptions(response, configuration)
                    {
                        ImportAncestor = document
                    };
                    _import = await context.OpenAsync(options, CancellationToken.None).ConfigureAwait(false);
                    nestedStatus.SetResult(true);
                }).ConfigureAwait(false);
                await nestedStatus.Task.ConfigureAwait(false);
            }
        }
开发者ID:fjwuyongzhi,项目名称:AngleSharp,代码行数:37,代码来源:ImportLinkRelation.cs


示例9: ChangeDefaultsFlyoutViewModel

        public ChangeDefaultsFlyoutViewModel(ICheckoutDataRepository checkoutDataRepository, IResourceLoader resourceLoader)
        {
            _checkoutDataRepository = checkoutDataRepository;
            _resourceLoader = resourceLoader;

            GoBackCommand = new DelegateCommand(() => GoBack());
        }
开发者ID:stevenh77,项目名称:ItineraryHunter-Win8,代码行数:7,代码来源:ChangeDefaultsFlyoutViewModel.cs


示例10: MenuViewModel

        public MenuViewModel(INavigationService navigationService, IResourceLoader resourceLoader)
        {
            _navigationService = navigationService;

            Commands = new ObservableCollection<MenuItemViewModel>
            {
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("DTSBehaviorSampleMenuItemDisplayName"), FontIcon = "\ue15f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.DTSBehaviorSample), () => CanNavigateToSamplePage(PageTokens.DTSBehaviorSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("DTSSampleMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.DTSSample), () => CanNavigateToSamplePage(PageTokens.DTSSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("IncrementalLoadingMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.IncrementalLoadingSample), () => CanNavigateToSamplePage(PageTokens.IncrementalLoadingSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("DeferLoadStrategyMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.DeferLoadStrategySample), () => CanNavigateToSamplePage(PageTokens.DeferLoadStrategySample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("CustomLVIPMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.CustomLVIPSample), () => CanNavigateToSamplePage(PageTokens.CustomLVIPSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("StateTriggerMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.StateTriggerSample), () => CanNavigateToSamplePage(PageTokens.StateTriggerSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("CVSMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.CollectionViewSourceSample), () => CanNavigateToSamplePage(PageTokens.CollectionViewSourceSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("DeviceSpecificMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.DeviceSpecificSample), () => CanNavigateToSamplePage(PageTokens.DeviceSpecificSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("ExpanderSampleMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.ExpanderSample), () => CanNavigateToSamplePage(PageTokens.ExpanderSample)) },
                new MenuItemViewModel { DisplayName = resourceLoader.GetString("OldMainPageMenuItemDisplayName"), FontIcon = "\ue19f", Command = new DelegateCommand(() => NavigateToSamplePage(PageTokens.OldMain), () => CanNavigateToSamplePage(PageTokens.OldMain)) },
            };

            _currentPageToken = PageTokens.DTSBehaviorSample;
            _canNavigateLookup = new Dictionary<PageTokens, bool>();

            foreach (PageTokens pageToken in Enum.GetValues(typeof(PageTokens)))
            {
                _canNavigateLookup.Add(pageToken, true);
            }

            _canNavigateLookup[_currentPageToken] = false;
        }
开发者ID:ali-hk,项目名称:Toolkit,代码行数:28,代码来源:MenuViewModel.cs


示例11: CategoryPageViewModel

 public CategoryPageViewModel(IProductCatalogRepository productCatalogRepository, INavigationService navigationService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
 {
     _productCatalogRepository = productCatalogRepository;
     _navigationService = navigationService;
     _alertMessageService = alertMessageService;
     _resourceLoader = resourceLoader;
 }
开发者ID:CruzerBoon,项目名称:Prism-Samples-Windows,代码行数:7,代码来源:CategoryPageViewModel.cs


示例12: SplashPageViewModel

 public SplashPageViewModel(INavigationService navigationService, IOpenhabDatabase database, IEventAggregator eventAggregator, IResourceLoader resourceLoader)
 {
     _navigationService = navigationService;
     _database = database;
     _eventAggregator = eventAggregator;
     _resourceLoader = resourceLoader;
 }
开发者ID:altima,项目名称:openhabUWP,代码行数:7,代码来源:SplashPageViewModel.cs


示例13: DefaultResourceLoader

        public DefaultResourceLoader(IResourceLoader loader)
        {
            if (loader == null)
                throw new ArgumentNullException("wrappedLoader");

            this.loader = loader;
        }
开发者ID:Pomona,项目名称:Pomona,代码行数:7,代码来源:DefaultResourceLoader.cs


示例14: Inform

        public virtual void Inform(IResourceLoader loader)
        {
            Stream stream = null;
            try
            {
                if (dictFile != null) // the dictionary can be empty.
                {
                    dictionary = GetWordSet(loader, dictFile, false);
                }
                // TODO: Broken, because we cannot resolve real system id
                // ResourceLoader should also supply method like ClassLoader to get resource URL
                stream = loader.OpenResource(hypFile);
                //InputSource @is = new InputSource(stream);
                //@is.Encoding = encoding; // if it's null let xml parser decide
                //@is.SystemId = hypFile;

                var xmlEncoding = string.IsNullOrEmpty(encoding) ? Encoding.UTF8 : Encoding.GetEncoding(encoding);

                hyphenator = HyphenationCompoundWordTokenFilter.GetHyphenationTree(stream, xmlEncoding);

            }
            finally
            {
                IOUtils.CloseWhileHandlingException(stream);
            }
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:26,代码来源:HyphenationCompoundWordTokenFilterFactory.cs


示例15: Add

 /// <summary>
 /// Add a new resource loader.
 /// </summary>
 /// <param name="loader">Provider to add.</param>
 /// <exception cref="InvalidOperationException">Manager have been started.</exception>
 public void Add(IResourceLoader loader)
 {
     if (_isStarted)
         throw new InvalidOperationException("Manager have been started.");
     _logger.Trace("Adding resource loader '" + loader.GetType().FullName + "'.");
     _providers.Add(loader);
 }
开发者ID:Kayomani,项目名称:FAP,代码行数:12,代码来源:ResourceProvider.cs


示例16: ShippingAddressUserControlViewModel

 public ShippingAddressUserControlViewModel(ICheckoutDataRepository checkoutDataRepository, ILocationService locationService, IResourceLoader resourceLoader)
 {
     _address = new Address();
     _checkoutDataRepository = checkoutDataRepository;
     _locationService = locationService;
     _resourceLoader = resourceLoader;
 }
开发者ID:stevenh77,项目名称:ItineraryHunter-Win8,代码行数:7,代码来源:ShippingAddressUserControlViewModel.cs


示例17: NewsViewModel

        public NewsViewModel(IResourceLoader loader, IGitHubService githubService)
        {
            _loader = loader;
            _githubService = githubService;

            DisplayName = "news";
        }
开发者ID:gautamkrishnar,项目名称:wpaghapp,代码行数:7,代码来源:NewsViewModel.cs


示例18: DerDieDasTest

 public DerDieDasTest(IResourceLoader resourceLoader)
 {
     ParamValidator.EnsureParametersAreValid(new NullValidatorWithValue<IResourceLoader>(() => resourceLoader, resourceLoader));
     _derDieDasData = resourceLoader.LoadResource();
     _testResults = new List<TestResult>();
     SelectTests(new List<string>());
 }
开发者ID:RichardWilliams,项目名称:DerDieDas,代码行数:7,代码来源:DerDieDasTest.cs


示例19: StyleSheetRequestProcessor

 private StyleSheetRequestProcessor(HtmlLinkElement link, Document document, IResourceLoader loader)
     : base(loader)
 {
     _link = link;
     _document = document;
     _loader = loader;
 }
开发者ID:Wojdav,项目名称:AngleSharp,代码行数:7,代码来源:StyleSheetRequestProcessor.cs


示例20: Inform

        public void Inform(IResourceLoader loader)
        {
            TokenizerFactory factory = tokenizerFactory == null ? null : LoadTokenizerFactory(loader, tokenizerFactory);

            Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, factory);

            try
            {
                string formatClass = format;
                if (format == null || format.Equals("solr"))
                {
                    formatClass = typeof(SolrSynonymParser).AssemblyQualifiedName;
                }
                else if (format.Equals("wordnet"))
                {
                    formatClass = typeof(WordnetSynonymParser).AssemblyQualifiedName;
                }
                // TODO: expose dedup as a parameter?
                map = LoadSynonyms(loader, formatClass, true, analyzer);
            }
            catch (Exception e)
            {
                throw new IOException("Error parsing synonyms file:", e);
            }
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:25,代码来源:FSTSynonymFilterFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IResourceManager类代码示例发布时间:2022-05-24
下一篇:
C# IResourceHandler类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap