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


C# ILoader类代码示例

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


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

示例1: Setup

		public void Setup()
		{
            mr = new MockRepository();
            form = new MainForm();
            sc = new ServiceContainer();
            loader = mr.StrictMock<ILoader>();
            dec = mr.StrictMock<IDecompiler>();
            sc = new ServiceContainer();
            uiSvc = new FakeShellUiService();
            host = mr.StrictMock<DecompilerHost>();
            memSvc = mr.StrictMock<ILowLevelViewService>();
            var image = new LoadedImage(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = image.CreateImageMap();
            var arch = mr.StrictMock<IProcessorArchitecture>();
            arch.Stub(a => a.CreateRegisterBitset()).Return(new BitSet(32));
            arch.Replay();
            var platform = mr.StrictMock<Platform>(null, arch);
            arch.BackToRecord();
            program = new Program(image, imageMap, arch, platform);
            project = new Project { Programs = { program } };

            browserSvc = mr.StrictMock<IProjectBrowserService>();

            sc.AddService<IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService<ILoader>(loader);

            i = new TestInitialPageInteractor(sc, dec);

		}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:35,代码来源:InitialPageInteractorTests.cs

示例2: Load

        // Load items using the specified loader
        public async void Load(ILoader loader)
        {
            _loader = loader;
            _loadingStatusIndicator.LoadingMessage = _loader.LoadingMessage;            

            var selectedItem = _list.SelectedItem as SearchResultPackageMetadata;

            _items.Clear();
            _items.Add(_loadingStatusIndicator);
            _startIndex = 0;            

            // now the package list
            await Load();

            if (selectedItem != null)
            {
                // select the the previously selected item if it still exists.
                foreach (var item in _list.Items)
                {
                    var package = item as SearchResultPackageMetadata;
                    if (package == null)
                    {
                        continue;
                    }

                    if (package.Id.Equals(selectedItem.Id, StringComparison.OrdinalIgnoreCase))
                    {
                        _list.SelectedItem = item;
                        break;
                    }
                }
            }
        }
开发者ID:pabomex,项目名称:NuGet.PackageManagement,代码行数:34,代码来源:InfiniteScrollList.xaml.cs

示例3: Load

        public static QueryBoostingContext Load(string fileName, ILoader loader, FrameworkLogger logger)
        {
            try
            {
                using (var reader = loader.GetReader(fileName))
                {
                    var serializer = new JsonSerializer();

                    var value = serializer.Deserialize<QueryBoostingContext>(reader);

                    return value;
                }
            }
            catch (Exception ex)
            {
                if (IndexingUtils.IsFatal(ex))
                {
                    throw;
                }

                logger.LogError($"Unable to load {fileName}.", ex);
            }

            return Default;
        }
开发者ID:NuGet,项目名称:NuGet.Services.Metadata,代码行数:25,代码来源:QueryBoostingContext.cs

示例4: Setup

		public void Setup()
		{
            mr = new MockRepository();
            form = new MainForm();
            sc = new ServiceContainer();
            loader = mr.StrictMock<ILoader>();
            dec = mr.StrictMock<IDecompiler>();
            sc = new ServiceContainer();
            uiSvc = new FakeShellUiService();
            host = mr.StrictMock<DecompilerHost>();
            memSvc = mr.StrictMock<ILowLevelViewService>();
            var mem = new MemoryArea(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = new SegmentMap(
                mem.BaseAddress,
                new ImageSegment("code", mem, AccessMode.ReadWriteExecute));
            var arch = mr.StrictMock<IProcessorArchitecture>();
            var platform = mr.StrictMock<IPlatform>();
            program = new Program(imageMap, arch, platform);
            project = new Project { Programs = { program } };

            browserSvc = mr.StrictMock<IProjectBrowserService>();

            sc.AddService<IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService<ILoader>(loader);
            sc.AddService<DecompilerHost>(host);

            i = new TestInitialPageInteractor(sc, dec);

		}
开发者ID:relaxar,项目名称:reko,代码行数:35,代码来源:InitialPageInteractorTests.cs

示例5: Setup

 public void Setup()
 {
     this.mr = new MockRepository();
     this.sc = new ServiceContainer();
     loader = mr.Stub<ILoader>();
     arch = mr.StrictMock<IProcessorArchitecture>();
     Address dummy;
     arch.Stub(a => a.TryParseAddress(null, out dummy)).IgnoreArguments().WhenCalled(m =>
     {
         Address addr;
         var sAddr = (string)m.Arguments[0];
         var iColon = sAddr.IndexOf(':');
         if (iColon > 0)
         {
             addr = Address.SegPtr(
                 Convert.ToUInt16(sAddr.Remove(iColon)),
                 Convert.ToUInt16(sAddr.Substring(iColon+1)));
             m.ReturnValue = true;
         }
         else
         {
             m.ReturnValue = Address32.TryParse32((string)m.Arguments[0], out addr);
         }
         m.Arguments[1] = addr;
     }).Return(false);
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:26,代码来源:ProjectSerializerTests.cs

示例6: Load

 public IModel Load(CADType c, ILoader loader)
 {
     if (_parsers.ContainsKey(c))
     {
         return _parsers[c].Parse(loader.Load());
     }
     throw new Exception("Can't parse given type.");
 }
开发者ID:Chaaaarge,项目名称:cad-in-unity,代码行数:8,代码来源:CADLoader.cs

示例7: IssueDetailsPageViewModel

 public IssueDetailsPageViewModel(IDeviceService deviceService,
     ILoader loader,
     IProgressService progressService,
     INavigationService navigationService)
     : base(loader, progressService, navigationService)
 {
     _deviceService = deviceService;
 }
开发者ID:XamarinGarage,项目名称:GiTracker,代码行数:8,代码来源:IssueDetailsPageViewModel.cs

示例8: AfterglowRuntime

        public AfterglowRuntime(IDatabase database, ILogger logger, ILoader loader)
        {
            this._database = database;
            this._logger = logger;
            this.Loader = loader;

            Settings = new Settings(database.AddTable("Settings"), logger, this);
        }
开发者ID:spazzarama,项目名称:Afterglow,代码行数:8,代码来源:AfterglowRuntime.cs

示例9: SetUp

			public void SetUp()
			{
				log = Substitute.For<ILog>();
				loader = Substitute.For<ILoader>();
				compiler = Substitute.For<ICompiler>();
				
				compileCommand = new CompileCommand(log, loader, compiler);
			}
开发者ID:wilsonmar,项目名称:mulder,代码行数:8,代码来源:CompileCommandTests.cs

示例10: BaseViewModel

 protected BaseViewModel(ILoader loader, IProgressService progressService,
     INavigationService navigationService)
 {
     Loader = loader;
     Loader.LoadingChanged += (sender, args) => IsLoadingChanged(Loader.IsLoading);
     _progressService = progressService;
     NavigationService = navigationService;
 }
开发者ID:XamarinGarage,项目名称:GiTracker,代码行数:8,代码来源:BaseViewModel.cs

示例11: AboutPageViewModel

 public AboutPageViewModel(IDeviceService deviceService,
     ILoader loader,
     IProgressService progressService,
     INavigationService navigationService)
     : base(loader, progressService, navigationService)
 {
     _deviceService = deviceService;
     Version = "1.0";
 }
开发者ID:XamarinGarage,项目名称:GiTracker,代码行数:9,代码来源:AboutPageViewModel.cs

示例12: IssueListPageViewModel

        public IssueListPageViewModel(ILoader loader, ILoader listLoader, IProgressService progressService,
            INavigationService navigationService,
            IIssueService issueService)
            : base(loader, listLoader, progressService, navigationService)
        {
            _issueService = issueService;

            Title = IssueList.Title;
        }
开发者ID:XamarinGarage,项目名称:GiTracker,代码行数:9,代码来源:IssueListPageViewModel.cs

示例13: WebSearchProvider

 public WebSearchProvider(
     ILoader<HtmlDocument> loader,
     ISpliter<HtmlDocument, HtmlNode> spliter,
     IBuilder<HtmlNode> builder)
 {
     _loader  = loader;
     _spliter = spliter;
     _builder = builder;
 }
开发者ID:BERef,项目名称:BERef,代码行数:9,代码来源:WebSearchProvider.cs

示例14: LogWorkPageViewModel

        public LogWorkPageViewModel(ILoader loader,
            IProgressService progressService,
            INavigationService navigationService,
            IWorkLogService workLogService)
            : base(loader, progressService, navigationService)
        {
            _workLogService = workLogService;

            Title = LogWork.Title;
            Date = DateTime.Now;
        }
开发者ID:XamarinGarage,项目名称:GiTracker,代码行数:11,代码来源:LogWorkPageViewModel.cs

示例15: Load

        public void Load(string name, ILoader loader, FrameworkLogger logger)
        {
            // The data in downloads.v1.json will be an array of Package records - which has Id, Array of Versions and download count.
            // Sample.json : [["AutofacContrib.NSubstitute",["2.4.3.700",406],["2.5.0",137]],["Assman.Core",["2.0.7",138]]....
            using (var jsonReader = loader.GetReader(name))
            {
                try
                {
                    jsonReader.Read();

                    while (jsonReader.Read())
                    {
                        try
                        {
                            if (jsonReader.TokenType == JsonToken.StartArray)
                            {
                                JToken record = JToken.ReadFrom(jsonReader);
                                string id = String.Intern(record[0].ToString().ToLowerInvariant());

                                // The second entry in each record should be an array of versions, if not move on to next entry.
                                // This is a check to safe guard against invalid entries.
                                if (record.Count() == 2 && record[1].Type != JTokenType.Array)
                                {
                                    continue;
                                }

                                if (!_downloads.ContainsKey(id))
                                {
                                    _downloads.Add(id, new DownloadsByVersion());
                                }
                                var versions = _downloads[id];

                                foreach (JToken token in record)
                                {
                                    if (token != null && token.Count() == 2)
                                    {
                                        string version = String.Intern(token[0].ToString().ToLowerInvariant());
                                        versions[version] = token[1].ToObject<int>();
                                    }
                                }
                            }
                        }
                        catch (JsonReaderException ex)
                        {
                            logger.LogInformation("Invalid entry found in downloads.v1.json. Exception Message : {0}", ex.Message);
                        }
                    }
                }
                catch (JsonReaderException ex)
                {
                    logger.LogError("Data present in downloads.v1.json is invalid. Couldn't get download data.", ex);
                }
            }
        }
开发者ID:NuGet,项目名称:NuGet.Services.Metadata,代码行数:54,代码来源:Downloads.cs


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