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

C# Castle类代码示例

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

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



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

示例1: Install

 public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
 {
     container.Register
         (
                 new NhibernateAssemblySourceForRegistration(typeof(User).Assembly)
         );
 }
开发者ID:mwojcik,项目名称:SportReservation,代码行数:7,代码来源:WindsorInstaller.cs


示例2: Kernel_ComponentRegistered

 private static void Kernel_ComponentRegistered(string key, Castle.MicroKernel.IHandler handler)
 {
     if (typeof(IApplicationService).IsAssignableFrom(handler.ComponentModel.Implementation))
     {
         handler.ComponentModel.Interceptors.Add(new InterceptorReference(typeof(ValidationInterceptor)));
     }
 }
开发者ID:dazyzsy,项目名称:ZBP,代码行数:7,代码来源:ValidationInterceptor.cs


示例3: Kernel_ComponentModelCreated

		static void Kernel_ComponentModelCreated(Castle.Core.ComponentModel model)
		{
			if (model.Services.First().IsGenericType && model.Services.First().GetGenericTypeDefinition().Equals(typeof(IHandleCommand<>)))
			{
				model.CustomComponentActivator = typeof(CommandHandlerComponentActivator);
			}
		}
开发者ID:gadjio,项目名称:Smi-Playground,代码行数:7,代码来源:CommandHandlerDecorationFacility.cs


示例4: Install

        public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
        {
            container.Register(Component.For<LastTasksByUserPresenter>()
                                        .Named("InnerLastTasksByUserPresenter")
                                        .LifeStyle.Transient);

            container.Register(Component.For<ILastTasksByUserPresenter>()
                                        .ImplementedBy<LastTasksByUserPresenterWithScope>()
                                        .ServiceOverrides(ServiceOverride.ForKey<ILastTasksByUserPresenter>().Eq("InnerLastTasksByUserPresenter"))
                                        .LifeStyle.Transient);

            container.Register(AllTypes.FromThisAssembly()
                .Where(Component.IsInSameNamespaceAs<IBlogsFromDatabasePresenter>())
                .WithService.DefaultInterface()
                .Configure(c => c.LifeStyle.Transient));

            //container.Register(AllTypes.FromThisAssembly()
            //    .Where(Component.IsInSameNamespaceAs<ILastTasksByUserPresenter>())
            //    .WithService.DefaultInterface()
            //    .Configure(c => c.LifeStyle.Transient));

            container.Register(AllTypes.FromThisAssembly()
                .Where(Component.IsInSameNamespaceAs<ILastTasksByUserQuery>())
                .WithService.DefaultInterface()
                .Configure(c => c.LifeStyle.Transient));

            container.Register(AllTypes.FromThisAssembly()
                .Where(Component.IsInSameNamespaceAs<IAddPostCommand>())
                .WithService.DefaultInterface()
                .Configure(c => c.LifeStyle.Transient));
        }
开发者ID:Detroier,项目名称:playground,代码行数:31,代码来源:PresentersInstaller.cs


示例5: Install

 public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
 {
     xrc.XrcWindsor.InstallExtension(container, System.Reflection.Assembly.Load("xrc.MVC4"));
     xrc.XrcWindsor.InstallExtension(container, System.Reflection.Assembly.Load("xrc.FileSystemPages"));
     xrc.XrcWindsor.InstallExtension(container, System.Reflection.Assembly.Load("xrc.Markdown"));
     xrc.XrcWindsor.InstallExtension(container, System.Reflection.Assembly.Load("DemoWebSite.Lib"));
 }
开发者ID:davideicardi,项目名称:xrc,代码行数:7,代码来源:CustomXrcInstaller.cs


