SafeDispatch/Safedispatch_4_0/LicenseInitializer.cs
2024-02-22 18:43:59 +02:00

38 lines
1010 B
C#

using System;
using ESRI.ArcGIS;
using SafeMobileLib;
namespace Safedispatch_4_0
{
internal partial class LicenseInitializer
{
public LicenseInitializer()
{
ResolveBindingEvent += new EventHandler(BindingArcGISRuntime);
}
void BindingArcGISRuntime(object sender, EventArgs e)
{
//
// TODO: Modify ArcGIS runtime binding code as needed; for example,
// the list of products and their binding preference order.
//
ProductCode[] supportedRuntimes = new ProductCode[] {
ProductCode.Engine, ProductCode.Desktop };
foreach (ProductCode c in supportedRuntimes)
{
if (RuntimeManager.Bind(c))
return;
}
//
// TODO: Modify the code below on how to handle bind failure
//
// Failed to bind, announce and force exit
SM.Debug("ArcGIS runtime binding failed. Application will shut down.");
//System.Environment.Exit(0);
System.Windows.Forms.Application.Exit();
}
}
}