コード例 #1
0
        private void TerminateCommand()
        {
            _InteractionManager.Terminate();

            if (_frm != null)
            {
                _frm.Dispose();
                _frm = null;
            }
        }
コード例 #2
0
        private void StartCommand()
        {
            if (_frm != null)
            {
                if (!_frm.Visible)
                {
                    _frm.Dispose();
                }

                _frm.Focus();
                return;
            }

            RuleNameForm ruleNameForm = new RuleNameForm();

            System.Windows.Forms.DialogResult res =
                ruleNameForm.ShowModal();

            if (res != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            ruleNameForm.Dispose();

            _frm             = new LinkParametersForm(ruleNameForm.RuleName);
            _frm.Command     = this;
            _frm.FormClosed += new System.Windows.Forms.FormClosedEventHandler(Handle_Form_FormClosed);

            _frm.Show(new WinUtilities((IntPtr)AdnInventorUtilities.InvApplication.MainFrameHWND));

            if (_frm.TopMost == false)
            {
                _frm.BringToFront();
                _frm.Activate();
            }

            _InteractionManager = new AdnInteractionManager(AdnInventorUtilities.InvApplication);

            _InteractionManager.Initialize();

            _InteractionManager.SelectEvents.OnSelect +=
                new Inventor.SelectEventsSink_OnSelectEventHandler(SelectEvents_OnSelect);
        }