Пример #1
0
        private void OnDeleteExportJobCompleted(object sender, DeleteExportJobCompletedEventArgs e)
        {
            if (DeleteExportJobCompleted != null)
            {
                Guid context = Guid.Empty;
                if (e.UserState != null)
                {
                    context = (Guid)e.UserState;  //should be the export job id
                }

                Proxy.ResultEventArgs <IExportJob> eventArgs = new Proxy.ResultEventArgs <IExportJob>();
                if (e.Error != null)
                {
                    eventArgs.HasError     = true;
                    eventArgs.ErrorMessage = e.Error.Message;
                }
                else
                {
                    if (e.Result.ExportJob != null)
                    {
                        eventArgs.Result = ServerObjectConverter.ConvertServerExportJob(e.Result.ExportJob);
                    }
                    else
                    {
                        eventArgs.HasError     = true;
                        eventArgs.ErrorMessage = "The details of ExportJob that was deleted was not returned with the result of the delete operation.";
                    }
                }

                DeleteExportJobCompleted.FireEvent(context, this, eventArgs);
            }
        }
Пример #2
0
        private void OnGetExportJobsForMapTypeCompleted(object sender, GetExportJobsForMapTypeCompletedEventArgs e)
        {
            if (GetExportJobsForMapTypeCompleted != null)
            {
                Guid context = Guid.Empty;
                if (e.UserState != null)
                {
                    context = (Guid)e.UserState; //should be the root map id
                }

                Proxy.ResultEventArgs <ExportJobCollection> eventArgs = new Proxy.ResultEventArgs <ExportJobCollection>();
                if (e.Error != null)
                {
                    eventArgs.HasError     = true;
                    eventArgs.ErrorMessage = e.Error.Message;
                }
                else
                {
                    IDictionary <Guid, Proxy.IExportJob> exportJobs = ServerObjectConverter.ConvertExportJobsCollection(e.Result.ExportJobs);
                    eventArgs.Result = new ExportJobCollection(exportJobs);
                }

                GetExportJobsForMapTypeCompleted.FireEvent(context, this, eventArgs);
            }
        }
Пример #3
0
        private void OnCreateExportJobCompleted(object sender, CreateExportJobCompletedEventArgs e)
        {
            if (CreateExportJobCompleted != null)
            {
                Guid context = Guid.Empty;
                if (e.UserState != null)
                {
                    context = (Guid)e.UserState; //should be the root map id
                }

                Proxy.ResultEventArgs <IExportJob> eventArgs = new Proxy.ResultEventArgs <IExportJob>();
                if (e.Error != null)
                {
                    eventArgs.HasError     = true;
                    eventArgs.ErrorMessage = e.Error.Message;
                }
                else
                {
                    eventArgs.Result = ServerObjectConverter.ConvertServerExportJob(e.Result.ExportJob);
                }

                CreateExportJobCompleted.FireEvent(context, this, eventArgs);
            }
        }