private CSharpProjectPluginTypeActionOnComponentCommand(OleMenuCommandService commandService, int idCommand, ISourceSelectedFiles sourceSelectedFiles, string commandNameForCorrection, ActionOnComponent actionOnComponent)
     : base(commandService, idCommand)
 {
     this._sourceSelectedFiles      = sourceSelectedFiles;
     this._commandNameForCorrection = commandNameForCorrection;
     this._actionOnComponent        = actionOnComponent;
 }
 private CodeJavaScriptLinkedSystemFormGetCurrentInConnectionCommand(
     OleMenuCommandService commandService
     , int baseIdStart
     , ActionOnComponent actionOnComponent
     , string fieldName
     , string fieldTitle
     ) : base(commandService, baseIdStart)
 {
     this._actionOnComponent = actionOnComponent;
     this._fieldName         = fieldName;
     this._fieldTitle        = fieldTitle;
 }
예제 #3
0
        public bool AcceptInput(ConsoleKeyInfo keyPressed, GraphicsContext g)
        {
            var inputs = InputMap.Compile();

            if (Utils.KeyCorresponds(inputs, keyPressed, StandardActionNames.BaseAction))
            {
                ActionOnComponent?.Invoke(this, new ActionEventArgs(this, keyPressed, g));

                return(true);
            }

            return(false);
        }
        public void HandleOpenLinkedSystemForm(ConnectionData connectionData, ActionOnComponent actionOnComponent, string entityName, Guid formId, int formType)
        {
            CommonConfiguration commonConfig = CommonConfiguration.Get();

            if (connectionData == null)
            {
                if (!HasCurrentCrmConnection(out ConnectionConfiguration crmConfig))
                {
                    return;
                }

                connectionData = crmConfig.CurrentConnectionData;
            }

            if (connectionData != null && commonConfig != null)
            {
                ActivateOutputWindow(connectionData);
                WriteToOutputEmptyLines(connectionData, commonConfig);

                CheckWishToChangeCurrentConnection(connectionData);

                switch (actionOnComponent)
                {
                case ActionOnComponent.OpenInWeb:
                    connectionData.OpenSystemFormInWeb(entityName, formId, formType);
                    return;

                case ActionOnComponent.OpenDependentComponentsInWeb:
                    connectionData.OpenSolutionComponentDependentComponentsInWeb(Entities.ComponentType.SystemForm, formId);
                    return;
                }

                try
                {
                    Controller.StartOpeningLinkedSystemForm(connectionData, commonConfig, actionOnComponent, entityName, formId, formType);
                }
                catch (Exception ex)
                {
                    WriteErrorToOutput(connectionData, ex);
                }
            }
        }
 protected CodeLinkedGlobalOptionSetActionOnComponentInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, ActionOnComponent actionOnComponent, SelectedFileType selectedFileType)
     : base(commandService, baseIdStart)
 {
     this._actionOnComponent = actionOnComponent;
     this._selectedFileType  = selectedFileType;
 }
예제 #6
0
        public void HandleSolutionOpenLastSelected(ConnectionData connectionData, string solutionUniqueName, ActionOnComponent actionOnComponent)
        {
            if (string.IsNullOrEmpty(solutionUniqueName))
            {
                return;
            }

            GetConnectionConfigAndExecute(connectionData, (conn, commonConfig) => Controller.StartSolutionOpening(conn, commonConfig, solutionUniqueName, actionOnComponent));
        }
 private CSharpProjectPluginTypeActionOnComponentInConnectionWithoutCurrentCommand(OleMenuCommandService commandService, int baseIdStart, ISourceSelectedFiles sourceSelectedFiles, ActionOnComponent actionOnComponent, string fieldName, string fieldTitle)
     : this(commandService, baseIdStart, sourceSelectedFiles, actionOnComponent)
 {
     this._fieldName  = fieldName;
     this._fieldTitle = fieldTitle;
 }
 private WebResourceOpenInWebInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, ISourceSelectedFiles sourceSelectedFiles, ActionOnComponent actionOnComponent)
     : base(commandService, baseIdStart)
 {
     this._sourceSelectedFiles = sourceSelectedFiles;
     this._actionOnComponent   = actionOnComponent;
 }
