問題タブ [interception]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - 属性によるC#ユニティインターセプト
C# unity で属性による傍受を使用し、オブジェクト登録コードを XML ファイル (app.config など) に保持する方法はありますか? はいの場合、コードを提供していただけますか?そのような登録はどのように表示されますか? 多くの回避策を実行しましたが、この問題に対する有効な解決策が見つかりませんでした。
c# - Unity インターセプト GetCustomAttribute
よろしくお願いします。(はい、一番下に質問があります)
Unity 3.x Interception を使用して、AOP 前後のデータベース接続とトランザクション アクティビティを実行しています。データベース インターセプターは常にインスタンス化され、トランザクション インターセプターは CustomAttributeMatchingRule ベースであり、両方とも InterfaceInterceptor を介して行われます。TransactionAttribute に設定されているプロパティがあります。
単体テストで使用している例として。TransactionCallHandler クラスの呼び出しメソッドでそれらにアクセスしたいと思います。私は言っている例を見てきました
これにアクセスする方法ですが、私のトランザクション変数は null です。私の結論は、元の具体的なインスタンスではなく、カスタム属性についてインターセプト プロキシ クラスがチェックされているということです。
これに対する私の回避策は、クラスレベルまでさかのぼって反映し、掘り下げてインターセプトされている正しいメソッドが何であるかを突き止め、そこからカスタム属性の取得を実行することです。
(メソッドにオーバーロードがある場合に間違ったメソッド名にアクセスしないようにするために、さらに約 30 行のコードがあります。したがって、パフォーマンスが低下します...)
結局のところ、私の質問は次のとおりです。反射を正しく実行していませんか? Unity に報告すべきバグはありますか?
これが私のコンテナ定義です:
wso2 - WSO2 ESB: 着信メッセージの傍受
ESB のすべての着信メッセージをインターセプトする方法は?
ESB が受信するすべてのメッセージを処理したい。ESB のハンドラとモジュールを使用してこの作業を行うことはできますか?
c - 有限線切片 C をチェック
2 つの有限線が互いに交差するかどうかをチェックする関数を作成しようとしています ( 0 または 1 を返します)。
まず、これらの構造体を宣言します
より、ここで関数を開始します。
次の値を持つテストのように、一部のテストが機能しない理由がわかりません。
問題を見つけることができず、機能するアルゴリズムを知っていれば、それも素晴らしいことです。前もって感謝します!
c# - AOP Ninject インターセプトされたメソッドが呼び出されないようにする
Ninject と AOP を使用してキャッシングを行っています。リポジトリ内の任意のメソッドに適用できる属性があり、BeforeInvoke ではキャッシュされたオブジェクトがあればそれを返し、AfterInvoke はキャッシュされたオブジェクトを作成します。これはすべてうまく機能しますが、初期メソッドの呼び出しを停止する方法がわかりません。つまり、キャッシュされたオブジェクトがある場合、intyercepted メソッドを呼び出す代わりにそれを返します。私のインターセプターはここにあります:
else ステートメントでは、呼び出されたメソッド 'invocation.Proceed();' を呼び出すように明確に言っていません。それはまだそれを呼び出します。ninject に invocation.ReturnValue で戻るように指示するにはどうすればよいですか?
caching - Unity.WebApi エラー: 渡された型はインターフェイスでなければなりません
そのため、MVC アプリケーションに Unity.WebApi がインストールされています。「Areas」というフォルダーには Web API セクションもあります。
私は、Web API のポリシー インジェクションと属性を介してキャッシングを実装するように接続している最中です。
これが私の Bootstrapper.cs クラスです。
そして、global.asax には次のようなものがあります。
私はすでに cachingAttribute と cachingCallHandler を実装しています。そして、webapi メソッドに属性を付けて、キャッシング機能を持たせたいと考えています。
ここでは、ほとんどのものが正しく実装されていると思います。しかし、URLからAPIメソッドにアクセスすると、このエラーが発生し続けます
渡されるタイプはインターフェースでなければなりません。System.ArgumentException
System.RuntimeTypeHandle.VerifyInterfaceIsImplemented (RuntimeTypeHandle ハンドル、RuntimeTypeHandle interfaceHandle) で System.RuntimeType.GetInterfaceMap (タイプ ifaceType) で Microsoft.Practices.Unity.InterceptionExtension.InterfaceInterceptor.d__0.MoveNext() で Microsoft.Practices.Unity.InterceptionExtension.PolicyInjectionBehavior. Microsoft.Practices.ObjectBuilder2.DynamicBuildPlanGenerationContext.<>c_DisplayClass1.b の lambda_method(Closure 、IBuilderContext ) での .ctor(CurrentInterceptionRequestinterceptionRequest、InjectionPolicy[] ポリシー、IUnityContainer コンテナー)Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext コンテキスト) の _0(IBuilderContext コンテキスト) Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext コンテキスト) の Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext コンテキスト)。 Practices.ObjectBuilder2.BuilderContext.NewBuildUp(NamedTypeBuildKey newBuildKey, Action
1 childCustomizationBlock) at Microsoft.Practices.Unity.InterceptionExtension.InterceptionBehaviorsPolicy.<GetEffectiveBehaviors>d__4.MoveNext() at System.Linq.Buffer
1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source) Microsoft.Practices.Unity.InterceptionExtension.InstanceInterceptionStrategy.PostBuildUp(IBuilderContext context) at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) ) Microsoft.Practices.Unity.UnityContainer.DoBuildUp (型 t、オブジェクトの存在、文字列名、IEnumerable`1 resolverOverrides) で
c# - Unity Interception with WPF and INotifyPropertyChanged
I've been doing a refactor of an existing application, and I am attempting to use an Attribute on a property to trigger the NotifyPropertyChanged event using Unity interception. I got to the point where the event was firing, but the controls were not updating.
I wasn't sure if it was invoking the event correctly, so on my ViewModelBase I created a DispatchPropertyChanged method that invokes the property changed event. This method works to launch property changed when called directly from a view model, but when called from a ViewModel retrieved through reflection inside the intercept handler, it doesn't work.
I've inserted a link to the https://www.dropbox.com/s/9qg2n0gd2n62elc/WPFUnityTest.zip. If you open this solution and run the application, then click the "Reset" button, you'll see that the "Normal" text box updates, but the "Unity" text box does not update.
If you place a breakpoint at line 65 of the MainWindowViewModel and line 53 of the NotifyPropertyChangedHandler you'll see that the handler is working, the dispatch method is being called, and the event is being invoked. However, only the "Normal" one updates.
Any help on why the "Unity" text box isn't updating would be wonderful, thanks!
Amanda
EDIT:
Sorry for not including this originally, I really had no idea where the problem was. This was the original code for the interception behavior that was correct below: