मुझे बस दुर्घटना से पता चला (जब कुछ संकलित किया गया था जिसे मैंने संकलित नहीं किया था) कि EventHandler सिस्टम System.EventArgs के लिए बाध्य नहीं है।इवेंट हैंडलर <TEventArgs> पर कोई बाधा क्यों नहीं है?
#region Assembly mscorlib.dll, v4.0.0.0
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll
#endregion
namespace System
{
// Summary:
// Represents the method that will handle an event.
//
// Parameters:
// sender:
// The source of the event.
//
// e:
// An System.EventArgs that contains the event data.
//
// Type parameters:
// TEventArgs:
// The type of the event data generated by the event.
[Serializable]
public delegate void EventHandler<TEventArgs>(object sender, TEventArgs e);
}
इस डॉक्स और कार्यान्वयन के बीच एक बेमेल है:
यहाँ इनलाइन डॉक्स है?
मैं पूछ रहा हूं क्योंकि मैं उत्सुक हूं। यह बिल्कुल कोई शिकायत नहीं है।
मुझे आश्चर्य है अगर आप दृश्य स्टूडियो 2012 (.NET 4.5) के साथ बनाने और बिना .net 4.5 एक मशीन पर इसे चलाने के लिए कोशिश क्या होता है। (2012 बनाम मशीन पर नहीं, इसलिए मैं अभी जांच नहीं कर सकता) – Will