예제 #9
0
        private void HandleActionOnPluginTypesCommandInternal(ConnectionData connectionData, CommonConfiguration commonConfig, IEnumerable <SelectedFile> selectedFiles, ActionOnComponent actionOnComponent, string fieldName, string fieldTitle)
        {
            if (!selectedFiles.Any())
            {
                return;
            }

            this.ActivateOutputWindow(connectionData);

            this.WriteToOutput(connectionData, Properties.OutputStrings.GettingClassTypeFullNameFromFilesFormat, selectedFiles.Count().ToString());

            List <string> pluginTypeNames = new List <string>();

            var table = new FormatTextTableHandler();

            table.SetHeader("File", "Type.FullName");

            foreach (var selectedFile in selectedFiles.OrderBy(f => f.FileName))
            {
                string pluginType = CSharpCodeHelper.GetClassInFileBySyntaxTree(selectedFile.FilePath);

                table.AddLine(selectedFile.FilePath, pluginType);

                pluginTypeNames.Add(pluginType);
            }

            StringBuilder stringBuilder = new StringBuilder();

            table.GetFormatedLines(false).ForEach(s => stringBuilder.AppendLine(s));

            this.WriteToOutput(connectionData, stringBuilder.ToString());

            Controller.StartActionOnPluginTypes(connectionData, commonConfig, pluginTypeNames, actionOnComponent, fieldName, fieldTitle);
        }
