Hi All,
My Project is on C#/WPF Application, and I am new to this technology, I am facing issues, with selecting a specific *.dll, from host of dll's,
Basically, in Xaml(we have 3 dll's been build in bin folder) and mapped to the three buttons in the xaml, I need to wire the functionality of specific dll(assume b.dll) to some new button.,
here are the code snippets.<
WorkCompletedCallBack callbackServices;
WORKCOMPLETEDUI m_call;
public List<imyservice> LoadServices(IMYServiceFinder srvFinder, WORKCOMPLETEDUI callback)
{
List<imyservice> srvRefss = new List<imyservice>();
List<string> srvNames = srvFinder.GetServiceDllNames();
foreach( string srvName in srvNames)
{
Assembly asm = null;
try
{
TraceMessage.Info("Load service : " + srvName);
asm = Assembly.LoadFile(srvName); }
catch(Exception ex)
{
TraceMessage.Error("Exception during load file " + ex.ToString());
continue;
}
ServiceEng.IMyServiceCreator mysc = null;
try
{
mysc = asm.CreateInstance("Services.ServiceCreated") as HBServiceEngine.IMYServiceCreator;
if (mysc == null)
continue;
}
catch (Exception ex)
{
TraceMessage.Error("Exception during CreateInstance for ServiceCreat " + ex.ToString());
continue;
}
ServiceEngine.IMYService mys = mysc.CreateService();
m_call = callback;
callbackServices = new WorkCompletedCallBack(Refresh);
mys.Init(callbackServices);
srvRefss.Add(qbs);
}
return srvRefss;
}
Assuming, I have 4 dll's viz., a.dll, b.dll, c.dll, I want to load a specific dll viz., b.dll from the dll list, instead of all the dll's.
Details: VS 2010 IDE, Windows 7 o/s
Any help in resolving the above would be very helpful.
Regards,
VishalK