コード例 #1
0
 /// <summary>
 /// Occurs when this command is clicked
 /// </summary>
 public override void OnClick()
 {
     try
     {
         OSGeo.OGR.Ogr.RegisterAll();
         OGRAddLayerDialog dlg = new OGRAddLayerDialog(m_hookHelper);
         dlg.Show();
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
         System.Diagnostics.Trace.WriteLine(ex.Message);
     }
 }
コード例 #2
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            try
            {
                OSGeo.OGR.Ogr.RegisterAll();

                OGRAddLayerDialog dlg = new OGRAddLayerDialog(m_hookHelper);
                dlg.Show();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
                System.Diagnostics.Trace.WriteLine(ex.Message);
            }
        }
コード例 #3
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            try
            {
                OSGeo.OGR.Ogr.RegisterAll();

                OGRAddLayerDialog dlg = new OGRAddLayerDialog(m_hookHelper);

                IWin32Window parent = null;

                var application = m_hookHelper.Hook as IApplication;
                if (application != null)
                {
                    parent = new WindowWrapper(new IntPtr(application.hWnd));
                }

                dlg.Show(parent);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
                System.Diagnostics.Trace.WriteLine(ex.Message);
            }
        }