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


C# Binder.bind方法代码示例

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


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

示例1: configure

        public override void configure(Binder binder)
        {
            binder.bind(typeof(AbstractTranslator)).to(typeof(StaticTranslator));

            //Everyone in this context gets this same DemoEventBus
            binder.bind(typeof(AbstractEventBus)).to(typeof(DemoEventBus));
            binder.bind(typeof(DemoEventBus)).inScope(Scope.Context).to(typeof(DemoEventBus));
        }
开发者ID:griffith-computing,项目名称:RandoriSampleSolution,代码行数:8,代码来源:DemoContext.cs

示例2: configure

        public override void configure(Binder binder)
        {
            //make the StyleExtensionMap a Singleton
            binder.bind(typeof(StyleExtensionMap)).inScope(Scope.Singleton).to(typeof(StyleExtensionMap));

            //Setup a NoOp translator as the default
            binder.bind(typeof(AbstractTranslator)).to(typeof(NoOpTranslator));
        }
开发者ID:griffith-computing,项目名称:Randori,代码行数:8,代码来源:RandoriModule.cs

示例3: ChildInjector

        public ChildInjector(Binder binder, ClassResolver classResolver, Injector parentInjector)
            : base(binder, classResolver)
        {
            this.parentInjector = parentInjector;

            //Child injectors set themselves up as the new default Injector for the tree below them
            binder.bind(typeof(Injector)).toInstance(this);
        }
开发者ID:griffith-computing,项目名称:RandoriGuiceJS,代码行数:8,代码来源:ChildInjector.cs

示例4: createInjector

        public Injector createInjector(GuiceModule module)
        {
            var hashMap = new BindingHashMap();
            var binder = new Binder( hashMap );
            var loader = new SynchronousClassLoader(new XMLHttpRequest(), "generated/");
            var classResolver = new ClassResolver( loader );

            if (module != null) {
                module.configure(binder);
            }

            var injector = new Injector(binder, classResolver);
            binder.bind(typeof(Injector)).toInstance(injector);
            binder.bind(typeof(ClassResolver)).toInstance(classResolver);
            binder.bind(typeof(SynchronousClassLoader)).toInstance(loader);

            return injector;
        }
开发者ID:griffith-computing,项目名称:RandoriGuiceJS,代码行数:18,代码来源:GuiceJS.cs


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