Ejemplo n.º 1
0
        private static void DoWorkflowServiceMessage(StringBuilder result, IExecuteMessage res)
        {
            var workflowResult = result;
            var startIdx       = workflowResult.IndexOf(GlobalConstants.PayloadStart, 0, false);

            if (startIdx >= 0)
            {
                startIdx      += GlobalConstants.PayloadStart.Length;
                workflowResult = workflowResult.Remove(0, startIdx);

                startIdx = result.IndexOf(GlobalConstants.PayloadEnd, 0, false);

                if (startIdx > 0)
                {
                    var len = result.Length - startIdx;
                    workflowResult = workflowResult.Remove(startIdx, len);

                    res.Message.Append(workflowResult.Unescape());
                }
            }
            else
            {
                startIdx = result.IndexOf(GlobalConstants.AltPayloadStart, 0, false);
                if (startIdx >= 0)
                {
                    startIdx      += GlobalConstants.AltPayloadStart.Length;
                    workflowResult = workflowResult.Remove(0, startIdx);

                    startIdx = result.IndexOf(GlobalConstants.AltPayloadEnd, 0, false);

                    if (startIdx > 0)
                    {
                        var len = result.Length - startIdx;
                        workflowResult = workflowResult.Remove(startIdx, len);

                        res.Message.Append(workflowResult.Unescape());
                    }
                }
                else
                {
                    res.Message.Append(workflowResult);
                }
            }
        }
Ejemplo n.º 2
0
        public IDeletedFileMetadata HasDependencies(IExplorerItemViewModel explorerItemViewModel, IDependencyGraphGenerator graphGenerator, IExecuteMessage dep)
        {
            var graph = graphGenerator.BuildGraph(dep.Message, "", 1000, 1000, 1);

            _popupController = CustomContainer.Get <IPopupController>();
            if (graph.Nodes.Count > 1)
            {
                var result = _popupController.Show(string.Format(StringResources.Delete_Error, explorerItemViewModel.ResourceName),
                                                   string.Format(StringResources.Delete_Error_Title, explorerItemViewModel.ResourceName),
                                                   MessageBoxButton.OK, MessageBoxImage.Warning, "false", true, false, true, false, true, true);

                if (_popupController.DeleteAnyway)
                {
                    return(new DeletedFileMetadata
                    {
                        IsDeleted = false,
                        ResourceId = explorerItemViewModel.ResourceId,
                        ShowDependencies = false,
                        ApplyToAll = _popupController.ApplyToAll,
                        DeleteAnyway = _popupController.DeleteAnyway
                    });
                }

                if (result == MessageBoxResult.OK)
                {
                    return(BuildMetadata(explorerItemViewModel.ResourceId, false, false, _popupController.ApplyToAll, _popupController.DeleteAnyway));
                }
                explorerItemViewModel.ShowDependencies();
                return(BuildMetadata(explorerItemViewModel.ResourceId, false, true, _popupController.ApplyToAll, _popupController.DeleteAnyway));
            }
            return(new DeletedFileMetadata
            {
                IsDeleted = true,
                ResourceId = explorerItemViewModel.ResourceId,
                ShowDependencies = false
            });
        }
Ejemplo n.º 3
0
 public DeployResult(IExecuteMessage result, string resource)
 {
     Message      = result.HasError ? $"{resource} Deployed Successfuly" : $"Error Deploying {resource}";
     HasError     = result.HasError;
     ErrorDetails = result.Message.ToString();
 }