public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
try
{
// Version
if (!commandData.Application.Application.VersionName.Contains("2015"))
{
using (TaskDialog td = new TaskDialog("Cannot Continue"))
{
td.TitleAutoPrefix = false;
td.MainInstruction = "Incompatible Revit Version";
td.MainContent = "This Add-In was built for Revit 2015, please contact info@case-inc for assistance...";
td.Show();
}
return Result.Cancelled;
}
// Form Running?
if (_isRunning && _appIssueTracker != null && _appIssueTracker.RvtWindow.IsLoaded)
{
_appIssueTracker.Focus();
return Result.Succeeded;
}
_isRunning = true;
ThisCmd = this;
_appIssueTracker = new AppIssueTracker();
_appIssueTracker.ShowForm(commandData.Application);
return Result.Succeeded;
}
catch (Exception e)
{
message = e.Message;
return Result.Failed;
}
}