ARUP.IssueTracker.Revit.Entry.AppIssueTracker.ShowForm C# (CSharp) Method

ShowForm() public method

The external command invokes this on the end-user's request
public ShowForm ( UIApplication uiapp ) : void
uiapp UIApplication
return void
    public void ShowForm(UIApplication uiapp)
    {

      // If we do not have a dialog yet, create and show it  
      if (RvtWindow != null) return;

      // A new handler to handle request posting by the dialog  
      ExtOpenView handler = new ExtOpenView();

      // External Event for the dialog to use (to post requests)  
      ExternalEvent m_event = ExternalEvent.Create(handler);

      // We give the objects to the new dialog;  
      // The dialog becomes the owner responsible for disposing them, eventually.
      RvtWindow = new RevitWindow(uiapp, m_event, handler);
      RvtWindow.Show();
    }

Usage Example

示例#1
0
        /// <summary>
        /// Main Command Entry Point
        /// </summary>
        /// <param name="commandData"></param>
        /// <param name="message"></param>
        /// <param name="elements"></param>
        /// <returns></returns>
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            try
            {
#if REVIT2014
                string versionNumber = "2014";
#elif REVIT2015
                string versionNumber = "2015";
#elif REVIT2016
                string versionNumber = "2016";
#elif REVIT2017
                string versionNumber = "2017";
#elif REVIT2018
                string versionNumber = "2018";
#elif REVIT2019
                string versionNumber = "2019";
#endif

                // Version
                if (!commandData.Application.Application.VersionName.Contains(versionNumber))
                {
                    using (TaskDialog td = new TaskDialog("Cannot Continue"))
                    {
                        td.TitleAutoPrefix = false;
                        td.MainInstruction = "Incompatible Revit Version";
                        td.MainContent     = string.Format("This Add-In was built for Revit {0}, please find the Arup Issue Tracker group in Yammer for assistance...", versionNumber);
                        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);

                // register a document closed event
                commandData.Application.Application.DocumentClosed += Application_DocumentClosed;

                return(Result.Succeeded);
            }
            catch (Exception e)
            {
                message = e.Message;
                return(Result.Failed);
            }
        }
All Usage Examples Of ARUP.IssueTracker.Revit.Entry.AppIssueTracker::ShowForm