public void LoadMap() { try { string path = Path.GetDirectoryName(Application.ExecutablePath) + @"\Map\K1431158.map"; this.MapProject = Utility.loadManifoldMap(axComponentControl1, path, "Map"); DrawingEdit = (Manifold.Interop.Drawing)axComponentControl1.get_Document().ComponentSet["K1431158_Edit"]; DrawingOriginal = (Manifold.Interop.Drawing)axComponentControl1.get_Document().ComponentSet["K1431158_ParcelInspections"]; Constants.QUERYDEFAULT = (Manifold.Interop.Query)axComponentControl1.get_Document().ComponentSet[Constants.QUERYDEFAULT_NAME]; this._EditFactory = new EditDrawingFactorySQL(axComponentControl1, DrawingOriginal, DrawingEdit, MODETYPE_OPERATION.SelectMode); this._EditFactory.MapModeTypeChanged += new EventHandler<ModeTypeEventArgs>(EventHandler_onEditModeChanged); } catch (Exception err) { MessageBox.Show("ERROR:" + err.Message); } }
/// <summary> /// /// </summary> /// <param name="p_MapControl">Reference to the Manifold ActiveX control.</param> /// <param name="p_DrawingOriginalEditObject">The Drawing layer which contains the original Line\Area to edit.</param> /// <param name="p_DrawingEdit">A temporary Drawing layer - used only to display inflection Points of the Line\area to edit.</param> /// <param name="p_Draw">Internal class used to draw ojects on Drawings.</param> /// <param name="p_MODETYPE_OPERATION"></param> public EditDrawingFactorySQL(AxManifold.Interop.AxComponentControl p_MapControl, Manifold.Interop.Drawing p_DrawingOriginalEditObject, Manifold.Interop.Drawing p_DrawingEdit, MODETYPE_OPERATION p_MODETYPE_OPERATION) { try { //Map events this._MapControl = p_MapControl; this._MapControl.MouseDownEvent += new AxManifold.Interop.IComponentControlEvents_MouseDownEventHandler(this.MapControl_MouseDownEvent); this._MapControl.MouseUpEvent += new AxManifold.Interop.IComponentControlEvents_MouseUpEventHandler(this.MapControl_MouseUpEvent); this._MapControl.MouseMoveEvent += new AxManifold.Interop.IComponentControlEvents_MouseMoveEventHandler(this.MapControl_MouseMoveEvent); if (p_DrawingOriginalEditObject == null ) { throw new Exception("The Original Edit objects Drawing was null in the EditDrawingFactory constructor. Assign an initialised Manifold.Interop.Drawing to it before calling this class."); } else { this._DrawingOriginalEditObject = p_DrawingOriginalEditObject; } if (p_DrawingEdit == null) { throw new Exception("The Edit Drawing layer was null in the EditDrawingFactory constructor. Assign an initialised Manifold.Interop.Drawing to it before calling this class."); } else { this._DrawingEdit = p_DrawingEdit; } this._EditModeOperation = p_MODETYPE_OPERATION; clearEditLayer(); } catch (Exception objEx) { throw; } }