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

C# IPlatform类代码示例

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

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



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

示例1: ConditionCodeEliminator

        public ConditionCodeEliminator(SsaState ssa, IPlatform arch)
		{
            this.ssa=ssa;
			this.ssaIds = ssa.Identifiers;
            this.platform = arch;
            this.m = new ExpressionEmitter();
		}
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:ConditionCodeEliminator.cs


示例2: XmlConverter

  public XmlConverter(TextReader rdr, XmlWriter writer, IPlatform platform)
  {
      this.rdr = rdr;
      this.writer = writer;
      this.platform = platform;
      this.parserState = new ParserState();
 }
开发者ID:uxmal,项目名称:reko,代码行数:7,代码来源:XmlConverter.cs


示例3: Program

 public Program(LoadedImage image, ImageMap imageMap, IProcessorArchitecture arch, IPlatform platform) : this()
 {
     this.Image = image;
     this.ImageMap = imageMap;
     this.Architecture = arch;
     this.Platform = platform;
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:Program.cs


示例4: Load

 public TypeLibrary Load(IPlatform platform, string module, TypeLibrary dstLib)
 {
     this.platform = platform;
     this.tlLoader = new TypeLibraryDeserializer(platform, true, dstLib);
     this.moduleName = module;
     tlLoader.SetModuleName(module);
     for (;;)
     {
         var tok = Peek();
         if (tok.Type == TokenType.EOF)
             break;
         if (PeekAndDiscard(TokenType.NL))
             continue;
         var line =  ParseLine();
         if (line != null)
         {
             if (line.Item1.HasValue)
             {
                 tlLoader.LoadService(line.Item1.Value, line.Item2);
             }
             else
             {
                 tlLoader.LoadService(line.Item2.Name, line.Item2);
             }
         }
     }
     return dstLib;
 }
开发者ID:uxmal,项目名称:reko,代码行数:28,代码来源:WineSpecFileLoader.cs


示例5: Program

 public Program(SegmentMap segmentMap, IProcessorArchitecture arch, IPlatform platform) : this()
 {
     this.SegmentMap = segmentMap;
     this.ImageMap = segmentMap.CreateImageMap();
     this.Architecture = arch;
     this.Platform = platform;
 }
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:Program.cs


示例6: ResolveProcedure

        public ExternalProcedure ResolveProcedure(string moduleName, string importName, IPlatform platform)
        {
            foreach (var program in project.Programs)
            {
                ModuleDescriptor mod;
                if (!program.Metadata.Modules.TryGetValue(moduleName, out mod))
                    continue;

                SystemService svc;
                if (mod.ServicesByName.TryGetValue(importName, out svc))
                {
                    return new ExternalProcedure(svc.Name, svc.Signature, svc.Characteristics);
                }
            }

            foreach (var program in project.Programs)
            {
                ProcedureSignature sig;
                if (program.Metadata.Signatures.TryGetValue(importName, out sig))
                {
                    return new ExternalProcedure(importName, sig);
                }
            }

            return platform.LookupProcedureByName(moduleName, importName);
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:26,代码来源:ImportResolver.cs


示例7: DataManager

        // ctor

        /// <summary>
        /// Initializes a new instance of the <see cref="DataManager"/> class.
        /// </summary>
        /// <param name="platform">The platform.</param>
        public DataManager(IPlatform platform)
        {
            _platform = platform;
            AppService = new AppService();

            _current = this;
        }
开发者ID:reactiveui-forks,项目名称:ReactiveUI.Xamarin.Samples,代码行数:13,代码来源:DataManager.cs


示例8: CreatePlatform

        public IPlatform CreatePlatform()
        {
            if (platform != null)
                return platform;

            platform = mr.Stub<IPlatform>();

            platform.Stub(p => p.Name).Return("TestPlatform");
            platform.Stub(p => p.PointerType).Return(PrimitiveType.Pointer32);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Char)).Return(1);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Short)).Return(2);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Int)).Return(4);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Long)).Return(4);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.LongLong)).Return(8);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Float)).Return(4);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Double)).Return(8);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.LongDouble)).Return(8);
            platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Int64)).Return(8);
            platform.Stub(p => p.CreateMetadata()).Do(new Func<TypeLibrary>(() => this.platformMetadata.Clone()));
            var arch = new X86ArchitectureFlat32();
            platform.Stub(p => p.Architecture).Return(arch);
            platform.Stub(p => p.DefaultCallingConvention).Return("__cdecl");

            platform.Stub(s => s.CreateProcedureSerializer(null, null)).IgnoreArguments().Do(
                new Func<ISerializedTypeVisitor<DataType>, string, ProcedureSerializer>((tlDeser, dc) =>
                    new X86ProcedureSerializer(arch, tlDeser, dc)
                )
            );
            platform.Stub(p => p.SaveUserOptions()).Return(null);

            platform.Replay();
            return platform;
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:33,代码来源:MockFactory.cs


