Ejemplo n.º 1
0
        public static void MapBasicWindowShow()
        {
            Win32Window mapbasicwindow = new Win32Window((int)Win32Window.WindowType.WIN_MAPBASIC);

            if (!mapbasicwindow.IsOpen)
            {
                // Open the mapbasic window.
                InteropHelper.Do("Run Menu Command 608");
            }
            if ((_mapbasicWindow == null) || (_mapbasicWindow.IsDisposed))
            {
                //MessageBox.Show("1");
                _mapbasicWindow = new MapBasicWindowForm(new MapBasicWindowController(), mapbasicwindow);
                //MessageBox.Show("2");
                _miApp = InteropServices.MapInfoApplication;
                // Register the window with the docking system
                //MessageBox.Show("3");
                _dockWindow = _miApp.RegisterDockWindow(_mapbasicWindow.Handle);
                //MessageBox.Show("4");
                _mapbasicWindow.SetDockPosition();

                //MessageBox.Show("5");
                _dockWindow.Title = "MapBasic Window";

                //_mapbasicWindow.EnableDockChangedEvent();
            }
            else
            {
                _dockWindow.Activate();
            }
        }
        public static void MapBasicWindowShow()
        {
            Win32Window mapbasicwindow = new Win32Window((int)Win32Window.WindowType.WIN_MAPBASIC);
            if (!mapbasicwindow.IsOpen)
            {
                // Open the mapbasic window.
                InteropHelper.Do("Run Menu Command 608");
            }
            if ((_mapbasicWindow == null) || (_mapbasicWindow.IsDisposed))
            {
                //MessageBox.Show("1");
                _mapbasicWindow = new MapBasicWindowForm(new MapBasicWindowController(), mapbasicwindow);
                //MessageBox.Show("2");
                _miApp = InteropServices.MapInfoApplication;
                // Register the window with the docking system
                //MessageBox.Show("3");
                _dockWindow = _miApp.RegisterDockWindow(_mapbasicWindow.Handle);
                //MessageBox.Show("4");
                _mapbasicWindow.SetDockPosition();

                //MessageBox.Show("5");
                _dockWindow.Title = "MapBasic Window";

                //_mapbasicWindow.EnableDockChangedEvent();
            }
            else
            {
                _dockWindow.Activate();
            }
        }