/// <summary>
/// Является ли запущенный AutoCAD Civil'ом
/// </summary>
public static bool IsCivilApplication(bool msg)
{
string rootKeyNumber = null;
Version ver = Application.Version;
bool ret;
if (ver.Major == 19 && ver.Minor == 1)
rootKeyNumber = "D000";
else if (ver.Major == 20 && ver.Minor == 0)
rootKeyNumber = "E000";
else if (ver.Major == 20 && ver.Minor == 1)
rootKeyNumber = "F000";
else if (ver.Major == 21)
rootKeyNumber = "0000";
else if (ver.Major == 22 && ver.Minor == 0)
rootKeyNumber = "1000";
else if (ver.Major == 23 && ver.Minor == 0)
rootKeyNumber = "2000";
if (string.IsNullOrEmpty(rootKeyNumber))
{
ret = false;
if (msg)
Application.ShowAlertDialog
(string.Format("Not supported version: {0}", ver));
}
else
{
ret = HostApplicationServices.Current
.MachineRegistryProductRootKey.Contains(rootKeyNumber);
if (!ret && msg)
{
Application.ShowAlertDialog("It is not Civil 3D!");
}
}
return ret;
}