Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Rx Workshop: Observables versus Events
Sep 20, 2011 at 5:24 AMI dont think you should be modifying original OnTextChanged, heres my code
class Events { private string m_LastString = string.Empty; public event Action<string> TextChanged; private Action<string> m_ToAttachToTextChanged; private Action<int> m_LengthChanged; public Events() { m_ToAttachToTextChanged = text => { if (m_LastString.Length != (text ?? "").Length) { m_LengthChanged((text ?? "").Length); } m_LastString = text ?? ""; }; } public virtual void OnTextChanged(string text) { var t = TextChanged; if (t != null) t(text); } public event Action<int> LengthChanged { add { m_LengthChanged += value; TextChanged += m_ToAttachToTextChanged; } remove { m_LengthChanged -= value; TextChanged -= m_ToAttachToTextChanged; } } }