public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    ProcedureTypeSummaryComponent component = new ProcedureTypeSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        "Procedure Types");
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // could not launch editor
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
Exemplo n.º 2
0
        public override bool ResolveNameInteractive(string query, out ProcedureTypeSummary result)
        {
            result = null;

            var summaryComponent = new ProcedureTypeSummaryComponent(true)
            {
                IncludeDeactivatedItems = this.IncludeDeactivatedItems
            };

            if (!string.IsNullOrEmpty(query))
            {
                summaryComponent.Name = query;
            }

            var exitCode = ApplicationComponent.LaunchAsDialog(_desktopWindow, summaryComponent, "Procedure Types");

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                result = (ProcedureTypeSummary)summaryComponent.SummarySelection.Item;
            }

            return(result != null);
        }