Hi, I have a method which is in another project (but in the same solution), I create a delegate to that method and then use delegate.BeginInvoke to Asynchronously call that method and the callback method is in the calling project. Now the problem is when the invoked method completes, I need to somehow signal the callback method if the invoked method has succedded True or False, and because the invoked method is in another project and the calling method is also in another project and this project has a reference to the invoked method project if I try to set some variable in the calling project from invoked method project I can't because i don't have a reference to this project and if I try to reference the project i get a circular dependency error.. which is resonable... This is the code:
private delegate void edi2xml_delegate(object ar);
private edi2xml_delegate edi2xml_del;
public void convert_file(object async)
{
DemoApplication.edi_test edi2xml_converter = new DemoApplication.edi_test();
edi2xml_converter.file_path = pub.def.edi_file_directory + "\\" + file_list.file_name;
edi2xml\_del = new edi2xml\_delegate(edi2xml\_converter.convert);
//--This is the invoking
edi2xml\_del.BeginInvoke(null, import\_xml2db, (string)(pub.def.edi\_file\_directory + "\\\\" + file\_list.file\_name + ".xml"));
}
private void import_xml2db(IAsyncResult ar)
{
//--In this callback method i need to get the return state of the invoked method
string full_path = (string)ar.AsyncState;
edi2xml\_del.EndInvoke(ar);
}
//--This function is in another project (another assembly) so I can't set some bool variable in the other project because i would get circular dependency error
public void edi2xml()
{
//--Here I need to somehow signal the import_xml2db method(the callback method) that i have succeded or not (true-false)
}
Any help or suggestions greatly appreciated.