私はCastle Windsorでいくつかのプロジェクトをやっていますが、設定ファイル のインターセプタフックに関するいくつかの問題があります。私はimpages IProxyGenerationHook
クラスを作成しました:Castle Windsorインターセプターセレクターとフック
public class LoggingProxyGenerationHook : IProxyGenerationHook
{
#region IProxyGenerationHook Members
public void MethodsInspected()
{
//throw new Exception("The method or operation is not implemented.");
}
public void NonVirtualMemberNotification(Type type, System.Reflection.MemberInfo memberInfo)
{
//throw new Exception("The method or operation is not implemented.");
}
public bool ShouldInterceptMethod(Type type, System.Reflection.MethodInfo methodInfo)
{
return methodInfo.Name.StartsWith("Save", StringComparison.Ordinal);
}
#endregion
}
私がしたいのは、 「保存」し、設定ファイルに動的にフックします。
また、設定ファイルには次のものがあります:<component id="LoggingAspect" type="DynamicInterceptor.LoggingAspect, DynamicInterceptor"></component>
<component id="LoggingProxyGenerationHook" type="DynamicInterceptor.LoggingProxyGenerationHook, DynamicInterceptor"></component>
<component id="TestClass1" type="TestClasses.TestClass1, TestClasses">
<interceptors hook ="${LoggingProxyGenerationHook}">
<interceptor>${LoggingAspect}</interceptor>
</interceptors>
</component>
私は設定ファイルに何か間違っていると思います。 どんなアイデアですか?
あなたは期待していたことはありませんか? –
フィルタリングしていないということはどういう意味ですか?呼び出されていないか、その戻り値が無視されていますか?または、他の何か?あなたが誰かを助けてくれるようにしたいなら、もっと精巧にしてください。推測を残さないでください。 –
@nikolavas:これは公正なことではありません。 Krzysztofは城に関する多くの時間と労力を費やしており、城のドキュメンテーションを多く改善しています。 –