Exemple #1
0
        private static void LoadIntellisenseCacheFromDisk()
        {
            var connectionConfig = ConnectionConfiguration.Get();

            if (connectionConfig.CurrentConnectionData != null)
            {
                try
                {
                    GetRepository(connectionConfig.CurrentConnectionData);
                }
                catch (Exception ex)
                {
                    DTEHelper.WriteExceptionToLog(ex);
                }
            }

            foreach (var connectionData in connectionConfig.Connections)
            {
                if (connectionData != connectionConfig.CurrentConnectionData)
                {
                    try
                    {
                        GetRepository(connectionData);
                    }
                    catch (Exception ex)
                    {
                        DTEHelper.WriteExceptionToLog(ex);
                    }
                }
            }
        }
Exemple #2
0
        protected override void CommandAction(DTEHelper helper, OpenFilesType openFilesType)
        {
            List <SelectedFile> selectedFiles = null;

            var selectedFileType = _selectedFileTypeForOpenFilesType[openFilesType];

            if (selectedFileType == SelectedFileType.WebResource)
            {
                selectedFiles = helper.GetSelectedFilesFromListForPublish(FileOperations.SupportsWebResourceType).ToList();
            }
            else if (selectedFileType == SelectedFileType.WebResourceText)
            {
                selectedFiles = helper.GetSelectedFilesFromListForPublish(FileOperations.SupportsWebResourceTextType).ToList();
            }

            if (selectedFiles != null)
            {
                var crmConfig = ConnectionConfiguration.Get();

                var connectionData = crmConfig.CurrentConnectionData;

                if (selectedFiles.Any())
                {
                    helper.ShowListForPublish(connectionData);

                    helper.HandleWebResourceMultiDifferenceFiles(selectedFiles, openFilesType);
                }
                else
                {
                    helper.WriteToOutput(connectionData, Properties.OutputStrings.PublishListIsEmpty);
                }
            }
        }
        public void AugmentCompletionSession(ICompletionSession session, IList <CompletionSet> completionSets)
        {
            if (_isDisposed)
            {
                return;
            }

            var connectionConfig = ConnectionConfiguration.Get();

            var connectionData = connectionConfig?.CurrentConnectionData;

            if (connectionData == null)
            {
                return;
            }

            try
            {
                AugmentCompletionSessionInternal(session, completionSets, connectionData);
            }
            catch (Exception ex)
            {
                DTEHelper.WriteExceptionToOutput(connectionData, ex);
            }
        }
Exemple #4
0
        protected override void CommandAction(DTEHelper helper, string solutionUniqueName)
        {
            var connectionConfig = ConnectionConfiguration.Get();

            if (connectionConfig.CurrentConnectionData != null)
            {
                helper.HandleSolutionOpenWebResourcesInLastSelected(connectionConfig.CurrentConnectionData, solutionUniqueName, this._inTextEditor);
            }
        }
Exemple #5
0
        protected override void CommandAction(DTEHelper helper, string solutionUniqueName)
        {
            var connectionConfig = ConnectionConfiguration.Get();

            if (connectionConfig.CurrentConnectionData != null)
            {
                helper.HandleOpenLastSelectedSolution(connectionConfig.CurrentConnectionData, solutionUniqueName, this._actionOpen);
            }
        }
Exemple #6
0
        protected override IList <string> GetElementSourceCollection()
        {
            var connectionConfig = ConnectionConfiguration.Get();

            if (connectionConfig != null && connectionConfig.CurrentConnectionData != null)
            {
                return(connectionConfig.CurrentConnectionData.LastSelectedSolutionsUniqueName);
            }

            return(EmptyCollection);
        }
        protected override void CommandAction(DTEHelper helper, OpenFilesType openFilesType)
        {
            var selectedFiles = helper.GetSelectedFilesFromListForPublish(FileOperations.SupportsWebResourceTextType).ToList();

            var crmConfig = ConnectionConfiguration.Get();

            var connectionData = crmConfig.CurrentConnectionData;

            if (selectedFiles.Any())
            {
                helper.ShowListForPublish(connectionData);

                helper.HandleWebResourceOpenFilesCommand(selectedFiles, openFilesType, _inTextEditor);
            }
            else
            {
                helper.WriteToOutput(connectionData, Properties.OutputStrings.PublishListIsEmpty);
            }
        }
        protected override void CommandAction(DTEHelper helper, string solutionUniqueName)
        {
            var connectionConfig = ConnectionConfiguration.Get();

            var connectionData = connectionConfig.CurrentConnectionData;

            List <SelectedFile> selectedFiles = helper.GetSelectedFilesFromListForPublish().ToList();

            if (selectedFiles.Any())
            {
                helper.ShowListForPublish(connectionData);

                helper.HandleWebResourceAddingToSolutionCommand(connectionData, solutionUniqueName, false, selectedFiles);
            }
            else
            {
                helper.WriteToOutput(connectionData, Properties.OutputStrings.PublishListIsEmpty);
                helper.ActivateOutputWindow(connectionData);
            }
        }
Exemple #9
0
        public void HandleConnectionOrganizationComparer()
        {
            CommonConfiguration commonConfig = CommonConfiguration.Get();

            ConnectionConfiguration crmConfig = ConnectionConfiguration.Get();

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

                try
                {
                    Controller.StartOrganizationComparer(crmConfig, commonConfig);
                }
                catch (Exception ex)
                {
                    WriteErrorToOutput(null, ex);
                }
            }
        }
Exemple #10
0
        protected override void CommandAction(DTEHelper helper, string solutionUniqueName)
        {
            var connectionConfig = ConnectionConfiguration.Get();

            var connectionData = connectionConfig.CurrentConnectionData;

            List <SelectedFile> selectedFiles = helper.GetSelectedFilesFromListForPublish(FileOperations.SupportsJavaScriptType).ToList();

            if (selectedFiles.Any())
            {
                helper.ShowListForPublish(connectionData);

                var hashFormIds = new HashSet <Guid>();

                foreach (var selectedFile in selectedFiles)
                {
                    if (!File.Exists(selectedFile.FilePath))
                    {
                        continue;
                    }

                    string javaScriptCode = File.ReadAllText(selectedFile.FilePath);

                    if (CommonHandlers.GetLinkedSystemForm(javaScriptCode, out string entityName, out Guid formId, out int formType))
                    {
                        hashFormIds.Add(formId);
                    }
                }

                if (hashFormIds.Any())
                {
                    helper.HandleLinkedSystemFormAddingToSolutionCommand(null, solutionUniqueName, false, hashFormIds);
                }
            }
            else
            {
                helper.WriteToOutput(connectionData, Properties.OutputStrings.PublishListIsEmpty);
                helper.ActivateOutputWindow(connectionData);
            }
        }
