internal static void HandleLinkRequest(FwAppArgs link)
{
s_threadHelper.Invoke(() =>
{
Debug.Assert(s_projectId != null, "We shouldn't try to handle a link request until an application is started");
ProjectId linkedProject = new ProjectId(link.DatabaseType, link.Database, link.Server);
if (IsSharedXmlBackendNeeded(linkedProject))
linkedProject.Type = FDOBackendProviderType.kSharedXML;
if (linkedProject.Equals(s_projectId))
FollowLink(link);
else if (!TryFindLinkHandler(link))
{
// No other FieldWorks process was running that could handle the request, so
// start a brand new process for the project requested by the link.
// REVIEW: it might look strange to dispose the return value of OpenProjectWithNewProcess.
// However, that is a Process that gets started, and it is ok to dispose that
// right away if we don't work with the process object. It might be better
// though to change the signature of OpenProjectWithNewProcess to return
// a boolean (true iff the link was successfully handled).
using (OpenProjectWithNewProcess(linkedProject, link.AppAbbrev, "-" + FwLinkArgs.kLink, link.ToString()))
{
}
}
});
}