Esempio n. 1
0
        public void ExportSolution(ContextService context, string id, ExportSolutionReq request)
        {
            var operationEventArgs = new OperationEventArgs(OperationType.ExportSolution, id);

            OnOperationStarted?
            .Invoke(this, operationEventArgs);

            CrmProvider.ExportSolution(Service, request.Managed, request.UniqueName, request.Path);
            OnOperationCompleted?
            .Invoke(this, operationEventArgs);
        }
        private void raiseOperationStarted(string message)
        {
            InformationEventArgs args = new InformationEventArgs()
            {
                Message = message
            };

            if (OnOperationStarted != null)
            {
                OnOperationStarted.Invoke(this, args);
            }
        }
Esempio n. 3
0
        public void ImportSolutionsAsync(ContextService context, string id, ImportSolutionReq request)
        {
            var operationEventArgs = new OperationEventArgs(OperationType.ImportSolutionAsync, id);

            OnOperationStarted?
            .Invoke(this, operationEventArgs);

            var data  = File.ReadAllBytes(request.Path);
            var jobId = CrmProvider
                        .ImportSolutionAsync(
                Service,
                data,
                request.OverwriteUnmanagedCustomizations,
                request.MigrateAsHold,
                request.PublishWorkflows);

            WaitAsnycOperation(jobId);
            OnOperationCompleted?
            .Invoke(this, operationEventArgs);
        }
Esempio n. 4
0
        protected void RefreshOperation(ParsedOperation operation)
        {
            operation.Connected = true;

            // Update existing operations.
            if (operations.ContainsKey(operation.Id))
            {
                operations[operation.Id] = operation;
                return;
            }

            // Do not add new operations if they are expired.
            if (operation.Expired)
            {
                return;
            }

            // Add new operations.
            operations.Add(operation.Id, operation);
            OnOperationStarted?.Invoke(operation);
        }