Exemple #11
0
        public bool HasCurrentCrmConnection(out ConnectionConfiguration connectionConfig)
        {
            bool result = false;

            connectionConfig = ConnectionConfiguration.Get();

            if (connectionConfig.CurrentConnectionData == null)
            {
                this.WriteToOutput(null, Properties.OutputStrings.CurrentCrmConnectionIsNotSelected);
                this.ActivateOutputWindow(null);

                var crmConnection = new WindowCrmConnectionList(this, connectionConfig, true);

                crmConnection.ShowDialog();

                connectionConfig.Save();
            }

            result = connectionConfig.CurrentConnectionData != null;

            return(result);
        }
        public ConnectionData GetOutputWindowConnection()
        {
            if (ApplicationObject.ActiveWindow.Object != null &&
                ApplicationObject.ActiveWindow.Object is OutputWindow outputWindow &&
                outputWindow.ActivePane != null
                )
            {
                var outputWindowPane = outputWindow.ActivePane;

                if (!string.IsNullOrEmpty(outputWindowPane.Guid) &&
                    Guid.TryParse(outputWindowPane.Guid, out var paneGuid)
                    )
                {
                    var connectionConfig = ConnectionConfiguration.Get();

                    var connectionData = connectionConfig.Connections.FirstOrDefault(c => c.ConnectionId == paneGuid);

                    return(connectionData);
                }
            }

            return(null);
        }
Exemple #13
0
        protected override async System.Threading.Tasks.Task InitializeAsync(System.Threading.CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            // When initialized asynchronously, we *may* be on a background thread at this point.
            // Do any initialization that requires the UI thread after switching to the UI thread.
            // Otherwise, remove the switch to the UI thread if you don't need it.
            await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            OleMenuCommandService commandService = await this.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            foreach (var actionInitialize in _initializeActions)
            {
                actionInitialize(commandService);
            }

            this.ApplicationObject = await this.GetServiceAsync(typeof(EnvDTE.DTE)) as EnvDTE80.DTE2;

            Singleton = this;

            var task1 = System.Threading.Tasks.Task.Run(() => CommonConfiguration.Get());
            var task2 = System.Threading.Tasks.Task.Run(() => ConnectionConfiguration.Get());
        }
Exemple #14
0
        public void HandleConnectionOpenList()
        {
            ConnectionConfiguration connectionConfig = ConnectionConfiguration.Get();

            var thread = new System.Threading.Thread(() =>
            {
                try
                {
                    var form = new WindowCrmConnectionList(this, connectionConfig);

                    form.ShowDialog();

                    connectionConfig.Save();
                }
                catch (Exception ex)
                {
                    DTEHelper.WriteExceptionToOutput(null, ex);
                }
            });

            thread.SetApartmentState(System.Threading.ApartmentState.STA);

            thread.Start();
        }