예제 #10
0
        public bool AcceptInput(ConsoleKeyInfo keyPressed, GraphicsContext g)
        {
            g.SetCursorVisible(false);
            var map = InputMap.Compile();

            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.MoveLeftWord))
            {
                // DOING
                // Move one word to the left, i.e. move to the left until you meet a space (or the beginning of the line)

                var i          = CaretPosition - 1;
                var skipSpaces = true;
                // this is so that we jump to the previous word if we are at the beginning of a
                // word when ctrl <- is invoked

                while (CaretPosition >= 0 && CaretPosition <= Text.Length)
                {
                    if (CaretPosition == 0)
                    {
                        UpdateCursorState(g);
                        return(true);
                    }

                    switch (Text[i])
                    {
                    case ' ':
                        if (!skipSpaces)
                        {
                            UpdateCursorState(g);
                            return(true);
                        }

                        goto default;     // Jump to case default

                    default:
                        CaretPosition--;
                        i--;
                        skipSpaces = false;
                        break;
                    }
                }

                UpdateCursorState(g);
                return(false);
            }

            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.MoveRightWord))
            {
                var skipSpaces = true;

                while (CaretPosition <= Text.Length)
                {
                    if (CaretPosition == Text.Length)
                    {
                        UpdateCursorState(g);
                        return(true);
                    }

                    switch (Text[CaretPosition])
                    {
                    case ' ':
                        if (!skipSpaces)
                        {
                            UpdateCursorState(g);
                            return(true);
                        }

                        CaretPosition++;
                        break;

                    default:
                        CaretPosition++;
                        skipSpaces = false;
                        break;
                    }
                }

                UpdateCursorState(g);
                return(false);
            }


            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.BaseAction))
            {
                ActionOnComponent?.Invoke(this, new ActionEventArgs(this, keyPressed, g));
                UpdateCursorState(g);
                return(true);
            }

            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.MoveLeft))
            {
                if (CaretPosition > 0)
                {
                    CaretPosition -= 1;
                    UpdateCursorState(g);
                    return(true);
                }

                UpdateCursorState(g);
                return(false);
            }

            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.MoveRight))
            {
                if (CaretPosition < Text.Length)
                {
                    CaretPosition += 1;
                    UpdateCursorState(g);
                    return(true);
                }

                UpdateCursorState(g);
                return(false);
            }

            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.DeleteToTheLeftAction))
            {
                if (CaretPosition > 0)
                {
                    Text           = Text.Remove(CaretPosition - 1, 1);
                    CaretPosition -= 1;
                    Print(1, g);
                    OnTextChanged?.Invoke(this, new ActionEventArgs(this, keyPressed, g));

                    UpdateCursorState(g);
                    return(true);
                }

                UpdateCursorState(g);
                return(false);
            }

            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.DeleteToTheRightAction))
            {
                if (CaretPosition > 0 && CaretPosition < Text.Length)
                {
                    Text = Text.Remove(CaretPosition, 1);
                    Print(1, g);
                    OnTextChanged?.Invoke(this, new ActionEventArgs(this, keyPressed, g));

                    UpdateCursorState(g);
                    return(true);
                }


                UpdateCursorState(g);
                return(false);
            }

            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.MoveLineStart))
            {
                // TODO
                // Move the caret to the beginning of the line
                if (CaretPosition > 0)
                {
                    CaretPosition = 0;

                    UpdateCursorState(g);
                    return(true);
                }

                UpdateCursorState(g);
                return(false);
            }

            if (Utils.KeyCorresponds(map, keyPressed, StandardActionNames.MoveLineEnd))
            {
                // TODO
                // Move the caret to the end of the line
                if (CaretPosition < Text.Length)
                {
                    CaretPosition = Text.Length;
                    UpdateCursorState(g);
                    return(true);
                }

                UpdateCursorState(g);
                return(false);
            }

            // Letters: add the letters to Text and write them with the following line. Also increase CaretPosition.
            //     g.Write(X + CaretPosition, Y, <the letter>);
            // Backspace: delete the letter, careposition - 1, make sure to rewrite the string correctly (or call Print
            // if you're lazy)

            if (keyPressed.KeyChar > (char)31 && keyPressed.Key != ConsoleKey.Enter &&
                keyPressed.Key != ConsoleKey.Tab && keyPressed.Key != ConsoleKey.Escape &&
                // NOT(control pressed XOR alt pressed)
                (keyPressed.Modifiers & ConsoleModifiers.Control) == 0 ==
                ((keyPressed.Modifiers & ConsoleModifiers.Alt) == 0))
            {
                Text           = Text.Insert(CaretPosition, "" + keyPressed.KeyChar);
                CaretPosition += 1;
                Print(PlaceholderText.Length - 1, g);
                OnTextChanged?.Invoke(this, new ActionEventArgs(this, keyPressed, g));
                UpdateCursorState(g);
                return(true);
            }


            // USE .KeyChar AND NOT .Key.ToString() !!!

            // If it matched one of the cases above, return true
            // Anything else: return false
            UpdateCursorState(g);
            return(false);
        }
 private CodeJavaScriptLinkedGlobalOptionSetActionOnComponentInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, ActionOnComponent actionOnComponent)
     : base(commandService, baseIdStart, actionOnComponent, SelectedFileType.WebResourceJavaScriptHasLinkedGlobalOptionSet)
 {
 }
 private void OpeningLinkedSystemForm(IOrganizationServiceExtented service, CommonConfiguration commonConfig, ActionOnComponent actionOnComponent, string entityName, Guid formId, int formType)
 {
     if (actionOnComponent == ActionOnComponent.OpenInWeb)
     {
         service.UrlGenerator.OpenSolutionComponentInWeb(ComponentType.SystemForm, formId);
         service.TryDispose();
     }
     else if (actionOnComponent == ActionOnComponent.OpenDependentComponentsInWeb)
     {
         service.ConnectionData.OpenSolutionComponentDependentComponentsInWeb(ComponentType.SystemForm, formId);
         service.TryDispose();
     }
     else if (actionOnComponent == ActionOnComponent.OpenDependentComponentsInExplorer)
     {
         WindowHelper.OpenSolutionComponentDependenciesExplorer(
             _iWriteToOutput
             , service
             , null
             , commonConfig
             , (int)ComponentType.SystemForm
             , formId
             , null
             );
     }
     else if (actionOnComponent == ActionOnComponent.OpenSolutionsListWithComponentInExplorer)
     {
         WindowHelper.OpenExplorerSolutionExplorer(
             _iWriteToOutput
             , service
             , commonConfig
             , (int)ComponentType.SystemForm
             , formId
             , null
             );
     }
 }
