/// <summary> /// This function is called to close the WindowHelper dialog ///and release the resources when the end handeler is called /// </summary> public static void MapBasicWindowClose() { if (_mapbasicWindow != null) { _mapbasicWindow.CloseDockWindow(); } if (_miApp != null && _dockWindow != null) { // unregister the dock window _miApp.UnregisterDockWindow(_dockWindow); } if (_mapbasicWindow != null) { // Clean up the Named view dialog _mapbasicWindow.Dispose(); } if (_miApp != null) { // Clean up the MapInfoApplication object _miApp.Dispose(); _miApp = null; } }
public WindowHelperForm(string title) { InitializeComponent(); if (title != "") { _sDockInfoXMLFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\MapInfo\\MapInfo\\" + title + ".xml"; _controllerMutex = new Mutex(false, title); } _miApp = InteropServices.MapInfoApplication; //_miApp.Do("Set Paper Units \"cm\""); // Register the window with the docking system _dockWindow = _miApp.RegisterDockWindow(this.Handle); SetDockPosition(); _dockWindow.Title = title; _tabPageCurrentWindows.Text = Controller.GetResItemStr("TAB_CURRENT"); _tabPageClosedWindows.Text = Controller.GetResItemStr("TAB_CLOSED"); _tabPageSpecialWindows.Text = Controller.GetResItemStr("TAB_SPECIAL"); AddTooltips(); }
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(); } }
private void Form1_Load(object sender, EventArgs e) { mi = Activator.CreateInstance(Type.GetTypeFromProgID("Mapinfo.Application")) as MapInfoApplication; panel1.Parent = tabPage1; panel2.Parent = tabPage1; panel3.Parent = tabPage2; panel4.Parent = tabPage2; panel5.Parent = tabPage2; panel6.Parent = tabPage2; // getting the border of each panel panel1_border = panel1.Handle.ToString(); panel2_border = panel2.Handle.ToString(); panel3_border = panel3.Handle.ToString(); panel4_border = panel4.Handle.ToString(); panel5_border = panel5.Handle.ToString(); panel6_border = panel6.Handle.ToString(); createWorkspace(panel1_border, ref windows1_id); createWorkspace(panel3_border, ref windows3_id); createWorkspace(panel4_border, ref windows4_id); // ----------part than handles the form---------------------------// int p = panel1.Handle.ToInt32(); mi.Do("dim p as object"); mi.Do("set map CoordSys Earth Projection 1, 28"); mi.SetCallback(callb); // callback'taki info cagiriyor. create info butotn in the background mi.Do("create buttonpad \"a\" as toolbutton calling OLE \"info\" id 2001"); }
public string miEval(string mieval, string panel) { string getOperations = null; MapInfoApplication mi = connectMapInfo("", panel); getOperations = mi.Eval(mieval); return(getOperations); }
private void Form1_Load(object sender, EventArgs e) { sidePanel.Height = turkey.Height; turkey.BackColor = selected; sidePanel.Top = turkey.Top; searchPanel.Visible = true; fullSize.BackgroundImage = CBSProjeTasarimTest.Properties.Resources.switch_to_full_screen_button__1_; //to load all Depended tables try { mi = new MapInfo.MapInfoApplication(); int p = map.Handle.ToInt32(); mi.Do("set next document parent " + p.ToString() + "style 1"); mi.Do("set application window " + p.ToString()); mi.Do("run application \"" + path + "\\Resources\\Databases\\haritalar2.WOR" + "\""); mi.Do("Set Map Zoom Entire Layer " + (layerSayisi - 1)); mi.Do("Set Map Layer " + (layerSayisi) + " Editable On"); mi.Do("Set Map Layer " + (layerSayisi) + " Editable On"); mi.SetCallback(callb); mi.Do("create buttonpad \"a\" as toolbutton calling OLE \"info\" id 2001"); tableProsses(); //Display all Hashtags getAllHashtags(); } catch (Exception) { string message = "There İs Some Problem With MapInfo Turkey Table\n Are You Sure to Close App?"; string caption = "Application Shut Down"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { CloseMapInfo(); Form.ActiveForm.Close(); } else { Form1_Load(sender, e); } } }
public int miState(string panel) { MapInfoApplication mi = connectMapInfo("", panel); if (mi == null) { return(0); } else { return(1); } }
public MapInfo.MapInfoApplication connectMapInfo(string path, string panel) { if (mi == null) { mi = new MapInfoApplication(); int p = Convert.ToInt32(panel); mi.Do("set next document parent " + p.ToString() + " style 1"); mi.Do("set application window " + p.ToString()); mi.Do("run application \"" + AppDomain.CurrentDomain.BaseDirectory + "/WinRESPRO_v1.wor" + "\""); } return(mi); }
private void CoordsysChangerDialog_Load(object sender, EventArgs e) { _miApp = InteropServices.MapInfoApplication; if (_coordsys == "") { _buttonTransform.Enabled = false; } else { _buttonTransform.Enabled = true; } }
public int LoadMap(WinEntity.LoadMap.LoadMapEntity LoadMapEntity) { MapInfoApplication mi = DBI.connectMapInfo("", LoadMapEntity.panelID); if (mi == null) { return(0); } else { return(1); } }
public int miDo(string mido, string panel) { MapInfoApplication mi = connectMapInfo("", panel); mi.Do(mido); if (mi == null) { return(0); } else { return(1); } }
public static MapInfoApplication mi;//dinamik olarak bir mi objesi tanımlıyoruz //mi objesini kullanarak artık tüm MapInfo uygulamalarını kullanabiliriz. private void Form1_Load(object sender, EventArgs e) { mi = new MapInfoApplication(); //daha önce yaratılan mi objesine burada yön //verip onun bir MapInfoApplication ı olduğunu ifade eder int h = panel1.Handle.ToInt32(); // //her panelin bir handle numarası var ve bu no Int32 formuna çevrildi mi.Do("Set Next Document Parent " + h.ToString() + " Style 1"); mi.Do("set application window " + h.ToString()); string ws_path = Application.StartupPath + "\\" + "LESSON1.wor"; //MapInfo'dan projeye olustuşturduğumuz workspace mi.Do("Run Application \"" + ws_path + "\""); //uygulamanın akitive //olmasını sağlar } mi.Do("select il_adi from iller where il_adi<>\"\" order by il_adi into seliller noselect"); int count = int.Parse(mi.Eval("tableinfo(seliller,8)")); mi.Do("fetch first from seliller"); for (int i = 0; i < count; i++) { comboBox1.Items.Add(mi.Eval("seliller.col1")); mi.Do("fetch next from seliller"); } }
private void Form1_Load(object sender, EventArgs e) { foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses()) { if (p.ProcessName == "MapInfow" & p.MainWindowTitle == "") { p.Kill(); } } mi = new MapInfoApplication(); int h = panel1.Handle.ToInt32(); mi.Do("Set Next Document Parent " + h.ToString() + " Style 1"); mi.Do("set application window " + h.ToString()); string ws_path = Application.StartupPath + "\\" + "default5.wor"; mi.Do("Run Application \"" + ws_path + "\""); gMainWinId = mi.Eval("windowid(0)"); mi.Do("create buttonpad \"a\" as toolbutton calling OLE \"info\" id 2001"); mi.Do("create buttonpad \"b\" as toolbutton calling OLE \"cizgiciz\" drawmode 33 id 2003"); mi.Do("create buttonpad \"c\" as toolbutton calling OLE \"noktaAt\" id 2004"); mi.Do("create buttonpad \"d\" as toolbutton calling OLE \"kapaliAlan\" drawmode 35 id 2005"); comboboxIller.Items.Clear(); mi.Do("select*from iller into sel noselect"); mi.Do("fetch first from sel"); for (int i = 0; i < Convert.ToInt16(mi.Eval("tableinfo(sel,8)")); i++) { comboboxIller.Items.Add(mi.Eval("sel.il_adi")); mi.Do("fetch next from sel"); } mi.SetCallback(callb); }
private void ConfigureDockableWindow(Win32Window mapInfoWindow, string name, string windowTitle) { _window = mapInfoWindow; if (name != "") { _sDockInfoXMLFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\MapInfo\\MapInfo\\" + name + ".xml"; _controllerMutex = new Mutex(false, name); } _miApp = InteropServices.MapInfoApplication; // Register the window with the docking system _dockWindow = _miApp.RegisterDockWindow(this.Handle); //Setting the title of the dockable window if (windowTitle == "" || windowTitle == null) _dockWindow.Title = _window.Title; //_dockWindow.Title = _window.Name; else _dockWindow.Title = windowTitle; DockableWindowForm_Load(); SetDockPosition(); }
public void Close() { //MessageBox.Show("Now we would close the docked normal windows!"); if (_windowsList != null) { foreach (Windows.Window window in _windowsList) { if (window.IsMadeDockable() == true) window.Close(true); } } //MessageBox.Show("Now we would close the WindowHelper docked window!"); DockWindowClose(); if (_miApp != null) { _miApp.UnregisterDockWindow(_dockWindow); // Clean up the MapInfoApplication object _miApp.Dispose(); _miApp = null; } }
//mi objesini kullanarak artık tüm MapInfo uygulamalarını kullanabiliriz. private void Form1_Load(object sender, EventArgs e) { mi = new MapInfoApplication();//daha önce yaratılan mi objesine burada yön //verip onun bir MapInfoApplication ı olduğunu ifade eder int h = panel1.Handle.ToInt32();// //her panelin bir handle numarası var ve bu no Int32 formuna çevrildi mi.Do("Set Next Document Parent " + h.ToString() + " Style 1"); mi.Do("set application window " + h.ToString()); string ws_path = Application.StartupPath + "\\" + "LESSON1.wor";//MapInfo'dan projeye olustuşturduğumuz workspace mi.Do("Run Application \"" + ws_path + "\"");//uygulamanın akitive //olmasını sağlar } mi.Do("select il_adi from iller where il_adi<>\"\" order by il_adi into seliller noselect"); int count = int.Parse(mi.Eval("tableinfo(seliller,8)")); mi.Do("fetch first from seliller"); for (int i = 0; i < count; i++) { comboBox1.Items.Add(mi.Eval("seliller.col1")); mi.Do("fetch next from seliller"); } }
public void Close() { //_window.Parent = _originalParent; _window.AddCaptionBar(); _window.AddBorder(); //Write out the XML file that stores the Named Views info DockWindowClose(); _window.Close(); if (_miApp != null) { _miApp.UnregisterDockWindow(_dockWindow); // Clean up the MapInfoApplication object _miApp.Dispose(); _miApp = null; } this.Dispose(); }