You can create an object of delegate class something like this:
delegate void SomeDelegate (string data);
and then you can pass this delegate to your function like this:
Tracking.UI.MainWindows.VendorOrderLegDetailsForm.DisplayVendorDetails(this.FindForm(), (BHFreight.Tracking.BusinessObjects.VendorOrderLegDetail)_OrderLegDetail, SomeDelegate UpdateControl);
in vender details you can call this delegate using:
pivate void DisplayVendorDetails()
{
UpdateControl("SomeString");
//// Some code
}
where the original function reference by delegate looks like this:
private void ShowString(sting showString)
{
Console.WriteLine(showString);
}
And creattion of delgate will be like this before passing it to DisplayVenderDetails:
SomeDelegate someDelegate = new SomeDelegate(ShowString);
Tracking.UI.MainWindows.VendorOrderLegDetailsForm.DisplayVendorDetails(this.FindForm(), (BHFreight.Tracking.BusinessObjects.VendorOrderLegDetail)_OrderLegDetail, someDelegate );
Best Regards,
Rizwan
|