예제 #13
0
 private CodeJavaScriptLinkedEntityActionOnComponentInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, ActionOnComponent actionOnComponent)
     : base(commandService, baseIdStart)
 {
     this._actionOnComponent = actionOnComponent;
 }
        private async Task GettingSystemFormCurrentAttribute(IOrganizationServiceExtented service, CommonConfiguration commonConfig, Guid formId, ActionOnComponent actionOnComponent, string fieldName, string fieldTitle)
        {
            var repositorySystemForm = new SystemFormRepository(service);

            var systemForm = await repositorySystemForm.GetByIdAsync(formId, ColumnSetInstances.AllColumns);

            if (actionOnComponent == ActionOnComponent.SingleXmlField)
            {
                if (string.Equals(fieldName, SystemForm.Schema.Attributes.formxml, StringComparison.InvariantCultureIgnoreCase))
                {
                    GetCurrentSystemFormXml(service, commonConfig, systemForm);
                }
            }
            else if (actionOnComponent == ActionOnComponent.SingleField)
            {
                if (string.Equals(fieldName, SystemForm.Schema.Attributes.formjson, StringComparison.InvariantCultureIgnoreCase))
                {
                    GetCurrentSystemFormJson(service, commonConfig, systemForm);
                }
            }
            else if (actionOnComponent == ActionOnComponent.EntityDescription)
            {
                await GetCurrentEntityDescription(service, commonConfig, systemForm);
            }
            else if (actionOnComponent == ActionOnComponent.Description)
            {
                await GetCurrentFormDescription(service, commonConfig, systemForm);
            }
        }
 public async Task ExecuteOpeningLinkedSystemForm(ConnectionData connectionData, CommonConfiguration commonConfig, ActionOnComponent actionOnComponent, string entityName, Guid formId, int formType)
 {
     await ConnectAndExecuteActionAsync(connectionData
                                        , Properties.OperationNames.ActionOnComponentFormat3
                                        , (service) => OpeningLinkedSystemForm(service, commonConfig, actionOnComponent, entityName, formId, formType)
                                        , "Linked " + SystemForm.EntitySchemaName
                                        , EnumDescriptionTypeConverter.GetEnumNameByDescriptionAttribute(ActionOnComponent.OpenInWeb)
                                        );
 }
 public async Task ExecuteGetSystemFormCurrentAttribute(ConnectionData connectionData, CommonConfiguration commonConfig, Guid formId, ActionOnComponent actionOnComponent, string fieldName, string fieldTitle)
 {
     await ConnectAndExecuteActionAsync(connectionData
                                        , Properties.OperationNames.GettingSystemFormCurrentAttributeFormat2
                                        , (service) => GettingSystemFormCurrentAttribute(service, commonConfig, formId, actionOnComponent, fieldName, fieldTitle)
                                        , fieldTitle
                                        );
 }
예제 #17
0
        public void OpenGlobalOptionSetMetadataCommand(ConnectionData connectionData, string optionSetName, ActionOnComponent actionOnComponent)
        {
            CommonConfiguration commonConfig = CommonConfiguration.Get();

            if (connectionData == null)
            {
                if (!HasCurrentCrmConnection(out ConnectionConfiguration crmConfig))
                {
                    return;
                }

                connectionData = crmConfig.CurrentConnectionData;
            }

            if (connectionData != null && commonConfig != null)
            {
                CheckWishToChangeCurrentConnection(connectionData);

                //var idOptionSetMetadata = connectionData.GetEntityMetadataId(optionSetName);

                //if (idOptionSetMetadata.HasValue)
                //{
                //    switch (actionOnComponent)
                //    {
                //        case ActionOnComponent.OpenInWeb:
                //            connectionData.OpenEntityMetadataInWeb(idOptionSetMetadata.Value);
                //            return;

                //        case ActionOnComponent.OpenDependentComponentsInWeb:
                //            connectionData.OpenSolutionComponentDependentComponentsInWeb(Entities.ComponentType.Entity, idOptionSetMetadata.Value);
                //            return;
                //    }
                //}

                ActivateOutputWindow(connectionData);
                WriteToOutputEmptyLines(connectionData, commonConfig);

                try
                {
                    Controller.StartGlobalOptionSetMetadataOpenInWeb(connectionData, commonConfig, optionSetName, actionOnComponent);
                }
                catch (Exception ex)
                {
                    WriteErrorToOutput(connectionData, ex);
                }
            }
        }
