मैं CS0079 संकलन त्रुटि मिली जब मैं नीचे दिए गए कोड को चलाने के लिए करने की कोशिश की:सी # CS0079 घटना हैंडलिंग संकलन त्रुटि
public delegate void MyClassEHandler(MyClassEParam param);
public class MyClassE
{
public static event MyClassEHandler Error
{
add
{
MyClassE.Error = (MyClassEHandler)Delegate.Combine(MyClassE.Error, value);
}
}
}
त्रुटि:
CS0079 : The event
MyClassE.Error
can only appear on the left hand side of += or -=
आसपास खोज की, लेकिन कैसे हल करने को समझ नहीं सकता यह।
जोड़ा गया: यदि (MyClass.Error! = Null) या MyClass.Error (शून्य, शून्य);
ही CS0079 त्रुटि प्राप्त करें।
CS0079 : The event
MyClassE.Error
can only appear on the left hand side of += or -=
क्या कोई इस पर मेरी सहायता कर सकता है?
का संदर्भ लें प्रयास करें? –
क्या यह कोड 'MyClassE' क्लास या किसी अन्य का हिस्सा है? – Rafal
हाँ, यह कोड MyClassE क्लास का हिस्सा है। – Chris