castle-dynamicproxy

    0熱度

    1回答

    我一直在努力從我的應用程序中刪除大量代碼重複,特別是在我的模型周圍。幾個模型也有一個集合變體,它是模型類型的IEnumerable。以前所有的集合變體都是單獨的實現,但我能夠將他們的大部分代碼合併到一個ModelCollection基類中。 現在,在這些集合模型之上是帶有分頁值的附加模型,它們都具有完全相同的屬性,所以我也想將它們摺疊到一個基類中。我遇到的問題是,.NET不支持多繼承,因爲每個Mo

    4熱度

    1回答

    我們有以下的/紙JSON響應/ 15 { "data": [ { "id": 1, "title": "foo" }, { "id": 2, "title": "bar" } ], "meta": { "total": 15 } } 有誰知道如何來形容它招

    1熱度

    1回答

    我試圖訪問應用於城堡攔截器內的方法的自定義屬性,但方法Attribute.GetCustomAttribute()返回null。 public class MyIntecept : Castle.DynamicProxy.IInterceptor { public void Intercept(IInvocation invocation) { // myAttr

    2熱度

    1回答

    我不能完全弄清楚如何使用動態代理如何同時實現多個接口。使用第三方庫我有類似 interface ISubscribe<T> { Consume(T msg); } 我想動態的創建,能同時實現 ISubscribe<Foo>, ISubscribe<Bar> 一類,併爲每一個調用Logger.Log(msg)(類型參數上是動態的)。 我無法弄清楚如何做到這一點。

    3熱度

    2回答

    我在我的項目中使用簡單注射器。爲了集成簡單的噴油器與Castle.DynamicProxy我使用this example。 我有以下屬性: public class MyLogAttribute : Attribute { // some code. } public class MyTimerAttribute : Attribute { // some code. } 那麼這些屬性適用

    2熱度

    1回答

    我有一個詞length_of_word |重複字典,我想創建一個直方圖,就像下面鏈接中的那個一樣,只使用python構建的函數no numpy或類似的東西。 http://dev.collabshot.com/show/723400/ 請一些指針,至少可以幫我了。

    0熱度

    1回答

    我有以下接口: interface IFoo {} interface IBar { IFoo Foo {get;set;} } 給定生成的代理實現 var generator = new ProxyGenerator(); var proxy = generator.CreateInterfaceProxyWithoutTarget<IBar>(); 有沒有辦法有一個屬性

    2熱度

    1回答

    我有一些用ajax加載的選項卡。我通過HTML獲取內容並將其插入到頁面中。棘手的部分是當我使用ajax加載新內容時,我需要監聽新內容的其他事件,並對新內容執行其他任務。 這是我的目標: var Course = { config: { page: 'description' } init: function() { $('a.show-de

    -3熱度

    2回答

    我有這個數據 | 01十月2017 | | 這是印度尼西亞的日期 ,我想轉換成日期格式。所以結果必須是2017-10-01。 你能幫忙嗎?

    1熱度

    2回答

    ProxyGenerator generator = new ProxyGenerator(); var interceptor = new StandardInterceptor(); MyInterfaceImpl test = (MyInterfaceImpl)generator.CreateClassProxy(typeof(MyInterfaceImpl), interceptor)