예제 #18
0
        public void OpenEntityMetadataCommand(ConnectionData connectionData, string entityName, ActionOnComponent actionOnComponent)
        {
            CommonConfiguration commonConfig = CommonConfiguration.Get();

            if (connectionData == null)
            {
                if (!HasCurrentCrmConnection(out ConnectionConfiguration crmConfig))
                {
                    return;
                }

                connectionData = crmConfig.CurrentConnectionData;
            }

            if (connectionData != null && commonConfig != null)
            {
                CheckWishToChangeCurrentConnection(connectionData);

                if (actionOnComponent == ActionOnComponent.OpenListInWeb)
                {
                    connectionData.OpenEntityInstanceListInWeb(entityName);
                    return;
                }

                var idEntityMetadata = connectionData.GetEntityMetadataId(entityName);

                if (idEntityMetadata.HasValue)
                {
                    switch (actionOnComponent)
                    {
                    case ActionOnComponent.OpenInWeb:
                        connectionData.OpenEntityMetadataInWeb(idEntityMetadata.Value);
                        return;

                    case ActionOnComponent.OpenDependentComponentsInWeb:
                        connectionData.OpenSolutionComponentDependentComponentsInWeb(Entities.ComponentType.Entity, idEntityMetadata.Value);
                        return;
                    }
                }

                ActivateOutputWindow(connectionData);
                WriteToOutputEmptyLines(connectionData, commonConfig);

                try
                {
                    Controller.StartEntityMetadataOpenInWeb(connectionData, commonConfig, entityName, actionOnComponent);
                }
                catch (Exception ex)
                {
                    WriteErrorToOutput(connectionData, ex);
                }
            }
        }
예제 #19
0
 public void HandleSystemFormGetCurrentAttributeCommand(ConnectionData connectionData, Guid formId, ActionOnComponent actionOnComponent, string fieldName, string fieldTitle)
 {
     GetConnectionConfigAndExecute(connectionData, (conn, commonConfig) => Controller.StartSystemFormGetCurrentAttribute(conn, commonConfig, formId, actionOnComponent, fieldName, fieldTitle));
 }
 private CSharpProjectPluginTypeActionOnComponentInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, ISourceSelectedFiles sourceSelectedFiles, ActionOnComponent actionOnComponent)
     : base(commandService, baseIdStart)
 {
     this._sourceSelectedFiles = sourceSelectedFiles;
     this._actionOnComponent   = actionOnComponent;
 }
