KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In my main class 'A' I have declared a function and delegate to call that function, I want to pass my delegate to another class 'B' but how will class B know what type the delegate is? class A public delegate void SendInfo(string[] info); SendInfo sendInfo = new SendInfo(SendInformation); //I have a function SendInformation B b = new B(); b.SetDelegate(sendInfo); class B public delegate void SendInfo(string[] info); //I know this is wrong but how will SendInfo SendInformation; //this class know what SendInfo is? public void SetDelegate(SendInfo sendinfo) //What type is this parameter? { sendinfo.GetType(); SendInformation = sendinfo; } Thanks, Eamonn
Tags (comma-separated)
Save Edits
Cancel