示例6: Install

 public void Install(IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
 {
     container.Register(Component.For<Shell>());
     container.Register(Component.For<MainModule>());
     container.Register(Component.For<TeacherModule>());
     container.Register(Component.For<StackPanelRegionAdapter>());
 }
开发者ID:kwapisiewicz,项目名称:Edu,代码行数:7,代码来源:UIInstaller.cs


示例7: Instantiate

		protected override object Instantiate(Castle.MicroKernel.CreationContext context)
		{
			Type systemType = (Type) 
				Model.ExtendedProperties[PrevalenceFacility.SystemTypePropertyKey];
			String dir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, (String) 
				Model.ExtendedProperties[PrevalenceFacility.StorageDirPropertyKey]);
			bool autoVersionMigration = (bool) 
				Model.ExtendedProperties[PrevalenceFacility.AutoMigrationPropertyKey];
			bool resetStorage = (bool) 
				Model.ExtendedProperties[PrevalenceFacility.ResetStoragePropertyKey];
			float snapshotPeriod = (float)Model.ExtendedProperties[PrevalenceFacility.SnapshotPeriodPropertyKey];
			
			if (resetStorage)
			{
				DeleteStorageDir(dir);
			}

			PrevalenceEngine engine = PrevalenceActivator.CreateEngine( 
				systemType, 
				dir, 
				autoVersionMigration );

			if (snapshotPeriod > 0)
			{
				CreateSnapshotTaker(engine, snapshotPeriod);
			}

			return engine;
		}
开发者ID:ralescano,项目名称:castle,代码行数:29,代码来源:PrevalenceEngineComponentActivator.cs


示例8: Resolve

 protected override void Resolve(Castle.Windsor.IWindsorContainer windsor)
 {
     //提前注册桩
     windsor.RegisterComponent(typeof(ProcessServiceMock));
     windsor.RegisterComponent(typeof(SchedulerServiceMock));
     base.Resolve(windsor);
 }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:7,代码来源:SchedulerFaultResumptionTest.cs


示例9: Install

        public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
        {
            container.Register(
                Component.For<CommandExecutor>(),
                Component.For<AppCommands>(),
                Component.For<TextChangedTrigger>(),

                Component.For<TasksModule>(),

                Component.For<ProgramService>(),

                Component.For<AppValueProvider>(),
                Component.For<VariablesStorage>(),

                Component.For<Context>(),

                Component.For<XmlDataSource<ItemsDb>>(),
                Component.For<DataStorage<ItemsDb>>(),

                Component.For<ProgramCommand>(),
                Component.For<StartProcessCommand>(),
                Component.For<TasksCommand>(),

                Component.For<MainViewModel>());
        }
开发者ID:AliAboSaada,项目名称:windows-home-panel,代码行数:25,代码来源:ContainerInstaller.cs