예제 #21
0
        public void HandleOpenReportCommand(ConnectionData connectionData, SelectedFile selectedFile, ActionOnComponent actionOnComponent)
        {
            if (selectedFile == null)
            {
                return;
            }

            CommonConfiguration commonConfig = CommonConfiguration.Get();

            if (connectionData == null)
            {
                if (!HasCurrentCrmConnection(out ConnectionConfiguration crmConfig))
                {
                    return;
                }

                connectionData = crmConfig.CurrentConnectionData;
            }

            if (connectionData != null && commonConfig != null)
            {
                CheckWishToChangeCurrentConnection(connectionData);

                var objectId = connectionData.GetLastLinkForFile(selectedFile.FriendlyFilePath);

                if (objectId.HasValue)
                {
                    switch (actionOnComponent)
                    {
                    case ActionOnComponent.OpenInWeb:
                        connectionData.OpenEntityInstanceInWeb(Entities.Report.EntityLogicalName, objectId.Value);
                        return;

                    case ActionOnComponent.OpenDependentComponentsInWeb:
                        connectionData.OpenSolutionComponentDependentComponentsInWeb(Entities.ComponentType.Report, objectId.Value);
                        return;
                    }
                }

                ActivateOutputWindow(connectionData);
                WriteToOutputEmptyLines(connectionData, commonConfig);

                try
                {
                    Controller.StartOpeningReport(connectionData, commonConfig, selectedFile, actionOnComponent);
                }
                catch (Exception ex)
                {
                    WriteErrorToOutput(connectionData, ex);
                }
            }
        }
        private async Task OpeningReport(CommonConfiguration commonConfig, ConnectionData connectionData, SelectedFile selectedFile, ActionOnComponent actionOnComponent)
        {
            if (!File.Exists(selectedFile.FilePath))
            {
                this._iWriteToOutput.WriteToOutput(connectionData, Properties.OutputStrings.FileNotExistsFormat1, selectedFile.FilePath);
                return;
            }

            var service = await ConnectAndWriteToOutputAsync(connectionData);

            if (service == null)
            {
                return;
            }

            // Репозиторий для работы с веб-ресурсами
            ReportRepository reportRepository = new ReportRepository(service);

            Report reportEntity = await reportRepository.FindAsync(selectedFile.FileName);

            if (reportEntity != null)
            {
                this._iWriteToOutput.WriteToOutput(connectionData, Properties.OutputStrings.ReportFoundedByNameFormat2, reportEntity.Id.ToString(), reportEntity.Name);

                connectionData.AddMapping(reportEntity.Id, selectedFile.FriendlyFilePath);

                connectionData.Save();
            }
            else
            {
                Guid?reportId = connectionData.GetLastLinkForFile(selectedFile.FriendlyFilePath);

                if (reportId.HasValue)
                {
                    reportEntity = await reportRepository.GetByIdAsync(reportId.Value);
                }

                if (reportEntity != null)
                {
                    this._iWriteToOutput.WriteToOutput(connectionData, "Report not founded by name. Last link report is selected for opening.");

                    connectionData.AddMapping(reportEntity.Id, selectedFile.FriendlyFilePath);

                    connectionData.Save();
                }
                else
                {
                    this._iWriteToOutput.WriteToOutput(connectionData, "Report not founded by name and has not Last link.");
                    this._iWriteToOutput.WriteToOutput(connectionData, "Starting Custom Report selection form.");

                    bool?dialogResult     = null;
                    Guid?selectedReportId = null;

                    string selectedPath = string.Empty;
                    var    thread       = new Thread(() =>
                    {
                        try
                        {
                            var form = new Views.WindowReportSelect(this._iWriteToOutput, service, selectedFile, reportId);

                            dialogResult     = form.ShowDialog();
                            selectedReportId = form.SelectedReportId;
                        }
                        catch (Exception ex)
                        {
                            DTEHelper.WriteExceptionToOutput(connectionData, ex);
                        }
                    });
                    thread.SetApartmentState(ApartmentState.STA);
                    thread.Start();

                    thread.Join();

                    if (dialogResult.GetValueOrDefault())
                    {
                        if (selectedReportId.HasValue)
                        {
                            this._iWriteToOutput.WriteToOutput(connectionData, "Custom report is selected.");

                            reportEntity = await reportRepository.GetByIdAsync(selectedReportId.Value);

                            connectionData.AddMapping(reportEntity.Id, selectedFile.FriendlyFilePath);

                            connectionData.Save();
                        }
                        else
                        {
                            this._iWriteToOutput.WriteToOutput(connectionData, "!Warning. Report not exists. name: {0}.", selectedFile.Name);
                        }
                    }
                    else
                    {
                        this._iWriteToOutput.WriteToOutput(connectionData, "Opening was cancelled.");
                        return;
                    }
                }
            }

            if (reportEntity == null)
            {
                service.TryDispose();

                this._iWriteToOutput.WriteToOutput(connectionData, Properties.OutputStrings.ReportNotFoundedByNameFormat1, selectedFile.FileName);
                return;
            }

            if (actionOnComponent == ActionOnComponent.OpenInWeb)
            {
                service.UrlGenerator.OpenSolutionComponentInWeb(Entities.ComponentType.Report, reportEntity.Id);
                service.TryDispose();
            }
            else if (actionOnComponent == ActionOnComponent.OpenDependentComponentsInWeb)
            {
                connectionData.OpenSolutionComponentDependentComponentsInWeb(Entities.ComponentType.Report, reportEntity.Id);
                service.TryDispose();
            }
            else if (actionOnComponent == ActionOnComponent.OpenDependentComponentsInExplorer)
            {
                WindowHelper.OpenSolutionComponentDependenciesExplorer(
                    _iWriteToOutput
                    , service
                    , null
                    , commonConfig
                    , (int)ComponentType.Report
                    , reportEntity.Id
                    , null);
            }
            else if (actionOnComponent == ActionOnComponent.OpenSolutionsListWithComponentInExplorer)
            {
                WindowHelper.OpenExplorerSolutionExplorer(
                    _iWriteToOutput
                    , service
                    , commonConfig
                    , (int)ComponentType.Report
                    , reportEntity.Id
                    , null
                    );
            }
        }
