先前使用拆解字串的方式,雖然達到了加速的效果,不過要是在Property的Getter跟Setter以外的地方去call,
- Jan 19 Wed 2011 12:23
Simple property getter and setter design expansion
- Jan 01 Sat 2011 23:14
Thinking of Intellisense
大概在12月初,自己的系統寫到了需要在裡面寫Code,即時編譯執行的部分,
- Nov 25 Thu 2010 10:03
Simple property getter and setter design
如果我想快速創造一個Entity內含若干Property,但是又不想使用field跟先前所使用的字串來做為get, set value的index,
- Nov 09 Tue 2010 15:28
Using Reflection on Interface
之前寫了一組物件,裡面需要依賴Reflection來取得指定的PropertyInfo,方式如下:
- Aug 27 Fri 2010 23:09
Lambda狂熱!Get variable name.
檢查參數一直是一件很繁複的事情,尤其拋出ArgumentException要傳入的Parameter Name字串常常讓我感到不舒服,但一直沒有其它辦法可以解決我的問題....
- Aug 23 Mon 2010 20:19
Listbox Thumbnail Image
今天再修Bug時,有一個Bug是A generic error occurred in GDI+.,讓人摸不著頭緒,後來發現似乎跟Memory不足有相關,這時才發現目前的ListBox為了DataBinding,直接取用Model的Image file path,當來源圖檔過大時,會造成大量Memory損耗,托Google大神所賜,得知了BitmapImage的DecodePixelWidth與DecodePixcelHeight這項利器,再透過Convert轉換終於完成真正帶有縮圖的ListBox啦!
- Aug 21 Sat 2010 13:12
Property getter and setter design
最近開始重複利用先前寫的底層,於是又思考了Property的Getter與Setter是否可以有更好的設計?
先前的設計是使用static field來記錄Property的基本資訊,為了避免日後造成麻煩,因此使用Expression做為Constructor參數,再透過Expression拆解,取出Property Name,建立Dictionary來存放Property value。