示例10: Install

 public void Install(Castle.Windsor.IWindsorContainer container,
 Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
 {
     container.Register(Classes.FromThisAssembly()
      .BasedOn<ApiController>()
      .LifestylePerWebRequest());
 }
开发者ID:jay81979,项目名称:XmlEdit,代码行数:7,代码来源:WindsorDependencyResolver.cs


示例11: Install

		public void Install(IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
		{
			// use installer.
			// container.Install(new PersonInstaller());

			container.Register(Component.For<IPerson>().ImplementedBy<Person>());
		}
开发者ID:LoveJenny,项目名称:Examples,代码行数:7,代码来源:PersonInstaller.cs


示例12: Start

    // Use this for initialization
    void Start()
    {
        direction = Random.Range(0,2);
        droppedBomb = true;
        enemy = this.GetComponent<Rigidbody2D>();
        enemyPosition = enemy.transform.position;
        animations = this.GetComponent<Animator>();
        healthdecrease = GameObject.FindGameObjectWithTag("Castle").GetComponent<Castle>();
        rightToLeft = new Vector3(1,1,1);
        leftToRight = new Vector3(-1,1,1);
        doNotMove = false;

        this.GetComponent<AudioSource>().clip = myclip;

        if (direction == 0)
        {
            tempVar = new Vector3 (9f, 0f, 0f);
            enemy.transform.position = tempVar;
        }
        else
        {
            tempVar = new Vector3 (9f, 0f, 0f);
            enemy.transform.position = -tempVar;
        }
    }
开发者ID:BhavikHMehta,项目名称:Myo-Defense,代码行数:26,代码来源:EnemyFlying.cs


示例13: Install

 public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
 {
     container.Register(
       Classes.FromThisAssembly()
       .BasedOn(typeof(System.Web.Mvc.ControllerBase))
       .LifestyleTransient());
 }
开发者ID:CezaryRynkowski,项目名称:NHibernateMVC,代码行数:7,代码来源:ControllerInstaller.cs


示例14: Install

 public void Install(IWindsorContainer container, Castle.MicroKernel.IConfigurationStore store)
 {
     container
         .Register(Component.For<IPostService>()
                   	.ImplementedBy<PostService>())
         .Register(Component.For<IMailService>()
                   	.ImplementedBy<MailService>())
         .Register(Component.For<IFriendlyUrlGenerator>()
                   	.ImplementedBy<FriendlyUrlGenerator>())
         .Register(AllTypes.Of(typeof (IValidatorBase<>))
                   	.FromAssemblyNamed("BlogSharp.Model")
                   	.WithService.FromInterface(typeof (IValidatorBase<>))
                   	.Configure(x => x.LifeStyle.Transient))
         .AddFacility<ControllerRegisterFacility>()
         .Register(AllTypes.Of<IController>()
                   	.FromAssemblyNamed("BlogSharp.Web").Configure(x => x.LifeStyle.Transient))
         .Register(Component.For<IExtendedControllerFactory>()
                   	.ImplementedBy<WindsorControllerFactory>())
         .Register(AllTypes.Of<IStartupInstaller>()
                   	.FromAssemblyNamed("BlogSharp.Core.Impl")
                   	.WithService.FirstInterface())
         .Register(AllTypes.Of<IHttpModule>()
                   	.FromAssemblyNamed("BlogSharp.Core.Impl"))
         .Register(Component.For<BlogContextProvider>()
                   	.ImplementedBy<WebBlogContextProvider>());
 }
开发者ID:DogaOztuzun,项目名称:BlogSharp,代码行数:26,代码来源:DefaultComponentInstallers.cs


示例15: Init

 public void Init(IKernel kernel, Castle.Core.Configuration.IConfiguration facilityConfig)
 {
     InterceptorFactory.Create = new InterceptorFactory.CreateInterceptor(delegate()
     {
         return new AuditInterceptor(kernel);
     });
 }
开发者ID:julienblin,项目名称:Colibri,代码行数:7,代码来源:AuditFacility.cs


示例16: Install

 protected override void Install(Castle.Windsor.IWindsorContainer container)
 {
   container.Register(Classes.FromThisAssembly()
     .BasedOn(typeof (Task))
     .WithService.Self()
     .LifestyleTransient());
 }
开发者ID:leloulight,项目名称:magicgrove,代码行数:7,代码来源:IoC.cs


示例17: Install

 public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
 {
     container.Register(AllTypes.FromThisAssembly()
                                .Where(Component.IsInSameNamespaceAs<ICurrentSiteAccesor>())
                                .WithService.DefaultInterface()
                                .Configure(c => c.LifeStyle.Transient));
 }
开发者ID:Detroier,项目名称:playground,代码行数:7,代码来源:SPAccesorsInstaller.cs


示例18: Install

 public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
 {
     container.Register(
         Component.For<IPolicyViolationHandler>()
                  .LifeStyle.Transient);
     container.ResolveAll<IPolicyViolationHandler>();
 }
开发者ID:Gwayaboy,项目名称:iDeal,代码行数:7,代码来源:FluentSecurityInstaller.cs


示例19: Install

 public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
 {
     container.Register(
         Component.For<ContentFilterManager>(),
         Component.For<ContentFormatBuilder>()
         );
 }
开发者ID:ProximoSrl,项目名称:Jarvis.DocumentStore,代码行数:7,代码来源:WindsorInstaller.cs


示例20: NotifyBlogRemoved

		public void NotifyBlogRemoved(Castle.Applications.MindDump.Model.Blog blog)
		{
			foreach(IMindDumpEventSubscriber subs in _subscribers)
			{
				subs.OnBlogRemoved(blog);
			}
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:7,代码来源:MindDumpEventChannel.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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