Пример #1
0
        private async Task AddAssemblyStepsToSolution(bool withSelect, string solutionUniqueName)
        {
            var entity = GetSelectedEntity();

            if (entity == null)
            {
                return;
            }

            var service = await GetService();

            var repository = new SdkMessageProcessingStepRepository(service);

            var steps = await repository.GetAllStepsByPluginAssemblyAsync(entity.PluginAssemblyId.Id);

            if (!steps.Any())
            {
                return;
            }

            _commonConfig.Save();

            try
            {
                this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData);

                await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.SdkMessageProcessingStep, steps.Select(s => s.Id), null, withSelect);
            }
            catch (Exception ex)
            {
                this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex);
            }
        }
Пример #2
0
        private async Task AddAssemblyStepsToSolution(bool withSelect, string solutionUniqueName)
        {
            var entitiesList = GetSelectedEntitiesList()
                               .Where(e => e.PluginAssemblyId != null)
                               .Select(e => e.PluginAssemblyId.Id)
                               .Distinct()
                               .ToList()
            ;

            if (!entitiesList.Any())
            {
                return;
            }

            var service = await GetService();

            if (service == null)
            {
                return;
            }

            var steps = new List <SdkMessageProcessingStep>();

            var repository = new SdkMessageProcessingStepRepository(service);

            foreach (var id in entitiesList)
            {
                steps.AddRange(await repository.GetAllStepsByPluginAssemblyAsync(id));
            }

            if (!steps.Any())
            {
                return;
            }

            _commonConfig.Save();

            try
            {
                this._iWriteToOutput.ActivateOutputWindow(service.ConnectionData);

                await SolutionController.AddSolutionComponentsGroupToSolution(_iWriteToOutput, service, null, _commonConfig, solutionUniqueName, ComponentType.SdkMessageProcessingStep, steps.Select(s => s.Id), null, withSelect);
            }
            catch (Exception ex)
            {
                this._iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex);
            }
        }
        public async Task <string> CreateDescriptionAsync(Guid idPluginAssembly, string name, DateTime now)
        {
            var content = new StringBuilder();

            var allTypes = await _repType.GetPluginTypesAsync(idPluginAssembly);

            var allSteps = await _repStep.GetAllStepsByPluginAssemblyAsync(idPluginAssembly);

            var allImages = await _repImage.GetImagesByPluginAssemblyAsync(idPluginAssembly);

            var allSecure = await _repSecure.GetAllSdkMessageProcessingStepSecureConfigAsync();

            content.AppendLine(_connectionInfo).AppendLine();
            content.AppendFormat("Description for PluginAssembly '{0}' at {1}", name, now.ToString("G", System.Globalization.CultureInfo.CurrentCulture)).AppendLine();

            content
            .AppendLine()
            .AppendLine("Plugin Types");

            foreach (var pluginType in allTypes.OrderBy(e => e.TypeName))
            {
                content.AppendLine(pluginType.TypeName);
            }

            content
            .AppendLine()
            .AppendLine("Plugin Types Descriptions");

            foreach (var pluginType in allTypes.OrderBy(e => e.TypeName))
            {
                var desc = await PluginTypeDescriptionHandler.CreateDescriptionAsync(pluginType.PluginTypeId.Value
                                                                                     , allSteps.Where(s => s.EventHandler.Id == pluginType.PluginTypeId.Value)
                                                                                     , allImages
                                                                                     , allSecure
                                                                                     );

                if (!string.IsNullOrEmpty(desc))
                {
                    content.AppendFormat("Plugin Steps for PluginType '{0}'", pluginType.TypeName).AppendLine();

                    content.AppendLine(desc).AppendLine();
                }
            }

            return(content.ToString());
        }