Exemple #15
0
        public void AugmentCompletionSession(ICompletionSession session, IList <CompletionSet> completionSets)
        {
            if (_isDisposed)
            {
                return;
            }

            var connectionConfig = ConnectionConfiguration.Get();

            if (connectionConfig?.CurrentConnectionData == null)
            {
                return;
            }

            ITextSnapshot snapshot     = _buffer.CurrentSnapshot;
            var           triggerPoint = session.GetTriggerPoint(snapshot);

            if (triggerPoint == null)
            {
                return;
            }

            var repository = ConnectionIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);

            SnapshotSpan extent = FindTokenSpanAtPosition(session).GetSpan(snapshot);

            ITrackingSpan applicableTo = null;

            if (extent.GetText() == ".")
            {
                extent = new SnapshotSpan(extent.Start + 1, extent.End);
            }

            var line = triggerPoint.Value.GetContainingLine().Extent;

            var relativePath = string.Empty;

            if (line.Start <= extent.Start)
            {
                relativePath = new SnapshotSpan(line.Start, extent.Start).GetText().TrimEnd('.');
            }

            applicableTo = snapshot.CreateTrackingSpan(extent, SpanTrackingMode.EdgeInclusive);

            var intellisenseData = repository.GetEntitiesIntellisenseData();

            if (intellisenseData == null ||
                intellisenseData.Entities == null
                )
            {
                return;
            }

            try
            {
                if (string.IsNullOrEmpty(relativePath))
                {
                    FillEntityNamesInList(completionSets, applicableTo, intellisenseData, false);
                }
                else
                {
                    var usedEntities = GetUsedEntitiesFromPath(relativePath, intellisenseData);

                    if (usedEntities.Any())
                    {
                        repository.GetEntityDataForNamesAsync(usedEntities);
                    }

                    var entityNameHash = GetEntityNameFromPath(relativePath, intellisenseData, out bool isGuid);

                    if (entityNameHash != null)
                    {
                        if (entityNameHash.Count == 1)
                        {
                            var entityName = entityNameHash.First();

                            var entityData = repository.GetEntityAttributeIntellisense(entityName);

                            if (entityData != null)
                            {
                                FillEntityIntellisenseDataAttributes(completionSets, applicableTo, entityData);

                                FillMultiLinkForEntity(completionSets, applicableTo, intellisenseData, entityData);
                            }
                        }
                        else if (entityNameHash.Count > 0)
                        {
                            FillMultiLinkEntityForEntities(completionSets, applicableTo, entityNameHash, intellisenseData);
                        }
                        else if (isGuid)
                        {
                            FillMultiLinkEntityForAll(completionSets, applicableTo, intellisenseData);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                DTEHelper.WriteExceptionToOutput(connectionConfig.CurrentConnectionData, ex);
            }
        }
Exemple #16
0
        protected override IList <Tuple <ConnectionData, ConnectionData> > GetElementSourceCollection()
        {
            var connectionConfig = ConnectionConfiguration.Get();

            return(connectionConfig.GetConnectionPairsByGroup());
        }
        protected override ICollection <ConnectionData> GetElementSourceCollection()
        {
            var connectionConfig = ConnectionConfiguration.Get();

            return(connectionConfig.Connections);
        }
Exemple #18
0
        protected override ICollection <ConnectionData> GetElementSourceCollection()
        {
            var connectionConfig = ConnectionConfiguration.Get();

            return(connectionConfig.GetConnectionsByGroupWithCurrent());
        }
Exemple #19
0
        public static ConnectionData GetCurrentConnection()
        {
            ConnectionConfiguration connectionConfig = ConnectionConfiguration.Get();

            return(connectionConfig?.CurrentConnectionData);
        }
Exemple #20
0
        protected override async System.Threading.Tasks.Task InitializeAsync(System.Threading.CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            // When initialized asynchronously, we *may* be on a background thread at this point.
            // Do any initialization that requires the UI thread after switching to the UI thread.
            // Otherwise, remove the switch to the UI thread if you don't need it.
            await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            OleMenuCommandService commandService = await this.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            CodePublishListAddCommand.Initialize(commandService);
            CodePublishListRemoveCommand.Initialize(commandService);

            #region CodeWebResource

            CodeWebResourceCheckEncodingCommand.Initialize(commandService);
            CodeWebResourceCompareWithDetailsCommand.Initialize(commandService);
            CodeWebResourceCompareWithDetailsInConnectionGroupCommand.Initialize(commandService);
            CodeWebResourceShowDifferenceCommand.Initialize(commandService);
            CodeWebResourceShowDifferenceCustomCommand.Initialize(commandService);
            CodeWebResourceShowDifferenceInConnectionGroupCommand.Initialize(commandService);
            CodeWebResourceShowDifferenceThreeFileCommand.Initialize(commandService);
            CodeWebResourceExplorerCommand.Initialize(commandService);
            CodeWebResourceOpenInWebCommand.Initialize(commandService);
            CodeWebResourceLinkClearCommand.Initialize(commandService);
            CodeWebResourceLinkCreateCommand.Initialize(commandService);
            CodeWebResourceUpdateContentPublishCommand.Initialize(commandService);
            CodeWebResourceUpdateContentPublishGroupConnectionCommand.Initialize(commandService);

            CodeWebResourceAddToSolutionLastCommand.Initialize(commandService);
            CodeWebResourceAddToSolutionInConnectionCommand.Initialize(commandService);

            #endregion CodeWebResource

            #region DocumentsWebResource

            DocumentsWebResourceCheckEncodingCommand.Initialize(commandService);
            DocumentsWebResourceCheckEncodingCompareFilesCommand.Initialize(commandService);
            DocumentsWebResourceCheckEncodingCompareWithDetailsFilesCommand.Initialize(commandService);
            DocumentsWebResourceCompareCommand.Initialize(commandService);
            DocumentsWebResourceCompareWithDetailsCommand.Initialize(commandService);
            DocumentsWebResourceCompareInConnectionGroupCommand.Initialize(commandService);
            DocumentsWebResourceLinkClearCommand.Initialize(commandService);
            DocumentsWebResourceLinkCreateCommand.Initialize(commandService);
            DocumentsWebResourceShowDependentComponentsCommand.Initialize(commandService);
            DocumentsWebResourceUpdateContentPublishEqualByTextCommand.Initialize(commandService);
            DocumentsWebResourceUpdateContentPublishGroupConnectionCommand.Initialize(commandService);

            DocumentsWebResourceAddToSolutionLastCommand.Initialize(commandService);
            DocumentsWebResourceAddToSolutionInConnectionCommand.Initialize(commandService);

            DocumentsWebResourceMultiDifferenceCommand.Initialize(commandService);

            DocumentsWebResourceAddFilesIntoListForPublishCommand.Initialize(commandService);

            #endregion DocumentsWebResource

            #region FileWebResource

            FileWebResourceCheckEncodingCommand.Initialize(commandService);
            FileWebResourceCheckEncodingCompareFilesCommand.Initialize(commandService);
            FileWebResourceCheckEncodingCompareWithDetailsFilesCommand.Initialize(commandService);
            FileWebResourceCheckEncodingOpenFilesCommand.Initialize(commandService);
            FileWebResourceCompareCommand.Initialize(commandService);
            FileWebResourceCompareWithDetailsCommand.Initialize(commandService);
            FileWebResourceCompareInConnectionGroupCommand.Initialize(commandService);
            FileWebResourceExplorerCommand.Initialize(commandService);
            FileWebResourceOpenInWebCommand.Initialize(commandService);
            FileWebResourceLinkClearCommand.Initialize(commandService);
            FileWebResourceLinkCreateCommand.Initialize(commandService);
            FileWebResourceShowDependentComponentsCommand.Initialize(commandService);
            FileWebResourceShowDifferenceCommand.Initialize(commandService);
            FileWebResourceShowDifferenceCustomCommand.Initialize(commandService);
            FileWebResourceShowDifferenceInConnectionGroupCommand.Initialize(commandService);
            FileWebResourceShowDifferenceThreeFileCommand.Initialize(commandService);
            FileWebResourceUpdateContentPublishCommand.Initialize(commandService);
            FileWebResourceUpdateContentPublishEqualByTextCommand.Initialize(commandService);
            FileWebResourceUpdateContentPublishGroupConnectionCommand.Initialize(commandService);

            FileWebResourceAddToSolutionLastCommand.Initialize(commandService);
            FileWebResourceAddToSolutionInConnectionCommand.Initialize(commandService);

            FileWebResourceOpenFilesCommand.Initialize(commandService);

            FileWebResourceMultiDifferenceCommand.Initialize(commandService);

            FileWebResourceAddFilesIntoListForPublishCommand.Initialize(commandService);

            #endregion FileWebResource

            #region FolderWebResource

            FolderWebResourceCheckEncodingCommand.Initialize(commandService);
            FolderWebResourceCheckEncodingCompareFilesCommand.Initialize(commandService);
            FolderWebResourceCheckEncodingCompareWithDetailsFilesCommand.Initialize(commandService);
            FolderWebResourceCheckEncodingOpenFilesCommand.Initialize(commandService);
            FolderWebResourceCompareCommand.Initialize(commandService);
            FolderWebResourceCompareWithDetailsCommand.Initialize(commandService);
            FolderWebResourceCompareInConnectionGroupCommand.Initialize(commandService);
            FolderWebResourceLinkClearCommand.Initialize(commandService);
            FolderWebResourceLinkCreateCommand.Initialize(commandService);
            FolderWebResourceShowDependentComponentsCommand.Initialize(commandService);
            FolderWebResourceUpdateContentPublishCommand.Initialize(commandService);
            FolderWebResourceUpdateContentPublishEqualByTextCommand.Initialize(commandService);
            FolderWebResourceUpdateContentPublishGroupConnectionCommand.Initialize(commandService);

            FolderWebResourceAddToSolutionLastCommand.Initialize(commandService);
            FolderWebResourceAddToSolutionInConnectionCommand.Initialize(commandService);

            FolderWebResourceOpenFilesCommand.Initialize(commandService);

            FolderWebResourceMultiDifferenceCommand.Initialize(commandService);

            FolderWebResourceAddFilesIntoListForPublishCommand.Initialize(commandService);

            #endregion FolderWebResource



            #region CodeJavaScript

            CodeJavaScriptUpdateEntityMetadataFileCommand.Initialize(commandService);
            CodeJavaScriptUpdateEntityMetadataFileWithSelectCommand.Initialize(commandService);

            CodeJavaScriptUpdateGlobalOptionSetSingleFileCommand.Initialize(commandService);
            CodeJavaScriptUpdateGlobalOptionSetSingleFileWithSelectCommand.Initialize(commandService);

            CodeJavaScriptUpdateGlobalOptionSetAllFileCommand.Initialize(commandService);

            #endregion CodeJavaScript

            #region DocumentsJavaScript

            DocumentsJavaScriptUpdateEntityMetadataFileCommand.Initialize(commandService);
            DocumentsJavaScriptUpdateGlobalOptionSetSingleFileCommand.Initialize(commandService);

            #endregion DocumentsJavaScript

            #region FileJavaScript

            FileJavaScriptUpdateEntityMetadataFileCommand.Initialize(commandService);
            FileJavaScriptUpdateEntityMetadataFileWithSelectCommand.Initialize(commandService);

            FileJavaScriptUpdateGlobalOptionSetSingleFileCommand.Initialize(commandService);
            FileJavaScriptUpdateGlobalOptionSetSingleFileWithSelectCommand.Initialize(commandService);

            FileJavaScriptUpdateGlobalOptionSetAllFileCommand.Initialize(commandService);

            #endregion FileJavaScript

            #region FolderJavaScript

            FolderJavaScriptUpdateEntityMetadataFileCommand.Initialize(commandService);
            FolderJavaScriptUpdateGlobalOptionSetSingleFileCommand.Initialize(commandService);

            #endregion FolderJavaScript



            #region CodeXml

            CodeXmlExecuteFetchXmlRequestCommand.Initialize(commandService);
            CodeXmlExecuteFetchXmlRequestInConnectionsCommand.Initialize(commandService);
            CodeXmlConvertFetchXmlToJavaScriptCodeCommand.Initialize(commandService);
            CodeXmlRibbonDiffInsertIntellisenseContextCommand.Initialize(commandService);
            CodeXmlRibbonDiffRemoveIntellisenseContextCommand.Initialize(commandService);

            #region SiteMap

            CodeXmlSiteMapOpenInWebCommand.Initialize(commandService);
            CodeXmlSiteMapExplorerCommand.Initialize(commandService);

            CodeXmlSiteMapShowDifferenceDefaultCommand.Initialize(commandService);
            CodeXmlSiteMapShowDifferenceCommand.Initialize(commandService);
            CodeXmlSiteMapShowDifferenceInConnectionGroupCommand.Initialize(commandService);

            CodeXmlSiteMapUpdateCommand.Initialize(commandService);
            CodeXmlSiteMapUpdateInConnectionGroupCommand.Initialize(commandService);

            #endregion SiteMap

            #region SystemForm

            CodeXmlSystemFormExplorerCommand.Initialize(commandService);
            CodeXmlSystemFormOpenInWebCommand.Initialize(commandService);

            CodeXmlSystemFormShowDifferenceCommand.Initialize(commandService);
            CodeXmlSystemFormShowDifferenceInConnectionGroupCommand.Initialize(commandService);

            CodeXmlSystemFormUpdateCommand.Initialize(commandService);
            CodeXmlSystemFormUpdateInConnectionGroupCommand.Initialize(commandService);

            #endregion SystemForm

            #region SavedQuery

            CodeXmlSavedQueryExplorerCommand.Initialize(commandService);
            CodeXmlSavedQueryOpenInWebCommand.Initialize(commandService);

            CodeXmlSavedQueryShowDifferenceCommand.Initialize(commandService);
            CodeXmlSavedQueryShowDifferenceInConnectionGroupCommand.Initialize(commandService);

            CodeXmlSavedQueryUpdateCommand.Initialize(commandService);
            CodeXmlSavedQueryUpdateInConnectionGroupCommand.Initialize(commandService);

            #endregion SavedQuery

            #region Ribbon

            CodeXmlRibbonOpenInWebCommand.Initialize(commandService);

            CodeXmlRibbonExplorerCommand.Initialize(commandService);

            CodeXmlRibbonShowDifferenceCommand.Initialize(commandService);
            CodeXmlRibbonShowDifferenceInConnectionGroupCommand.Initialize(commandService);
            CodeXmlRibbonDiffXmlShowDifferenceCommand.Initialize(commandService);
            CodeXmlRibbonDiffXmlShowDifferenceInConnectionGroupCommand.Initialize(commandService);

            CodeXmlRibbonDiffXmlUpdateCommand.Initialize(commandService);
            CodeXmlRibbonDiffXmlUpdateInConnectionGroupCommand.Initialize(commandService);

            #endregion Ribbon

            #region Workflow

            CodeXmlWorkflowExplorerCommand.Initialize(commandService);
            CodeXmlWorkflowOpenInWebCommand.Initialize(commandService);

            CodeXmlWorkflowShowDifferenceCommand.Initialize(commandService);
            CodeXmlWorkflowShowDifferenceInConnectionGroupCommand.Initialize(commandService);

            CodeXmlWorkflowUpdateCommand.Initialize(commandService);
            CodeXmlWorkflowUpdateInConnectionGroupCommand.Initialize(commandService);

            #endregion Workflow

            CodeXmlOpenXsdSchemaFolderCommand.Initialize(commandService);
            CodeXmlSetXsdSchemaCommand.Initialize(commandService);
            CodeXmlRemoveXsdSchemaCommand.Initialize(commandService);

            #endregion CodeXml

            #region DocumentsXml

            DocumentsXmlOpenXsdSchemaFolderCommand.Initialize(commandService);

            DocumentsXmlSetXsdSchemaCommand.Initialize(commandService);

            DocumentsXmlRemoveXsdSchemaCommand.Initialize(commandService);

            #endregion DocumentsXml

            #region FileXml

            FileXmlOpenXsdSchemaFolderCommand.Initialize(commandService);

            FileXmlSetXsdSchemaCommand.Initialize(commandService);

            FileXmlRemoveXsdSchemaCommand.Initialize(commandService);

            #endregion FileXml

            #region FolderXml

            FolderXmlOpenXsdSchemaFolderCommand.Initialize(commandService);

            FolderXmlSetXsdSchemaCommand.Initialize(commandService);

            FolderXmlRemoveXsdSchemaCommand.Initialize(commandService);

            #endregion FolderXml



            #region CodeReport

            CodeReportLinkClearCommand.Initialize(commandService);
            CodeReportLinkCreateCommand.Initialize(commandService);
            CodeReportUpdateCommand.Initialize(commandService);
            CodeReportCreateCommand.Initialize(commandService);
            CodeReportShowDifferenceCommand.Initialize(commandService);
            CodeReportShowDifferenceInConnectionGroupCommand.Initialize(commandService);
            CodeReportShowDifferenceThreeFileCommand.Initialize(commandService);
            CodeReportExplorerCommand.Initialize(commandService);
            CodeReportOpenInWebCommand.Initialize(commandService);

            CodeReportAddToSolutionLastCommand.Initialize(commandService);
            CodeReportAddToSolutionInConnectionCommand.Initialize(commandService);

            #endregion CodeReport

            #region DocumentsReport

            DocumentsReportLinkClearCommand.Initialize(commandService);

            DocumentsReportAddToSolutionLastCommand.Initialize(commandService);
            DocumentsReportAddToSolutionInConnectionCommand.Initialize(commandService);

            #endregion DocumentsReport

            #region FileReport

            FileReportExplorerCommand.Initialize(commandService);
            FileReportLinkClearCommand.Initialize(commandService);
            FileReportLinkCreateCommand.Initialize(commandService);
            FileReportUpdateCommand.Initialize(commandService);
            FileReportCreateCommand.Initialize(commandService);
            FileReportOpenInWebCommand.Initialize(commandService);

            FileReportAddToSolutionLastCommand.Initialize(commandService);
            FileReportAddToSolutionInConnectionCommand.Initialize(commandService);

            #endregion FileReport



            #region CodeCSharp

            CodeCSharpUpdateEntityMetadataFileSchemaCommand.Initialize(commandService);
            CodeCSharpUpdateEntityMetadataFileSchemaWithSelectCommand.Initialize(commandService);

            CodeCSharpUpdateEntityMetadataFileProxyClassCommand.Initialize(commandService);
            CodeCSharpUpdateEntityMetadataFileProxyClassWithSelectCommand.Initialize(commandService);

            CodeCSharpUpdateGlobalOptionSetsFileCommand.Initialize(commandService);
            CodeCSharpUpdateGlobalOptionSetsFileWithSelectCommand.Initialize(commandService);

            CodeCSharpProjectUpdatePluginAssemblyCommand.Initialize(commandService);
            CodeCSharpProjectUpdatePluginAssemblyInConnectionCommand.Initialize(commandService);

            CodeCSharpProjectCompareToCrmAssemblyCommand.Initialize(commandService);
            CodeCSharpProjectCompareToCrmAssemblyInConnectionCommand.Initialize(commandService);

            CodeCSharpPluginTypeExplorerCommand.Initialize(commandService);
            CodeCSharpPluginAssemblyExplorerCommand.Initialize(commandService);
            CodeCSharpPluginTreeCommand.Initialize(commandService);

            CodeCSharpAddPluginStepCommand.Initialize(commandService);
            CodeCSharpAddPluginStepInConnectionCommand.Initialize(commandService);

            CodeCSharpProjectPluginAssemblyAddToSolutionLastCommand.Initialize(commandService);
            CodeCSharpProjectPluginAssemblyAddToSolutionInConnectionCommand.Initialize(commandService);

            CodeCSharpProjectPluginAssemblyStepsAddToSolutionLastCommand.Initialize(commandService);
            CodeCSharpProjectPluginAssemblyStepsAddToSolutionInConnectionCommand.Initialize(commandService);

            CodeCSharpProjectPluginTypeStepsAddToSolutionLastCommand.Initialize(commandService);
            CodeCSharpProjectPluginTypeStepsAddToSolutionInConnectionCommand.Initialize(commandService);

            #endregion CodeCSharp

            #region DocumentsCSharp

            DocumentsCSharpUpdateEntityMetadataFileSchemaCommand.Initialize(commandService);
            DocumentsCSharpUpdateEntityMetadataFileProxyClassCommand.Initialize(commandService);
            DocumentsCSharpUpdateGlobalOptionSetsFileCommand.Initialize(commandService);

            DocumentsCSharpProjectPluginAssemblyAddToSolutionLastCommand.Initialize(commandService);
            DocumentsCSharpProjectPluginAssemblyAddToSolutionInConnectionCommand.Initialize(commandService);

            DocumentsCSharpProjectPluginAssemblyStepsAddToSolutionLastCommand.Initialize(commandService);
            DocumentsCSharpProjectPluginAssemblyStepsAddToSolutionInConnectionCommand.Initialize(commandService);

            DocumentsCSharpProjectPluginTypeStepsAddToSolutionLastCommand.Initialize(commandService);
            DocumentsCSharpProjectPluginTypeStepsAddToSolutionInConnectionCommand.Initialize(commandService);

            #endregion DocumentsCSharp

            #region FileCSharp

            FileCSharpUpdateEntityMetadataFileSchemaCommand.Initialize(commandService);
            FileCSharpUpdateEntityMetadataFileSchemaWithSelectCommand.Initialize(commandService);

            FileCSharpUpdateEntityMetadataFileProxyClassCommand.Initialize(commandService);
            FileCSharpUpdateEntityMetadataFileProxyClassWithSelectCommand.Initialize(commandService);

            FileCSharpUpdateGlobalOptionSetsFileCommand.Initialize(commandService);
            FileCSharpUpdateGlobalOptionSetsFileWithSelectCommand.Initialize(commandService);
            FileCSharpPluginAssemblyExplorerCommand.Initialize(commandService);
            FileCSharpProjectUpdatePluginAssemblyCommand.Initialize(commandService);
            FileCSharpProjectUpdatePluginAssemblyInConnectionCommand.Initialize(commandService);
            FileCSharpProjectCompareToCrmAssemblyCommand.Initialize(commandService);
            FileCSharpProjectCompareToCrmAssemblyInConnectionCommand.Initialize(commandService);
            FileCSharpPluginTypeExplorerCommand.Initialize(commandService);
            FileCSharpPluginTreeCommand.Initialize(commandService);

            FileCSharpAddPluginStepCommand.Initialize(commandService);
            FileCSharpAddPluginStepInConnectionCommand.Initialize(commandService);

            FileCSharpProjectPluginAssemblyAddToSolutionLastCommand.Initialize(commandService);
            FileCSharpProjectPluginAssemblyAddToSolutionInConnectionCommand.Initialize(commandService);

            FileCSharpProjectPluginAssemblyStepsAddToSolutionLastCommand.Initialize(commandService);
            FileCSharpProjectPluginAssemblyStepsAddToSolutionInConnectionCommand.Initialize(commandService);

            FileCSharpProjectPluginTypeStepsAddToSolutionLastCommand.Initialize(commandService);
            FileCSharpProjectPluginTypeStepsAddToSolutionInConnectionCommand.Initialize(commandService);

            #endregion FileCSharp

            #region FolderCSharp

            FolderCSharpProjectPluginAssemblyAddToSolutionInConnectionCommand.Initialize(commandService);
            FolderCSharpProjectPluginAssemblyAddToSolutionLastCommand.Initialize(commandService);

            FolderCSharpProjectPluginAssemblyStepsAddToSolutionInConnectionCommand.Initialize(commandService);
            FolderCSharpProjectPluginAssemblyStepsAddToSolutionLastCommand.Initialize(commandService);

            FolderCSharpProjectPluginTypeStepsAddToSolutionInConnectionCommand.Initialize(commandService);
            FolderCSharpProjectPluginTypeStepsAddToSolutionLastCommand.Initialize(commandService);

            FolderCSharpUpdateEntityMetadataFileSchemaCommand.Initialize(commandService);
            FolderCSharpUpdateEntityMetadataFileProxyClassCommand.Initialize(commandService);
            FolderCSharpUpdateGlobalOptionSetsFileCommand.Initialize(commandService);

            #endregion FolderCSharp



            #region FolderAdd

            FolderAddPluginConfigurationFileCommand.Initialize(commandService);
            FolderAddSolutionFileCommand.Initialize(commandService);
            FolderAddEntityMetadataFileInConnectionCommand.Initialize(commandService);
            FolderAddGlobalOptionSetFileInConnectionCommand.Initialize(commandService);
            FolderAddSdkMessageRequestFileInConnectionCommand.Initialize(commandService);
            FolderAddSystemFormJavaScriptFileInConnectionCommand.Initialize(commandService);

            #endregion FolderAdd

            #region Project

            ProjectUpdatePluginAssemblyCommand.Initialize(commandService);
            ProjectUpdatePluginAssemblyInConnectionCommand.Initialize(commandService);

            ProjectRegisterPluginAssemblyInConnectionCommand.Initialize(commandService);

            ProjectCompareToCrmAssemblyCommand.Initialize(commandService);
            ProjectCompareToCrmAssemblyInConnectionCommand.Initialize(commandService);

            ProjectPluginAssemblyAddToSolutionLastCommand.Initialize(commandService);
            ProjectPluginAssemblyAddToSolutionInConnectionCommand.Initialize(commandService);

            ProjectPluginAssemblyStepsAddToSolutionLastCommand.Initialize(commandService);
            ProjectPluginAssemblyStepsAddToSolutionInConnectionCommand.Initialize(commandService);

            ProjectPluginAssemblyExplorerCommand.Initialize(commandService);
            ProjectPluginTypeExplorerCommand.Initialize(commandService);
            ProjectPluginTreeCommand.Initialize(commandService);

            #endregion Project

            #region ListForPublish

            ListForPublishClearListCommand.Initialize(commandService);
            ListForPublishCompareCommand.Initialize(commandService);
            ListForPublishCompareWithDetailsCommand.Initialize(commandService);
            ListForPublishCompareInConnectionGroupCommand.Initialize(commandService);
            ListForPublishFilesAddCommand.Initialize(commandService);
            ListForPublishFilesRemoveCommand.Initialize(commandService);
            ListForPublishPerformPublishEqualByTextCommand.Initialize(commandService);
            ListForPublishPerformPublishGroupConnectionCommand.Initialize(commandService);
            ListForPublishShowListCommand.Initialize(commandService);

            ListForPublishAddToSolutionLastCommand.Initialize(commandService);
            ListForPublishAddToSolutionInConnectionCommand.Initialize(commandService);

            ListForPublishOpenFilesCommand.Initialize(commandService);

            ListForPublishMultiDifferenceCommand.Initialize(commandService);

            #endregion ListForPublish

            #region CrmConnection

            CommonCurrentConnectionCommand.Initialize(commandService);

            CommonPublishAllInCrmConnectionCommand.Initialize(commandService);

            CommonCrmConnectionCommand.Initialize(commandService);
            CommonCrmConnectionTestCommand.Initialize(commandService);
            CommonCrmConnectionEditCommand.Initialize(commandService);
            CommonCrmConnectionSelectFileCommand.Initialize(commandService);

            CommonSelectCrmConnectionCommand.Initialize(commandService);

            #endregion CrmConnection

            #region Common Check

            CommonCheckEntitiesOwnerShipsCommand.Initialize(commandService);
            CommonCheckWorkflowsUsedEntitiesCommand.Initialize(commandService);
            CommonCheckWorkflowsUsedNotExistsEntitiesCommand.Initialize(commandService);
            CommonCheckGlobalOptionSetDuplicateCommand.Initialize(commandService);
            CommonCheckManagedElementsCommand.Initialize(commandService);
            CommonCheckPluginImagesCommand.Initialize(commandService);
            CommonCheckPluginImagesRequiredComponentsCommand.Initialize(commandService);
            CommonCheckPluginStepsCommand.Initialize(commandService);
            CommonCheckPluginStepsRequiredComponentsCommand.Initialize(commandService);

            CommonCheckComponentTypeEnumCommand.Initialize(commandService);
            CommonCheckCreateAllDependencyNodeDescriptionCommand.Initialize(commandService);

            #endregion Common Check

            #region Common Finds and Edits

            CommonFindEntityObjectsByPrefixCommand.Initialize(commandService);
            CommonFindEntityObjectsByPrefixInExplorerCommand.Initialize(commandService);

            CommonFindEntityObjectsByPrefixAndShowDependentComponentsCommand.Initialize(commandService);

            CommonFindEntityObjectsMarkedToDeleteInExplorerCommand.Initialize(commandService);
            CommonFindEntityObjectsMarkedToDeleteAndShowDependentComponentsCommand.Initialize(commandService);

            CommonFindEntityObjectsByNameCommand.Initialize(commandService);
            CommonFindEntityObjectsByNameInExplorerCommand.Initialize(commandService);

            CommonFindEntityObjectsContainsStringCommand.Initialize(commandService);
            CommonFindEntityObjectsContainsStringInExplorerCommand.Initialize(commandService);

            CommonFindEntitiesByIdCommand.Initialize(commandService);
            CommonFindEntitiesByUniqueidentifierCommand.Initialize(commandService);

            CommonEditEntitiesByIdCommand.Initialize(commandService);

            #endregion Common Finds and Edits

            #region Common Entity

            CommonEntityMetadataExplorerCommand.Initialize(commandService);
            CommonEntityAttributeExplorerCommand.Initialize(commandService);
            CommonEntityKeyExplorerCommand.Initialize(commandService);
            CommonEntityRelationshipOneToManyExplorerCommand.Initialize(commandService);
            CommonEntityRelationshipManyToManyExplorerCommand.Initialize(commandService);
            CommonEntityPrivilegesExplorerCommand.Initialize(commandService);

            #endregion Common Entity

            #region Common Entity Objects

            CommonSystemFormExplorerCommand.Initialize(commandService);
            CommonSystemSavedQueryVisualizationExplorerCommand.Initialize(commandService);
            CommonSystemSavedQueryExplorerCommand.Initialize(commandService);

            #endregion Common Entity Objects

            #region Explorers

            CommonGlobalOptionSetsExplorerCommand.Initialize(commandService);
            CommonOrganizationExplorerCommand.Initialize(commandService);
            CommonCustomControlExplorerCommand.Initialize(commandService);
            CommonApplicationRibbonExplorerCommand.Initialize(commandService);
            CommonSiteMapExplorerCommand.Initialize(commandService);
            CommonReportExplorerCommand.Initialize(commandService);
            CommonWebResourceExplorerCommand.Initialize(commandService);
            CommonWorkflowExplorerCommand.Initialize(commandService);

            CommonExportFormEventsCommand.Initialize(commandService);

            #endregion Explorers

            #region Security

            CommonSystemUsersExplorerCommand.Initialize(commandService);
            CommonTeamsExplorerCommand.Initialize(commandService);
            CommonSecurityRolesExplorerCommand.Initialize(commandService);

            #endregion Security

            #region Solutions

            CommonSolutionExplorerCommand.Initialize(commandService);
            CommonSolutionExplorerInConnectionCommand.Initialize(commandService);
            CommonImportJobExplorerInConnectionCommand.Initialize(commandService);

            CommonOpenSolutionImageCommand.Initialize(commandService);
            CommonOpenSolutionDifferenceImageCommand.Initialize(commandService);

            CommonOpenDefaultSolutionInWebCommand.Initialize(commandService);
            CommonExportOpenLastSelectedSolutionCommand.Initialize(commandService);

            #endregion Solutions

            #region PluginInfo

            CommonPluginAssemblyExplorerCommand.Initialize(commandService);
            CommonPluginTypeExplorerCommand.Initialize(commandService);

            CommonPluginTreeCommand.Initialize(commandService);
            CommonSdkMessageTreeCommand.Initialize(commandService);
            CommonSdkMessageRequestTreeCommand.Initialize(commandService);

            #endregion PluginInfo

            #region PluginConfiguration

            CommonPluginConfigurationComparerPluginAssemblyCommand.Initialize(commandService);
            CommonPluginConfigurationCreateCommand.Initialize(commandService);
            CommonPluginConfigurationPluginAssemblyCommand.Initialize(commandService);
            CommonPluginConfigurationPluginTreeCommand.Initialize(commandService);
            CommonPluginConfigurationPluginTypeCommand.Initialize(commandService);

            #endregion PluginConfiguration

            #region Trace

            CommonTraceExportFileCommand.Initialize(commandService);
            CommonTraceReaderCommand.Initialize(commandService);

            #endregion Trace

            #region OrganizationComparer

            CommonOrganizationComparerCommand.Initialize(commandService);

            CommonOpenOrganizationDifferenceImageCommand.Initialize(commandService);

            #endregion OrganizationComparer

            #region Config

            CommonOpenConfigFolderCommand.Initialize(commandService);

            CommonConfigCommand.Initialize(commandService);

            #endregion Config

            CommonOpenCrmWebSiteCommand.Initialize(commandService);

            CommonExportDefaultSitemapsCommand.Initialize(commandService);
            CommonExportXsdSchemasCommand.Initialize(commandService);

            CommonOpenXsdSchemaFolderCommand.Initialize(commandService);

            #region Output Windows

            OutputSelectCrmConnectionCommand.Initialize(commandService);
            OutputTestCrmConnectionCommand.Initialize(commandService);
            OutputEditCrmConnectionCommand.Initialize(commandService);
            OutputSelectFileCrmConnectionCommand.Initialize(commandService);

            OutputOpenCrmWebSiteCommand.Initialize(commandService);
            OutputExportOpenLastSelectedSolutionCommand.Initialize(commandService);
            OutputOpenDefaultSolutionInWebCommand.Initialize(commandService);

            OutputOpenOrganizationDifferenceImageCommand.Initialize(commandService);
            OutputOpenSolutionDifferenceImageCommand.Initialize(commandService);
            OutputOpenSolutionImageCommand.Initialize(commandService);

            OutputOrganizationComparerCommand.Initialize(commandService);

            OutputExportFormEventsCommand.Initialize(commandService);

            #region Finds and Edits

            OutputFindEntityObjectsByPrefixCommand.Initialize(commandService);
            OutputFindEntityObjectsByPrefixInExplorerCommand.Initialize(commandService);

            OutputFindEntityObjectsByPrefixAndShowDependentComponentsCommand.Initialize(commandService);

            OutputFindEntityObjectsMarkedToDeleteInExplorerCommand.Initialize(commandService);
            OutputFindEntityObjectsMarkedToDeleteAndShowDependentComponentsCommand.Initialize(commandService);

            OutputFindEntityObjectsByNameCommand.Initialize(commandService);
            OutputFindEntityObjectsByNameInExplorerCommand.Initialize(commandService);

            OutputFindEntityObjectsContainsStringCommand.Initialize(commandService);
            OutputFindEntityObjectsContainsStringInExplorerCommand.Initialize(commandService);

            OutputFindEntitiesByIdCommand.Initialize(commandService);
            OutputFindEntitiesByUniqueidentifierCommand.Initialize(commandService);

            OutputEditEntitiesByIdCommand.Initialize(commandService);

            #endregion Finds and Edits

            #region PluginConfiguration

            OutputPluginConfigurationComparerPluginAssemblyCommand.Initialize(commandService);
            OutputPluginConfigurationCreateCommand.Initialize(commandService);
            OutputPluginConfigurationPluginAssemblyCommand.Initialize(commandService);
            OutputPluginConfigurationPluginTreeCommand.Initialize(commandService);
            OutputPluginConfigurationPluginTypeCommand.Initialize(commandService);

            #endregion PluginConfiguration

            OutputApplicationRibbonExplorerCommand.Initialize(commandService);
            OutputCheckComponentTypeEnumCommand.Initialize(commandService);
            OutputCheckCreateAllDependencyNodeDescriptionCommand.Initialize(commandService);
            OutputCheckEntitiesOwnerShipsCommand.Initialize(commandService);
            OutputCheckGlobalOptionSetDuplicateCommand.Initialize(commandService);
            OutputCheckManagedElementsCommand.Initialize(commandService);
            OutputCheckPluginImagesCommand.Initialize(commandService);
            OutputCheckPluginImagesRequiredComponentsCommand.Initialize(commandService);
            OutputCheckPluginStepsCommand.Initialize(commandService);
            OutputCheckPluginStepsRequiredComponentsCommand.Initialize(commandService);
            OutputCheckWorkflowsUsedEntitiesCommand.Initialize(commandService);
            OutputCheckWorkflowsUsedNotExistsEntitiesCommand.Initialize(commandService);
            OutputCustomControlExplorerCommand.Initialize(commandService);
            OutputEntityAttributeExplorerCommand.Initialize(commandService);
            OutputEntityKeyExplorerCommand.Initialize(commandService);
            OutputEntityMetadataExplorerCommand.Initialize(commandService);
            OutputEntityPrivilegesExplorerCommand.Initialize(commandService);
            OutputEntityRelationshipManyToManyExplorerCommand.Initialize(commandService);
            OutputEntityRelationshipOneToManyExplorerCommand.Initialize(commandService);

            OutputGlobalOptionSetsExplorerCommand.Initialize(commandService);
            OutputImportJobExplorerInConnectionCommand.Initialize(commandService);
            OutputOrganizationExplorerCommand.Initialize(commandService);
            OutputPluginAssemblyExplorerCommand.Initialize(commandService);
            OutputPluginTreeCommand.Initialize(commandService);
            OutputPluginTypeExplorerCommand.Initialize(commandService);
            OutputReportExplorerCommand.Initialize(commandService);
            OutputSdkMessageRequestTreeCommand.Initialize(commandService);
            OutputSdkMessageTreeCommand.Initialize(commandService);
            OutputSecurityRolesExplorerCommand.Initialize(commandService);
            OutputSiteMapExplorerCommand.Initialize(commandService);
            OutputSolutionExplorerCommand.Initialize(commandService);
            OutputSystemFormExplorerCommand.Initialize(commandService);
            OutputSystemSavedQueryExplorerCommand.Initialize(commandService);
            OutputSystemSavedQueryVisualizationExplorerCommand.Initialize(commandService);
            OutputSystemUsersExplorerCommand.Initialize(commandService);
            OutputTeamsExplorerCommand.Initialize(commandService);
            OutputTraceExportFileCommand.Initialize(commandService);
            OutputTraceReaderCommand.Initialize(commandService);
            OutputWebResourceExplorerCommand.Initialize(commandService);
            OutputWorkflowExplorerCommand.Initialize(commandService);

            OutputPublishAllInCrmConnectionCommand.Initialize(commandService);


            //Output.Initialize(commandService);
            //Output.Initialize(commandService);
            //Output.Initialize(commandService);
            //Output.Initialize(commandService);
            //Output.Initialize(commandService);
            //Output.Initialize(commandService);
            //Output.Initialize(commandService);
            //Output.Initialize(commandService);
            //Output.Initialize(commandService);

            #endregion Output Windows



            //Folder.Initialize(commandService);
            //Folder.Initialize(commandService);
            //Folder.Initialize(commandService);
            //Folder.Initialize(commandService);
            //Folder.Initialize(commandService);

            this.ApplicationObject = await this.GetServiceAsync(typeof(EnvDTE.DTE)) as EnvDTE80.DTE2;

            Singleton = this;

            System.Threading.Tasks.Task.Run(() => CommonConfiguration.Get());
            System.Threading.Tasks.Task.Run(() => ConnectionConfiguration.Get());

            //Repository.ConnectionIntellisenseDataRepository.LoadIntellisenseCache();
        }
        protected override IList <ConnectionData> GetElementSourceCollection()
        {
            var connectionConfig = ConnectionConfiguration.Get();

            return(connectionConfig.GetConnectionsWithoutCurrent());
        }
        public void AugmentCompletionSession(ICompletionSession session, IList <CompletionSet> completionSets)
        {
            if (_isDisposed)
            {
                return;
            }

            var connectionConfig = ConnectionConfiguration.Get();

            if (connectionConfig?.CurrentConnectionData == null)
            {
                return;
            }

            ITextSnapshot snapshot     = _buffer.CurrentSnapshot;
            var           triggerPoint = session.GetTriggerPoint(snapshot);

            if (triggerPoint == null)
            {
                return;
            }

            XElement doc = ReadXmlDocument(snapshot.GetText());

            if (doc == null)
            {
                return;
            }

            if (string.Equals(doc.Name.ToString(), Commands.AbstractDynamicCommandXsdSchemas.RootFetch, StringComparison.InvariantCultureIgnoreCase))
            {
                var repository = ConnectionIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);

                FillSessionForFetchXml(session, completionSets, snapshot, doc, connectionConfig.CurrentConnectionData, repository);
            }
            else if (string.Equals(doc.Name.ToString(), Commands.AbstractDynamicCommandXsdSchemas.RootGrid, StringComparison.InvariantCultureIgnoreCase))
            {
                var repository = ConnectionIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);

                FillSessionForGridXml(session, completionSets, snapshot, doc, connectionConfig.CurrentConnectionData, repository);
            }
            else if (string.Equals(doc.Name.ToString(), Commands.AbstractDynamicCommandXsdSchemas.RootSavedQuery, StringComparison.InvariantCultureIgnoreCase))
            {
                var repository = ConnectionIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);

                FillSessionForFetchXml(session, completionSets, snapshot, doc, connectionConfig.CurrentConnectionData, repository);

                FillSessionForGridXml(session, completionSets, snapshot, doc, connectionConfig.CurrentConnectionData, repository);
            }
            else if (string.Equals(doc.Name.ToString(), Commands.AbstractDynamicCommandXsdSchemas.RootSiteMap, StringComparison.InvariantCultureIgnoreCase))
            {
                var repositoryEntities    = ConnectionIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);
                var repositorySiteMap     = SiteMapIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);
                var repositoryWebResource = WebResourceIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);

                FillSessionForSiteMap(triggerPoint.Value, session, completionSets, snapshot, doc, connectionConfig.CurrentConnectionData, repositoryEntities, repositorySiteMap, repositoryWebResource);
            }
            else if (string.Equals(doc.Name.ToString(), Commands.AbstractDynamicCommandXsdSchemas.RootRibbonDiffXml, StringComparison.InvariantCultureIgnoreCase) ||
                     string.Equals(doc.Name.ToString(), Commands.AbstractDynamicCommandXsdSchemas.RootRibbonDefinitions, StringComparison.InvariantCultureIgnoreCase)
                     )
            {
                var repositoryEntities    = ConnectionIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);
                var repositoryWebResource = WebResourceIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);

                var repositoryRibbon = RibbonIntellisenseDataRepository.GetRepository(connectionConfig.CurrentConnectionData);

                FillSessionForRibbonDiffXml(triggerPoint.Value, session, completionSets, snapshot, doc, connectionConfig.CurrentConnectionData, repositoryEntities, repositoryWebResource, repositoryRibbon);
            }
        }