示例9: ResolveProcedure

        public ExternalProcedure ResolveProcedure(string moduleName, string importName, IPlatform platform)
        {
            if (!string.IsNullOrEmpty(moduleName))
            {
                foreach (var program in project.Programs)
                {
                    ModuleDescriptor mod;
                    if (!program.EnvironmentMetadata.Modules.TryGetValue(moduleName, out mod))
                        continue;

                    SystemService svc;
                    if (mod.ServicesByName.TryGetValue(importName, out svc))
                    {
                        return new ExternalProcedure(svc.Name, svc.Signature, svc.Characteristics);
                    }
                }
            }

            foreach (var program in project.Programs)
            {
                FunctionType sig;
                if (program.EnvironmentMetadata.Signatures.TryGetValue(importName, out sig))
                {
                    var chr = platform.LookupCharacteristicsByName(importName);
                    if (chr != null)
                        return new ExternalProcedure(importName, sig, chr);
                    else
                        return new ExternalProcedure(importName, sig);
                }
            }

            return platform.LookupProcedureByName(moduleName, importName);
        }
开发者ID:relaxar,项目名称:reko,代码行数:33,代码来源:ImportResolver.cs


示例10: Build

		public SystemService Build(IPlatform platform, TypeLibrary library)
		{
			SystemService svc = new SystemService();
			svc.Name = Name;
			svc.SyscallInfo = new SyscallInfo();
            svc.SyscallInfo.Vector = SyscallInfo != null
                ? Convert.ToInt32(SyscallInfo.Vector, 16)
                : this.Ordinal;
            if (SyscallInfo != null)
            {
                if (SyscallInfo.RegisterValues != null)
                {
                    svc.SyscallInfo.RegisterValues = new RegValue[SyscallInfo.RegisterValues.Length];
                    for (int i = 0; i < SyscallInfo.RegisterValues.Length; ++i)
                    {
                        svc.SyscallInfo.RegisterValues[i] = new RegValue
                        {
                            Register = platform.Architecture.GetRegister(SyscallInfo.RegisterValues[i].Register),
                            Value = Convert.ToInt32(SyscallInfo.RegisterValues[i].Value, 16),
                        };
                    }
                }
            }
			if (svc.SyscallInfo.RegisterValues == null)
			{
				svc.SyscallInfo.RegisterValues = new RegValue[0];
			}
            TypeLibraryDeserializer loader = new TypeLibraryDeserializer(platform, true, library);
			var sser = platform.CreateProcedureSerializer(loader, "stdapi");
            svc.Signature = sser.Deserialize(Signature, platform.Architecture.CreateFrame());
			svc.Characteristics = Characteristics != null ? Characteristics : DefaultProcedureCharacteristics.Instance;
			return svc;
		}
开发者ID:relaxar,项目名称:reko,代码行数:33,代码来源:SerializedService.cs


示例11: ProcessDeclaration

 public void ProcessDeclaration(Decl declaration, IPlatform platform, TypeLibraryDeserializer tldser, SymbolTable symbolTable)
 {
     var types = symbolTable.AddDeclaration(declaration);
     var type = types[0];
     int? vectorOffset = GetVectorOffset(declaration);
     if (vectorOffset.HasValue)
     {
         var ntde = new NamedDataTypeExtractor(platform, declaration.decl_specs, symbolTable);
         foreach (var declarator in declaration.init_declarator_list)
         {
             var nt = ntde.GetNameAndType(declarator.Declarator);
             var ssig = (SerializedSignature)nt.DataType;
             if (ssig.ReturnValue != null)
             {
                 ssig.ReturnValue.Kind = ntde.GetArgumentKindFromAttributes(
                     "returns", declaration.attribute_list);
             }
             var sser = platform.CreateProcedureSerializer(tldser, platform.DefaultCallingConvention);
             var sig = sser.Deserialize(ssig, platform.Architecture.CreateFrame());
             SystemServices.Add(
                 vectorOffset.Value,
                 new SystemService
                 {
                     Name = nt.Name,
                     SyscallInfo = new SyscallInfo
                     {
                         Vector = vectorOffset.Value,
                     },
                     Signature = sig,
                 });
         }
     }
 }
