예제 #1
0
        /// <summary>
        /// Opens a workspace in a instance of Mapinfo.
        /// </summary>
        /// <param name="workspacePath">The path to the workspace which needs to be opened.</param>
        /// <returns>A instance of a <see cref="Workspace"/> which can be used to get infomation about the opened workspace.</returns>
        public static Workspace OpenWorkspace(string workspacePath)
        {
            IMapinfoWrapper wrapper = ServiceLocator.GetInstance <IMapinfoWrapper>();

            wrapper.RunCommand("Run Application {0}".FormatWith(workspacePath.InQuotes()));
            return(new Workspace());
        }
 /// <summary>
 /// Creates a new instace of the <see cref="T:MapinfoLogger"/> object.
 /// </summary>
 /// <param name="mapinfoInstance">The instance of Mapinfo to log against.</param>
 /// <param name="doCommandLogAction">The action that will be invoked before the RunCommand is run.</param>
 /// <param name="evalCommandLogAction">The action that will be invoked before the Evaluate command is run.</param>
 /// <param name="evalReturnLogAction">The action that will be invoked after the Evaluate command in run, this action is passed the result
 /// of the Evaluate command.</param>
 public MapinfoLogger(IMapinfoWrapper mapinfoInstance, Action <String> doCommandLogAction, Action <String> evalCommandLogAction, Action <String> evalReturnLogAction)
 {
     this.mapinfo          = mapinfoInstance;
     this.action           = doCommandLogAction;
     this.evalaction       = evalCommandLogAction;
     this.returnevalaction = evalReturnLogAction;
 }
예제 #3
0
 internal Variable(string name, VariableType declareAs, bool isAssigned, IMapinfoWrapper wrapper)
 {
     this.name       = name;
     this.type       = declareAs;
     this.isAssigned = isAssigned;
     this.wrapper    = wrapper ?? ServiceLocator.GetInstance <IMapinfoWrapper>();
 }
        /// <summary>
        /// Run the ObjectInfo mapbasic command in Mapinfo, and returns a string containing the result.
        /// </summary>
        /// <param name="variable">The variable used by the ObjectInfo call.</param>
        /// <param name="attribute">The attribute specifying which information to return.</param>
        /// <returns>A string containing the retured result from calling the ObjectInfo command in Mapinfo.</returns>
        public static string ObjectInfo(IVariable variable, ObjectInfoEnum attribute)
        {
            IMapinfoWrapper wrapper        = ServiceLocator.GetInstance <IMapinfoWrapper>();
            string          expression     = variable.GetExpression();
            string          returnedstring = wrapper.Evaluate("ObjectInfo({0},{1})".FormatWith(expression, (int)attribute));

            return(returnedstring);
        }
        public static void WireUp(IMapinfoWrapper mapinfoInstance)
        {
            DependencyResolver resolver = new DependencyResolver();
            IFactoryBuilder    builder  = new FactoryBuilder(mapinfoInstance);

            resolver.Register <IMapinfoWrapper>(mapinfoInstance);
            resolver.Register <IFactoryBuilder>(builder);
            ServiceLocator.Initialize(resolver);
        }
예제 #6
0
 public VariableFactory(IMapinfoWrapper mapinfoInstance)
 {
     this.wrapper = mapinfoInstance ?? ServiceLocator.GetInstance <IMapinfoWrapper>();
 }
예제 #7
0
 public DataReader(IMapinfoWrapper wrapper, string tableName, IGeometryFactory geometryFactory)
 {
     this.wrapper         = wrapper;
     this.tableName       = tableName;
     this.geometryfactory = geometryFactory;
 }
예제 #8
0
 internal MapWindow(IMapinfoWrapper wrapper, int mapNumber)
 {
     this.mapinfoinstance = wrapper ?? ServiceLocator.GetInstance <IMapinfoWrapper>();
     this.mapnumber       = mapNumber;
 }
예제 #9
0
 public TableCommandRunner(IMapinfoWrapper mapinfo)
 {
     this.wrapper = mapinfo ?? ServiceLocator.GetInstance <IMapinfoWrapper>();
 }
예제 #10
0
 /// <summary>
 /// Creates a new SystemInfo object used to retive information
 /// about the current instace of mapinfo.
 /// </summary>
 /// <param name="mapinfoWrapper">A wrapper object containing the running instace of mapinfo.</param>
 internal SystemInfo(IMapinfoWrapper mapinfoWrapper)
 {
     this.wrapper = mapinfoWrapper ?? ServiceLocator.GetInstance <IMapinfoWrapper>();
 }
예제 #11
0
 internal Layer(IMapinfoWrapper mapinfoInstance, string layerName)
 {
     this.layername = layerName;
     this.wrapper   = mapinfoInstance ?? ServiceLocator.GetInstance <IMapinfoWrapper>();
 }
 public GeometryFactory(IMapinfoWrapper mapinfoInstance, IVariableFactory variableFactory)
 {
     this.wrapper         = mapinfoInstance;
     this.variablefactory = variableFactory;
 }
 public MapinfoSession(IMapinfoWrapper mapinfoAPI)
 {
     this.mapinfo     = mapinfoAPI;
     this.LoadOptions = null;
 }
예제 #14
0
 public Point(Variable variable, IMapinfoWrapper session)
     : base(variable, session)
 {
 }
예제 #15
0
 public Geometry(Variable variable, IMapinfoWrapper mapinfoSession)
 {
     this.Variable = variable;
     this.Mapinfo  = mapinfoSession;
 }
예제 #16
0
        public void IsWiredUp()
        {
            IMapinfoWrapper wrapper = IoC.Resolve <IMapinfoWrapper>();

            Assert.AreSame(mockmapinfo.Object, wrapper);
        }
예제 #17
0
 public TableInfo(IMapinfoWrapper wrapper)
 {
     // use from cache if not supplied, could create new here
     this.wrapper = wrapper ?? Publics.InternalMapInfo;
 }
예제 #18
0
 public TableInfo(IMapinfoWrapper wrapper)
 {
     // use from cache if not supplied
     this.wrapper = wrapper ?? Publics.InternalMapInfo;
 }
 internal MapbasicObject(IVariable variable, IMapinfoWrapper wrapper)
 {
     this.innervariable   = variable;
     this.mapinfoinstance = wrapper ?? ServiceLocator.GetInstance <IMapinfoWrapper>();
 }
예제 #20
0
 public FactoryBuilder(IMapinfoWrapper mapinfoInstance)
 {
     this.wrapper = mapinfoInstance;
 }
 public MapinfoQueryProvider(IMapinfoWrapper wrapper)
 {
     this.wrapper = wrapper;
 }
예제 #22
0
 internal Layer(IMapinfoWrapper mapinfoInstance, int layerNumber)
 {
     this.layernumber = layerNumber;
     this.wrapper     = mapinfoInstance;
 }
예제 #23
0
 public MapbasicWrapper(IMapinfoWrapper Session)
 {
     this.session = Session;
 }