Exemplo n.º 1
0
 public override void OnClick()
 {
     this._Form = new SelectByPolygonForm();
     Form theForm = (System.Windows.Forms.Form)this._Form;
     SetWindowLongA(theForm.Handle.ToInt32(), GWL_HWNDPARENT, this._App.hWnd);
     util.RegistryHelper.set_ApplicationKey(this.Extension.RegistryKey);
     util.RegistryHelper.applyFormBounds("SelectByPolygonForm", ref theForm);
     string theOptStr = util.RegistryHelper.readValue("SelectByPolygonOption");
     try
     {
         this._Form.SelectType = (SelectByPolygonForm.selectByPolyType)Convert.ToInt32(theOptStr);
     }
     catch (Exception) {
         util.Logger.Write("Could not read the registry value for the default selection type, defaulting to 'Inside or Intersecting'", util.Logger.LogLevel.Info);
         this._Form.SelectType = SelectByPolygonForm.selectByPolyType.selectInsideOrIntersecting;
     }
     this._Form.Closing += new System.ComponentModel.CancelEventHandler(_Form_Closing);
     this._allowFormClose = false;
     this._Form.Show();
     this._Form.Move += new EventHandler(_Form_Move);
 }
Exemplo n.º 2
0
        public override bool Deactivate()
        {
            base.Deactivate();

            if (this._Form != null)
            {
                this._allowFormClose = true;
                this._Form.Close();
                this._Form.Dispose();
                this._Form = null;
            }

            if (this._Feedback != null)
            {
                IPolygon thePoly = this._Feedback.Stop();
                this._Feedback = null;
            }

            return true;
        }