开发者ID:relaxar,项目名称:reko,代码行数:33,代码来源:AmigaHeaderLoader.cs


示例12: LoginFacebookAsync

 private static Task<MobileServiceUser> LoginFacebookAsync(IPlatform mobileClient)
 {
     // use server flow if the service URL has been customized
     return Settings.IsDefaultServiceUrl() ?
         mobileClient.LoginFacebookAsync() :
         mobileClient.LoginAsync(MobileServiceAuthenticationProvider.Facebook);
 }
开发者ID:lindydonna,项目名称:ContosoMoments,代码行数:7,代码来源:AuthHandler.cs


示例13: PlatformKernel

        public PlatformKernel(IPlatform platform)
        {
            var runtimeModule = GetRuntimeModule(platform);
            Load(runtimeModule);

            AddBindingResolver<IDisplay>(DisplayBindingResolver);
        }
开发者ID:petriw,项目名称:Balder,代码行数:7,代码来源:PlatformKernel.cs


示例14: DataTypeBuilder

		public DataTypeBuilder(TypeFactory factory, ITypeStore store, IPlatform platform)
		{
			this.store = store;
			this.factory = factory;
			this.unifier = new DataTypeBuilderUnifier(factory, store);
            this.platform = platform;
		}
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:DataTypeBuilder.cs


示例15: Sound

        public Sound(IPlatform platform, SoundSettings soundSettings)
        {
            soundEngine = platform.CreateSound(soundSettings.Device);

            if (soundSettings.Mute)
                MuteAudio();
        }
开发者ID:OpenRA,项目名称:OpenRA,代码行数:7,代码来源:Sound.cs


示例16: BuildTest

        private void BuildTest(Address addrBase, IPlatform platform , Action<X86Assembler> asmProg)
        {
            var sc = new ServiceContainer();
            sc.AddService<DecompilerEventListener>(new FakeDecompilerEventListener());
            sc.AddService<DecompilerHost>(new FakeDecompilerHost());
            sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
            var entryPoints = new List<EntryPoint>();
            var asm = new X86Assembler(sc, platform, addrBase, entryPoints);
            asmProg(asm);

            var lr = asm.GetImage();
            program = new Program(
                lr.Image,
                lr.ImageMap,
                arch,
                platform);
            var project = new Project { Programs = { program } };
            scanner = new Scanner(
                program,
                new Dictionary<Address, ProcedureSignature>(),
                new ImportResolver(project),
                sc);
            scanner.EnqueueEntryPoint(new EntryPoint(addrBase, arch.CreateProcessorState()));
            scanner.ScanImage();
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:25,代码来源:Scanner.X86Tests.cs


示例17: Given_Platform

 private void Given_Platform(IPlatform platform)
 {
     this.oe = mr.Stub<OperatingEnvironment>();
     this.platform = platform;
     this.cfgSvc.Stub(c => c.GetEnvironment("testOS")).Return(oe);
     oe.Stub(e => e.Load(sc, null)).IgnoreArguments().Return(platform);
 }
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:ProjectLoaderTests.cs


示例18: Given_TestOS

 private void Given_TestOS()
 {
     this.oe = mr.Stub<OperatingEnvironment>();
     this.platform = mr.Stub<IPlatform>();
     this.cfgSvc.Stub(c => c.GetEnvironment("testOS")).Return(oe);
     oe.Stub(e => e.Load(sc, null)).IgnoreArguments().Return(platform);
     this.platform.Stub(p => p.CreateMetadata()).Return(new TypeLibrary());
 }
开发者ID:relaxar,项目名称:reko,代码行数:8,代码来源:ProjectLoaderTests.cs


示例19: Initialize

 public static void Initialize(IPlatform platform)
 {
     if( null != Kernel )
     {
         throw new ArgumentException("Kernel has already been initialized");
     }
     Kernel = new PlatformKernel(platform);
 }
开发者ID:petriw,项目名称:Balder,代码行数:8,代码来源:KernelContainer.cs


示例20: Load

 public override TypeLibrary Load(IPlatform platform, TypeLibrary dstLib)
 {
     var ser = SerializedLibrary.CreateSerializer();
     var slib = (SerializedLibrary) ser.Deserialize(stream);
     var tldser = new TypeLibraryDeserializer(platform, true, dstLib);
     var tlib = tldser.Load(slib);
     return tlib;
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:8,代码来源:TypeLibraryLoader.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IPlaybackManager类代码示例发布时间:2022-05-24
下一篇:
C# IPlace类代码示例发布时间: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