Exemplo n.º 1
0
        private object ExecuteLoadProcedure(BackgroundWorker worker, DoWorkEventArgs e, params object[] args)
        {
            OSGeo.MapGuide.MaestroAPI.LengthyOperationProgressCallBack cb = (s, cbArgs) =>
            {
                worker.ReportProgress(cbArgs.Progress, cbArgs.StatusMessage);
            };

            IEditorService ed   = (IEditorService)args[0];
            var            proc = (ILoadProcedure)args[1];

            return(ed.CurrentConnection.ExecuteLoadProcedure(proc, cb, true));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Executes the specified load procedure.
        /// </summary>
        /// <param name="resourceID">The resource ID of the load procedure.</param>
        /// <param name="callback">The callback.</param>
        /// <returns></returns>
        public string[] Execute(string resourceID, OSGeo.MapGuide.MaestroAPI.LengthyOperationProgressCallBack callback)
        {
            if (!ResourceIdentifier.Validate(this.ResourceID))
            {
                throw new ArgumentException("Invalid resource id: " + this.ResourceID);
            }

            if (ResourceIdentifier.GetResourceTypeAsString(this.ResourceID) != ResourceTypes.LoadProcedure.ToString())
            {
                throw new ArgumentException("Not a load procedure resource id: " + this.ResourceID);
            }

            ILoadProcedure proc = (ILoadProcedure)this.Parent.ResourceService.GetResource(resourceID);

            return(Execute(proc, callback));
        }