예제 #23
0
 private ReportActionOnComponentInConnectionCommand(OleMenuCommandService commandService, int idCommand, ISourceSelectedFiles sourceSelectedFiles, ActionOnComponent actionOnComponent)
     : base(commandService, idCommand)
 {
     this._sourceSelectedFiles = sourceSelectedFiles;
     this._actionOnComponent   = actionOnComponent;
 }
        public void HandleActionOnProjectPluginAssemblyCommand(ConnectionData connectionData, IEnumerable <Project> projectList, ActionOnComponent actionOnComponent)
        {
            if (projectList == null || !projectList.Any(p => !string.IsNullOrEmpty(p.Name)))
            {
                return;
            }

            GetConnectionConfigAndExecute(connectionData, (conn, commonConfig) => Controller.StartActionOnPluginAssembly(conn, commonConfig, projectList, actionOnComponent));
        }
예제 #25
0
 private CSharpProjectPluginAssemblyActionOnComponentInConnectionWithoutCurrentCommand(OleMenuCommandService commandService, int baseIdStart, ISourceSelectedProjects sourceSelectedProjects, ActionOnComponent actionOnComponent)
     : base(commandService, baseIdStart)
 {
     this._sourceSelectedProjects = sourceSelectedProjects;
     this._actionOnComponent      = actionOnComponent;
 }
예제 #26
0
 private CommonExportOpenSolutionLastSelectedCommand(OleMenuCommandService commandService, int baseIdStart, ActionOnComponent actionOnComponent)
     : base(commandService, baseIdStart)
 {
     this._actionOnComponent = actionOnComponent;
 }
        public async Task ExecuteOpeningReport(ConnectionData connectionData, CommonConfiguration commonConfig, SelectedFile selectedFile, ActionOnComponent actionOnComponent)
        {
            string operation = string.Format(
                Properties.OperationNames.ActionOnComponentFormat3
                , connectionData?.Name
                , Report.EntitySchemaName
                , EnumDescriptionTypeConverter.GetEnumNameByDescriptionAttribute(actionOnComponent)
                );

            this._iWriteToOutput.WriteToOutputStartOperation(connectionData, operation);

            try
            {
                await OpeningReport(commonConfig, connectionData, selectedFile, actionOnComponent);
            }
            catch (Exception ex)
            {
                this._iWriteToOutput.WriteErrorToOutput(connectionData, ex);
            }
            finally
            {
                this._iWriteToOutput.WriteToOutputEndOperation(connectionData, operation);
            }
        }
 private CSharpProjectPluginTypeActionOnComponentCommand(OleMenuCommandService commandService, int idCommand, ISourceSelectedFiles sourceSelectedFiles, string commandNameForCorrection, ActionOnComponent actionOnComponent, string fieldName, string fieldTitle)
     : this(commandService, idCommand, sourceSelectedFiles, commandNameForCorrection, actionOnComponent)
 {
     this._fieldName  = fieldName;
     this._fieldTitle = fieldTitle;
 }
 private CodeCSharpLinkedGlobalOptionSetActionOnComponentInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, ActionOnComponent actionOnComponent)
     : base(commandService, baseIdStart, actionOnComponent, SelectedFileType.CSharpHasLinkedGlobalOptionSet)
 {
 }
예제 #30
0
        public void HandleActionOnPluginTypesCommand(ConnectionData connectionData, IEnumerable <SelectedFile> selectedFiles, ActionOnComponent actionOnComponent, string fieldName, string fieldTitle)
        {
            if (!selectedFiles.Any())
            {
                return;
            }

            GetConnectionConfigAndExecute(connectionData, (conn, commonConfig) => HandleActionOnPluginTypesCommandInternal(conn, commonConfig, selectedFiles, actionOnComponent, fieldName, fieldTitle));
        }