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


C# IServiceProvider.RequireService方法代码示例

本文整理汇总了C#中IServiceProvider.RequireService方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceProvider.RequireService方法的具体用法?C# IServiceProvider.RequireService怎么用?C# IServiceProvider.RequireService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServiceProvider的用法示例。


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

示例1: PhasePageInteractorImpl

 public PhasePageInteractorImpl(IServiceProvider services)
 {
     this.Services = services;
     decompilerSvc = services.RequireService<IDecompilerService>();
     decompilerUiSvc = services.RequireService<IDecompilerShellUiService>();
     workerDlgSvc = services.RequireService<IWorkerDialogService>();
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:PhasePageInteractor.cs

示例2: MainFormInteractor

 public MainFormInteractor(IServiceProvider services)
 {
     this.dlgFactory = services.RequireService<IDialogFactory>();
     this.mru = new MruList(MaxMruItems);
     this.mru.Load(MruListFile);
     this.sc = services.RequireService<IServiceContainer>();
     this.nextPage = new Dictionary<IPhasePageInteractor, IPhasePageInteractor>();
 }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:8,代码来源:MainFormInteractor.cs

示例3: LoadedPageInteractor

        public LoadedPageInteractor(IServiceProvider services) : base(services)
        {
            decompilerSvc = services.RequireService<IDecompilerService>();
            sbSvc = services.RequireService<IStatusBarService>();
            memSvc = services.RequireService<ILowLevelViewService>();

            mpCmdidToCommand = new Dictionary<int, MenuCommand>();
            AddCommand(new CommandID(CmdSets.GuidReko, CmdIds.ViewShowAllFragments));
            AddCommand(new CommandID(CmdSets.GuidReko, CmdIds.ViewShowUnscanned));
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:10,代码来源:LoadedPageInteractor.cs

示例4: AnalyzedPageInteractorImpl

		public AnalyzedPageInteractorImpl(IServiceProvider services) : base(services)
		{
            decompilerSvc = services.RequireService<IDecompilerService>();
            codeViewerSvc = services.RequireService<ICodeViewerService>();
            memViewerSvc = services.RequireService<ILowLevelViewService>();
            disasmViewerSvc = services.RequireService<IDisassemblyViewService>();
            projectSvc = services.RequireService<IProjectBrowserService>();

            this.canAdvance = true;
		}
开发者ID:killbug2004,项目名称:reko,代码行数:10,代码来源:AnalyzedPageInteractor.cs

示例5: ExePackLoader

        public ExePackLoader(IServiceProvider services, string filename, byte[] imgRaw)
            : base(services, filename, imgRaw)
        {
            var cfgSvc = services.RequireService<IConfigurationService>();
            arch = cfgSvc.GetArchitecture("x86-real-16");
            platform =cfgSvc.GetEnvironment("ms-dos")
                .Load(Services, arch);

            var exe = new ExeImageLoader(services, filename, imgRaw);
            this.exeHdrSize = (uint)(exe.e_cparHeader * 0x10U);
            this.hdrOffset = (uint)(exe.e_cparHeader + exe.e_cs) * 0x10U;
            ImageReader rdr = new LeImageReader(RawImage, hdrOffset);
            this.ip = rdr.ReadLeUInt16();
            this.cs = rdr.ReadLeUInt16();
            rdr.ReadLeUInt16();
            this.cbExepackHeader = rdr.ReadLeUInt16();
            this.sp = rdr.ReadLeUInt16();
            this.ss = rdr.ReadLeUInt16();
            this.cpUncompressed = rdr.ReadLeUInt16();

            int offset = ExePackHeaderOffset(exe);
            if (MemoryArea.CompareArrays(imgRaw, offset, signature, signature.Length))
            {
                relocationsOffset = 0x012D;
            }
            else if (MemoryArea.CompareArrays(imgRaw, offset, signature2, signature2.Length))
            {
                relocationsOffset = 0x0125;
            }
            else
                throw new ApplicationException("Not a recognized EXEPACK image.");
        }
开发者ID:relaxar,项目名称:reko,代码行数:32,代码来源:ExePackLoader.cs

示例6: LzExeUnpacker

		public LzExeUnpacker(IServiceProvider services, ExeImageLoader exe, string filename, byte [] rawImg) : base(services, filename, rawImg)
		{
            this.arch = new IntelArchitecture(ProcessorMode.Real);
            this.platform = services.RequireService<IConfigurationService>()
                .GetEnvironment("ms-dos")
                .Load(services, arch);
            Validate(exe);
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:8,代码来源:LzExeUnpacker.cs

示例7: LzExeUnpacker

		public LzExeUnpacker(IServiceProvider services, ExeImageLoader exe, string filename, byte [] rawImg) : base(services, filename, rawImg)
		{
            var cfgSvc = services.RequireService<IConfigurationService>();
            this.arch = cfgSvc.GetArchitecture("x86-real-16");
            this.platform = cfgSvc.GetEnvironment("ms-dos")
                .Load(services, arch);
            Validate(exe);
		}
开发者ID:relaxar,项目名称:reko,代码行数:8,代码来源:LzExeUnpacker.cs

示例8: MsdosImageLoader

		public MsdosImageLoader(IServiceProvider services, string filename, ExeImageLoader exe) : base(services, filename, exe.RawImage)
		{
			this.exe = exe;
            var cfgSvc = services.RequireService<IConfigurationService>();
            this.arch = cfgSvc.GetArchitecture("x86-real-16");
            this.platform = cfgSvc.GetEnvironment("ms-dos")
                .Load(services, arch);
		}
开发者ID:relaxar,项目名称:reko,代码行数:8,代码来源:MsdosImageLoader.cs

示例9: MsdosImageLoader

		public MsdosImageLoader(IServiceProvider services, string filename, ExeImageLoader exe) : base(services, filename, exe.RawImage)
		{
			this.exe = exe;
            this.arch = new IntelArchitecture(ProcessorMode.Real);
            this.platform = this.platform = services.RequireService<IConfigurationService>()
                .GetEnvironment("ms-dos")
                .Load(services, arch);
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:8,代码来源:MsdosImageLoader.cs

示例10: SetSite

 public void SetSite(IServiceProvider sp)
 {
     this.services = sp;
     if (services != null)
     {
         var uiUser = services.RequireService<IUiPreferencesService>();
         uiUser.UiPreferencesChanged += delegate { uiUser.UpdateControlStyle(UiStyles.List, listView); };
         uiUser.UpdateControlStyle(UiStyles.List, listView);
     }
 }
开发者ID:relaxar,项目名称:reko,代码行数:10,代码来源:DiagnosticsInteractor.cs

示例11: DecompilerDriver

 public DecompilerDriver(ILoader ldr, IServiceProvider services)
 {
     if (ldr == null)
         throw new ArgumentNullException("ldr");
     if (services == null)
         throw new ArgumentNullException("services");
     this.loader = ldr;
     this.host = services.RequireService<DecompilerHost>();
     this.services = services;
     this.eventListener = services.GetService<DecompilerEventListener>();
 }
开发者ID:uxmal,项目名称:reko,代码行数:11,代码来源:Decompiler.cs

示例12: LoadMemoryMapFromFile

 /// <summary>
 /// Loads an image map from a file containing the XML description of the
 /// segments inside.
 /// <param name="svc"></param>
 /// <param name="mmapFileName"></param>
 /// <param name="platform"></param>
 /// <returns></returns>
 public static MemoryMap_v1 LoadMemoryMapFromFile(IServiceProvider svc, string mmapFileName, IPlatform platform)
 {
     var cfgSvc = svc.RequireService<IConfigurationService>();
     var fsSvc = svc.RequireService<IFileSystemService>();
     var diagSvc = svc.RequireService<IDiagnosticsService>();
     try
     {
         var filePath = cfgSvc.GetInstallationRelativePath(mmapFileName);
         XmlSerializer ser = new XmlSerializer(typeof(MemoryMap_v1));
         using (var stm = fsSvc.CreateFileStream(filePath, FileMode.Open))
         {
             var mmap = (MemoryMap_v1)ser.Deserialize(stm);
             return mmap;
         }
     }
     catch (Exception ex)
     {
         diagSvc.Error(ex, string.Format("Unable to open memory map file '{0}.", mmapFileName));
         return null;
     }
 }
开发者ID:relaxar,项目名称:reko,代码行数:28,代码来源:MemoryMap_v1.cs

示例13: PkLiteUnpacker

		public PkLiteUnpacker(IServiceProvider services, string filename, byte [] rawImg) : base(services, filename, rawImg)
		{
            var exe = new ExeImageLoader(services, filename, rawImg);
            arch = new IntelArchitecture(ProcessorMode.Real);
            platform = services.RequireService<IConfigurationService>()
                .GetEnvironment("ms-dos")
                .Load(services, arch);

			uint pkLiteHdrOffset = (uint) (exe.e_cparHeader * 0x10);

			if (RawImage[pkLiteHdrOffset] != 0xB8)
				throw new ApplicationException(string.Format("Expected MOV AX,XXXX at offset 0x{0:X4}.", pkLiteHdrOffset));
			uint cparUncompressed = LoadedImage.ReadLeUInt16(RawImage, pkLiteHdrOffset + 1);
			abU = new byte[cparUncompressed * 0x10U];

			if (RawImage[pkLiteHdrOffset + 0x04C] != 0x83)
				throw new ApplicationException(string.Format("Expected ADD BX,+XX at offset 0x{0:X4}.", pkLiteHdrOffset + 0x04C));
			uint offCompressedData = pkLiteHdrOffset + RawImage[pkLiteHdrOffset + 0x04E] * 0x10u - PspSize;
			bitStm = new BitStream(RawImage, (int) offCompressedData);
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:20,代码来源:PkLiteUnpacker.cs

示例14: Scanner

 public Scanner(
     Program program, 
     IImportResolver importResolver,
     IServiceProvider services)
 {
     this.program = program;
     this.segmentMap = program.SegmentMap;
     this.importResolver = importResolver;
     this.Services = services;
     this.eventListener = services.RequireService<DecompilerEventListener>();
     this.cancelSvc = services.GetService<CancellationTokenSource>();
     if (segmentMap == null)
         throw new InvalidOperationException("Program must have an segment map.");
     if (program.ImageMap == null)
     {
         program.ImageMap = segmentMap.CreateImageMap();
     }
     this.imageMap = program.ImageMap;
     this.queue = new PriorityQueue<WorkItem>();
     this.blocks = new SortedList<Address, BlockRange>();
     this.blockStarts = new Dictionary<Block, Address>();
     this.pseudoProcs = program.PseudoProcedures;
     this.importReferences = program.ImportReferences;
     this.visitedProcs = new HashSet<Procedure>();
     this.noDecompiledProcs = new Dictionary<Address, Procedure_v1>();
 }
开发者ID:uxmal,项目名称:reko,代码行数:26,代码来源:Scanner.cs

示例15: MipsRelocator

 public MipsRelocator(IServiceProvider services, Program program) : base(program)
 {
     dcSvc = services.RequireService<DecompilerEventListener>();
 }
开发者ID:relaxar,项目名称:reko,代码行数:4,代码来源:MipsRelocator.cs


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