castle

help building castle dynamic proxy

走远了吗. 提交于 2019-12-08 17:46:30
So I pulled the source from https://svn.castleproject.org/svn/castle/DynamicProxy/trunk/ Open it up in vs.net 2008 problems: vs.net can't open the assembly.cs assembly signing failed What am I doing, rather NOT doing? Update So I downloaded nant, setup the .bat file in my PATH so it works in cmd prompt. I ran: nant default.build Getting this error: build failed, \buildscripts\common-project.xml (48,3) invalid element . Unknown task or datatype. How exactly do I build the dynamicProxy project now? update This is what I did, see screenshot: oh and my nant is: @echo off "E:\dev\tools\nant-bin

help building castle dynamic proxy

杀马特。学长 韩版系。学妹 提交于 2019-12-08 04:55:33
问题 So I pulled the source from https://svn.castleproject.org/svn/castle/DynamicProxy/trunk/ Open it up in vs.net 2008 problems: vs.net can't open the assembly.cs assembly signing failed What am I doing, rather NOT doing? Update So I downloaded nant, setup the .bat file in my PATH so it works in cmd prompt. I ran: nant default.build Getting this error: build failed, \buildscripts\common-project.xml (48,3) invalid element . Unknown task or datatype. How exactly do I build the dynamicProxy project

Castle windsor and IHttpHandler and IHttpHandlerFactory

我的未来我决定 提交于 2019-12-08 02:03:52
问题 I'm developing a RIA application where there is javascript on the client (i'm using Ext) and .NET on the server, for json-rpc I'm using Jayrock which is a nice library (at least for me) as it is simple and works well, Ive used it in the past. Jayrock uses Web Handlers to serve the json-rpc request, you code a class that implements IHttpHandler and derives from a Jayrock class with some attributes, and it does the rest to provide a javascript class to the browser to do its magic. Now, normally

What is the difference between NET40-RequiresCastle and NET40 version of Moq?

吃可爱长大的小学妹 提交于 2019-12-07 22:41:05
问题 In the distribution of moq, there are two versions, NET40-RequiresCastle and NET40. The NET40-RequiresCastle seems to have much smaller size than the NET40, but requires Castle during runtime. Is the difference only the fact that Castle is embedded inside the NET40 version, or is there going to be difference in performance, usage, etc? Is there a reason to use NET40-RequiresCastle instead of NET40? 回答1: MoQ uses Castle DynamicProxy for proxy generation. In order to simplify the deploy that

Intercept or Decorate calls to ILogger

ぃ、小莉子 提交于 2019-12-07 09:08:42
问题 I'm currently using castle windsor, along with it's logging facility in my application. However, in my logging I would like to include some contextual information that is not within the logged message, but stored within the CallContext. I have tried to do this by intercepting the calls to ILogger using the following: internal class Program { private static void Main(string[] args) { var container = new WindsorContainer(); container.AddFacility<LoggingFacility>(f => f.UseNLog()); container

Configuring Castle Windsor using xml/app.config

拈花ヽ惹草 提交于 2019-12-07 04:36:51
问题 I am currently building a sample application using Castle Windsor. The motto is to use xml/app.config to switch method interception on/off. I had used the Fluent API earlier and it worked as a charm. As the next step, I am trying to replace the fluent API with my xml. The gist of the code is as follows: A class called RandomOperations with two virtual methods. A LoggingAspect class which implements IInterceptor. A MyInterceptorsSelector class which implements IModelInterceptorsSelector A

Is there an equivalent to Monorail view components for the ASP.Net MVC Framework?

醉酒当歌 提交于 2019-12-06 04:12:02
问题 I make heavy use of View Components in some of the larger applications I've built in Monorail - What is the equivalent approach in ASP.Net MVC for a view component, that can support sections etc.? 回答1: Actually you have several options to create the equivalent of a ViewComponent in ASP.NET MVC, depending in the complexity of your component. I use these two approaches which are the more mvc-ish of the options I am aware of. 1: The simplest thing is to create a ViewUserControl and display it

Passing parameters to UsingFactoryMethod in Castle Windsor

可紊 提交于 2019-12-06 03:14:31
How do I pass dynamic parameters to a UsingFactoryMethod registration? For example, I want to write something like: container.Register( Component.For<IFoo>() .UsingFactoryMethod(return DoSomethingAndReturnInstance(paremeter))); I need the parameters to be sent at runtime, like this: container.Resolve<IFoo>(new { parameter = value }); How can it be done? CreationContext.AdditionalParameters has the values you pass to Resolve You just have to use container.Register( Component.For<IFoo>() .UsingFactoryMethod((kernel, creationContext) => { var parameter = creationContext.AdditionalArguments[

Handling PropertyChanging/PropertyChanged via Castle's DynamicProxy

六眼飞鱼酱① 提交于 2019-12-04 19:29:39
I currently have a setter method which looks like this: private string _a; public virtual string A { get { return _a; } set { if (_a!= value) { if (this.OnPropertyChanging("A", _a, value)) { var previousValue = _a; _a = value; this.OnPropertyChanged("A", previousValue, value); } } } } I have implemented this with help from Dr Wily's Apprentice (http://stackoverflow.com/a/8578507/981225), with a custom Changing handler that keeps track of the old and current value, as well as the ability to set the Changing event as 'Cancelled', such that the PropertyChange will not occur. This works perfectly.

WPF + Castle Windsor + MVVM: Locator-DataContext

半腔热情 提交于 2019-12-04 18:47:44
Edit: I have found one method to do this but I'm not sure if it is the best way. In WindsorContainer initialization, first I register viewmodel: container.Register(Component.For<CentrosViewModel>().LifeStyle.Transient); and later I register the View container.Register(Component.For<CentrosAdminView>().LifeStyle.Transient.DependsOn(Property.ForKey("DataContext") .Eq(ViewModelLocator.Centrosviewmodel))); And definition of property ViewModelLocator.Centrosviewmodel is: public static CentrosModel Centrosviewmodel { get { return App.container.Resolve<CentrosViewModel>(); } } End Edit I'm trying to