Exemplo n.º 1
0
        private async Task PerformShowingDifference(string folder, LinkedEntities <PluginAssembly> linked)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.OutputStrings.ShowingDifferencePluginAssemblyDescriptionFormat1, linked.Entity1.Name);

            DateTime now = DateTime.Now;

            string desc1 = await _handler1.CreateDescriptionAsync(linked.Entity1);

            string desc2 = await _handler2.CreateDescriptionAsync(linked.Entity2);

            {
                string filePath1 = await CreateDescriptionFileAsync(folder, _pluginDescription1.FilePath, linked.Entity1.Name, desc1);

                string filePath2 = await CreateDescriptionFileAsync(folder, _pluginDescription2.FilePath, linked.Entity2.Name, desc2);

                if (File.Exists(filePath1) && File.Exists(filePath2))
                {
                    await this._iWriteToOutput.ProcessStartProgramComparerAsync(null, filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2));
                }
                else
                {
                    this._iWriteToOutput.PerformAction(null, filePath1);

                    this._iWriteToOutput.PerformAction(null, filePath2);
                }
            }

            ToggleControls(true, Properties.OutputStrings.ShowingDifferencePluginAssemblyDescriptionCompletedFormat1, linked.Entity1.Name);
        }
        private void ShowExistingAssemblies()
        {
            this._itemsSource.Clear();

            ToggleControls(false, Properties.WindowStatusStrings.LoadingPluginAssemblies);

            if (this._pluginDescription1 != null && this._pluginDescription2 != null)
            {
                if (this._allEntities == null)
                {
                    List <LinkedEntities <PluginAssembly> > list = new List <LinkedEntities <PluginAssembly> >();

                    var list1 = this._pluginDescription1.PluginAssemblies;
                    var list2 = this._pluginDescription2.PluginAssemblies;

                    foreach (var assembly1 in list1)
                    {
                        var assembly2 = list2.FirstOrDefault(a => a.Name == assembly1.Name);

                        if (assembly2 == null)
                        {
                            continue;
                        }

                        var item = new LinkedEntities <PluginAssembly>(assembly1, assembly2);

                        list.Add(item);
                    }

                    this._allEntities = list;
                }
            }

            var filter = this._allEntities.AsEnumerable();

            string textName = string.Empty;

            txtBFilter.Dispatcher.Invoke(() =>
            {
                textName = txtBFilter.Text.Trim().ToLower();
            });

            if (!string.IsNullOrEmpty(textName))
            {
                filter = filter.Where(ent =>
                                      ent.Entity1.Name.IndexOf(textName, StringComparison.InvariantCultureIgnoreCase) > -1 ||
                                      ent.Entity2.Name.IndexOf(textName, StringComparison.InvariantCultureIgnoreCase) > -1
                                      );
            }

            this.lstVwPluginAssemblies.Dispatcher.Invoke(() =>
            {
                foreach (var assembly in filter)
                {
                    _itemsSource.Add(new EntityViewItem(assembly.Entity1.Name, assembly));
                }
            });

            ToggleControls(true, Properties.WindowStatusStrings.LoadingPluginAssembliesCompletedFormat1, filter.Count());
        }
Exemplo n.º 3
0
 public void AddLinkedEntity(Entity entity)
 {
     if (entity.Logic is BotEntityLogic && !LinkedEntities.Contains(entity))
     {
         LinkedEntities.Add(entity);
     }
 }
 public EntityViewItem(string entityName, string chartName1, string chartName2, LinkedEntities <SavedQueryVisualization> link)
 {
     this.EntityName = entityName;
     this.ChartName1 = chartName1;
     this.ChartName2 = chartName2;
     this.Link       = link;
 }
Exemplo n.º 5
0
        private void ExecuteActionOnLinkedEntities(LinkedEntities <PluginAssembly> linked, bool showAllways, Func <LinkedEntities <PluginAssembly>, bool, Task> action)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            if (linked.Entity1 == null || linked.Entity2 == null || linked.Entity1 == linked.Entity2)
            {
                return;
            }

            if (string.IsNullOrEmpty(_commonConfig.FolderForExport))
            {
                _iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.FolderForExportIsEmpty);
                _commonConfig.FolderForExport = FileOperations.GetDefaultFolderForExportFilePath();
            }
            else if (!Directory.Exists(_commonConfig.FolderForExport))
            {
                _iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.FolderForExportDoesNotExistsFormat1, _commonConfig.FolderForExport);
                _commonConfig.FolderForExport = FileOperations.GetDefaultFolderForExportFilePath();
            }

            action(linked, showAllways);
        }
        private async Task PerformShowingDifferenceAllAsync(LinkedEntities <SavedQueryVisualization> linked, bool showAllways)
        {
            await PerformShowingDifferenceDescriptionAsync(linked, showAllways);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, SavedQueryVisualization.Schema.Attributes.datadescription, SavedQueryVisualization.Schema.Headers.datadescription);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, SavedQueryVisualization.Schema.Attributes.presentationdescription, SavedQueryVisualization.Schema.Headers.presentationdescription);
        }
 public EntityViewItem(string webresourceName, string typeName, string displayName1, string displayName2, LinkedEntities <WebResource> link)
 {
     this.TypeName        = typeName;
     this.WebResourceName = webresourceName;
     this.DisplayName1    = displayName1;
     this.DisplayName2    = displayName2;
     this.Link            = link;
 }
Exemplo n.º 8
0
        private async Task PerformShowingDifferenceEntityDescriptionAsync(LinkedEntities <PluginAssembly> linked, bool showAllways)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.WindowStatusStrings.ShowingDifferenceEntityDescription);

            try
            {
                var service1 = await GetService1();

                var service2 = await GetService2();

                if (service1 != null && service2 != null)
                {
                    var repository1 = new PluginAssemblyRepository(service1);
                    var repository2 = new PluginAssemblyRepository(service2);

                    var assembly1 = await repository1.GetAssemblyByIdRetrieveRequestAsync(linked.Entity1.Id, new ColumnSet(true));

                    var assembly2 = await repository2.GetAssemblyByIdRetrieveRequestAsync(linked.Entity2.Id, new ColumnSet(true));

                    var desc1 = await EntityDescriptionHandler.GetEntityDescriptionAsync(assembly1, EntityFileNameFormatter.PluginAssemblyIgnoreFields);

                    var desc2 = await EntityDescriptionHandler.GetEntityDescriptionAsync(assembly2, EntityFileNameFormatter.PluginAssemblyIgnoreFields);

                    if (showAllways || desc1 != desc2)
                    {
                        string filePath1 = await CreateDescriptionFileAsync(service1.ConnectionData, assembly1.Name, EntityFileNameFormatter.Headers.EntityDescription, desc1);

                        string filePath2 = await CreateDescriptionFileAsync(service2.ConnectionData, assembly2.Name, EntityFileNameFormatter.Headers.EntityDescription, desc2);

                        if (File.Exists(filePath1) && File.Exists(filePath2))
                        {
                            this._iWriteToOutput.ProcessStartProgramComparer(filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2));
                        }
                        else
                        {
                            this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                            this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                        }
                    }
                }

                ToggleControls(true, Properties.WindowStatusStrings.ShowingDifferenceEntityDescriptionCompleted);
            }
            catch (Exception ex)
            {
                _iWriteToOutput.WriteErrorToOutput(null, ex);

                ToggleControls(true, Properties.WindowStatusStrings.ShowingDifferenceEntityDescriptionFailed);
            }
        }
        private async Task PerformShowingDifferenceDescriptionAsync(LinkedEntities <SavedQueryVisualization> linked, bool showAllways)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.OutputStrings.ShowingDifferenceEntityDescription);

            try
            {
                var service1 = await GetService1();

                var service2 = await GetService2();

                if (service1 != null && service2 != null)
                {
                    var repository1 = new SavedQueryVisualizationRepository(service1);
                    var repository2 = new SavedQueryVisualizationRepository(service2);

                    var chart1 = await repository1.GetByIdAsync(linked.Entity1.Id, ColumnSetInstances.AllColumns);

                    var chart2 = await repository2.GetByIdAsync(linked.Entity2.Id, ColumnSetInstances.AllColumns);

                    var desc1 = await EntityDescriptionHandler.GetEntityDescriptionAsync(chart1);

                    var desc2 = await EntityDescriptionHandler.GetEntityDescriptionAsync(chart2);

                    if (showAllways || desc1 != desc2)
                    {
                        string filePath1 = await CreateDescriptionFileAsync(service1.ConnectionData, chart1.PrimaryEntityTypeCode, chart1.Name, EntityFileNameFormatter.Headers.EntityDescription, desc1);

                        string filePath2 = await CreateDescriptionFileAsync(service2.ConnectionData, chart2.PrimaryEntityTypeCode, chart2.Name, EntityFileNameFormatter.Headers.EntityDescription, desc2);

                        if (File.Exists(filePath1) && File.Exists(filePath2))
                        {
                            await this._iWriteToOutput.ProcessStartProgramComparerAsync(service1.ConnectionData, filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2), service2.ConnectionData);
                        }
                        else
                        {
                            this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                            this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                        }
                    }
                }

                ToggleControls(true, Properties.OutputStrings.ShowingDifferenceEntityDescriptionCompleted);
            }
            catch (Exception ex)
            {
                _iWriteToOutput.WriteErrorToOutput(null, ex);

                ToggleControls(true, Properties.OutputStrings.ShowingDifferenceEntityDescriptionFailed);
            }
        }
            public EntityViewItem(string sitemapName, string siteMapNameUnique, Guid?id1, Guid?id2, LinkedEntities <SiteMap> link)
            {
                this.SiteMapName       = sitemapName;
                this.SiteMapNameUnique = siteMapNameUnique;

                this.SiteMap1Id = id1;
                this.SiteMap2Id = id2;

                this.Link = link;
            }
        private async Task PerformShowingDifferenceSingleXmlAsync(LinkedEntities <SiteMap> linked, bool showAllways, string fieldName, string fieldTitle)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.WindowStatusStrings.ShowingDifferenceXmlForFieldFormat1, fieldName);

            try
            {
                var service1 = await GetService1();

                var service2 = await GetService2();

                if (service1 != null && service2 != null)
                {
                    var repository1 = new SitemapRepository(service1);
                    var repository2 = new SitemapRepository(service2);

                    var sitemap1 = await repository1.GetByIdAsync(linked.Entity1.Id, new ColumnSet(true));

                    var sitemap2 = await repository2.GetByIdAsync(linked.Entity2.Id, new ColumnSet(true));

                    string xml1 = sitemap1.GetAttributeValue <string>(fieldName);
                    string xml2 = sitemap2.GetAttributeValue <string>(fieldName);

                    if (showAllways || !ContentCoparerHelper.CompareXML(xml1, xml2).IsEqual)
                    {
                        string filePath1 = await CreateFileAsync(service1.ConnectionData, sitemap1.SiteMapName, sitemap1.SiteMapNameUnique, sitemap1.Id, fieldTitle, xml1);

                        string filePath2 = await CreateFileAsync(service2.ConnectionData, sitemap2.SiteMapName, sitemap2.SiteMapNameUnique, sitemap2.Id, fieldTitle, xml2);

                        if (File.Exists(filePath1) && File.Exists(filePath2))
                        {
                            this._iWriteToOutput.ProcessStartProgramComparer(filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2));
                        }
                        else
                        {
                            this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                            this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                        }
                    }
                }

                ToggleControls(true, Properties.WindowStatusStrings.ShowingDifferenceXmlForFieldCompletedFormat1, fieldName);
            }
            catch (Exception ex)
            {
                _iWriteToOutput.WriteErrorToOutput(null, ex);

                ToggleControls(true, Properties.WindowStatusStrings.ShowingDifferenceXmlForFieldFailedFormat1, fieldName);
            }
        }
Exemplo n.º 12
0
        private async Task ExecuteAction(LinkedEntities <PluginAssembly> link, Func <string, LinkedEntities <PluginAssembly>, Task> action)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            string folder = txtBFolder.Text.Trim();

            folder = CorrectFolderIfEmptyOrNotExists(_iWriteToOutput, folder);

            await action(folder, link);
        }
        private void ExecuteActionLinked(LinkedEntities <Report> linked, bool showAllways, string fieldName, string fieldTitle, Func <LinkedEntities <Report>, bool, string, string, Task> action)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            if (linked.Entity1 == null || linked.Entity2 == null || linked.Entity1 == linked.Entity2)
            {
                return;
            }

            _commonConfig.CheckFolderForExportExists(_iWriteToOutput);

            action(linked, showAllways, fieldName, fieldTitle);
        }
        private void ExecuteAction(LinkedEntities <SavedQueryVisualization> linked, bool showAllways, Func <LinkedEntities <SavedQueryVisualization>, bool, Task> action)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            if (linked.Entity1 == null || linked.Entity2 == null || linked.Entity1 == linked.Entity2)
            {
                return;
            }

            _commonConfig.CheckFolderForExportExists(_iWriteToOutput);

            action(linked, showAllways);
        }
        private async Task PerformShowingDifferenceAllAsync(LinkedEntities <Report> linked, bool showAllways)
        {
            await PerformShowingDifferenceDescriptionAsync(linked, showAllways);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, Report.Schema.Attributes.bodytext, Report.Schema.Headers.bodytext);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, Report.Schema.Attributes.originalbodytext, Report.Schema.Headers.originalbodytext);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, Report.Schema.Attributes.defaultfilter, Report.Schema.Headers.defaultfilter);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, Report.Schema.Attributes.customreportxml, Report.Schema.Headers.customreportxml);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, Report.Schema.Attributes.schedulexml, Report.Schema.Headers.schedulexml);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, Report.Schema.Attributes.queryinfo, Report.Schema.Headers.queryinfo);
        }
        private async Task PerformShowingDifferenceDescriptionAsync(LinkedEntities <WebResource> linked, bool showAllways)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.OutputStrings.ShowingDifferenceEntityDescription);

            var service1 = await GetService1();

            var service2 = await GetService2();

            if (service1 != null && service2 != null)
            {
                var repository1 = new WebResourceRepository(service1);
                var repository2 = new WebResourceRepository(service2);

                var webResource1 = await repository1.GetByIdAsync(linked.Entity1.Id, ColumnSetInstances.AllColumns);

                var webResource2 = await repository2.GetByIdAsync(linked.Entity2.Id, ColumnSetInstances.AllColumns);

                var desc1 = await EntityDescriptionHandler.GetEntityDescriptionAsync(webResource1);

                var desc2 = await EntityDescriptionHandler.GetEntityDescriptionAsync(webResource2);

                if (showAllways || desc1 != desc2)
                {
                    string filePath1 = await CreateDescriptionFileAsync(service1.ConnectionData, webResource1.Name, EntityFileNameFormatter.Headers.EntityDescription, desc1);

                    string filePath2 = await CreateDescriptionFileAsync(service2.ConnectionData, webResource2.Name, EntityFileNameFormatter.Headers.EntityDescription, desc2);

                    if (File.Exists(filePath1) && File.Exists(filePath2))
                    {
                        await this._iWriteToOutput.ProcessStartProgramComparerAsync(service1.ConnectionData, filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2), service2.ConnectionData);
                    }
                    else
                    {
                        this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                        this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                    }
                }
            }

            ToggleControls(true, Properties.OutputStrings.ShowingDifferenceEntityDescriptionCompleted);
        }
        private void ExecuteActionLinked(
            LinkedEntities <SavedQueryVisualization> linked
            , bool showAllways
            , string fieldName
            , string fieldTitle
            , Func <LinkedEntities <SavedQueryVisualization>, bool, string, string, Task> action
            )
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            _commonConfig.CheckFolderForExportExists(_iWriteToOutput);

            action(linked, showAllways, fieldName, fieldTitle);
        }
Exemplo n.º 18
0
        private async Task PerformShowingDifferenceAssemblyDescriptionAsync(LinkedEntities <PluginAssembly> linked, bool showAllways)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.WindowStatusStrings.ShowingDifferencePluginAssemblyDescriptionFormat1, linked.Entity1.Name);

            var service1 = await GetService1();

            var service2 = await GetService2();

            if (service1 != null && service2 != null)
            {
                var handler1 = new PluginAssemblyDescriptionHandler(service1, service1.ConnectionData.GetConnectionInfo());
                var handler2 = new PluginAssemblyDescriptionHandler(service2, service2.ConnectionData.GetConnectionInfo());

                DateTime now = DateTime.Now;

                string desc1 = await handler1.CreateDescriptionAsync(linked.Entity1.Id, linked.Entity1.Name, now);

                string desc2 = await handler2.CreateDescriptionAsync(linked.Entity2.Id, linked.Entity2.Name, now);

                if (showAllways || desc1 != desc2)
                {
                    string filePath1 = await CreateDescriptionFileAsync(service1.ConnectionData, linked.Entity1.Name, "Description", desc1);

                    string filePath2 = await CreateDescriptionFileAsync(service2.ConnectionData, linked.Entity2.Name, "Description", desc2);

                    if (File.Exists(filePath1) && File.Exists(filePath2))
                    {
                        this._iWriteToOutput.ProcessStartProgramComparer(filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2));
                    }
                    else
                    {
                        this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                        this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                    }
                }
            }

            ToggleControls(true, Properties.WindowStatusStrings.ShowingDifferencePluginAssemblyDescriptionCompletedFormat1, linked.Entity1.Name);
        }
        private void ExecuteActionLinked(
            LinkedEntities <WebResource> linked
            , bool showAllways
            , string fieldName
            , string fieldTitle
            , FileExtension extension
            , Func <LinkedEntities <WebResource>, bool, string, string, FileExtension, Task> action
            )
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            _commonConfig.CheckFolderForExportExists(_iWriteToOutput);

            action(linked, showAllways, fieldName, fieldTitle, extension);
        }
        private async Task PerformShowingDifferenceContentAsync(LinkedEntities <WebResource> linked, bool showAllways)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.OutputStrings.ShowingDifferenceWebResourcesFormat1, linked.Entity1.Name);

            var service1 = await GetService1();

            var service2 = await GetService2();

            if (service1 != null && service2 != null)
            {
                var repository1 = new WebResourceRepository(service1);
                var repository2 = new WebResourceRepository(service2);

                var webResource1 = await repository1.GetByIdAsync(linked.Entity1.Id, ColumnSetInstances.AllColumns);

                var webResource2 = await repository2.GetByIdAsync(linked.Entity2.Id, ColumnSetInstances.AllColumns);

                if (showAllways || webResource1.Content != webResource2.Content)
                {
                    string filePath1 = await CreateFileWithContentAsync(service1.ConnectionData.Name, webResource1);

                    string filePath2 = await CreateFileWithContentAsync(service2.ConnectionData.Name, webResource2);

                    if (File.Exists(filePath1) && File.Exists(filePath2))
                    {
                        await this._iWriteToOutput.ProcessStartProgramComparerAsync(service1.ConnectionData, filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2), service2.ConnectionData);
                    }
                    else
                    {
                        this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                        this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                    }
                }
            }

            ToggleControls(true, Properties.OutputStrings.ShowingDifferenceWebResourcesCompletedFormat1, linked.Entity1.Name);
        }
        private async Task ExecuteAction(LinkedEntities <PluginAssembly> link, Func <string, LinkedEntities <PluginAssembly>, Task> action)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            string folder = txtBFolder.Text.Trim();

            if (string.IsNullOrEmpty(folder))
            {
                _iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.FolderForExportIsEmpty);
                folder = FileOperations.GetDefaultFolderForExportFilePath();
            }
            else if (!Directory.Exists(folder))
            {
                _iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.FolderForExportDoesNotExistsFormat1, folder);
                folder = FileOperations.GetDefaultFolderForExportFilePath();
            }

            await action(folder, link);
        }
Exemplo n.º 22
0
 public EntityViewItem(string assemblyName, LinkedEntities <PluginAssembly> link)
 {
     this.AssemblyName = assemblyName;
     this.Link         = link;
 }
        private async Task PerformShowingDifferenceAllAsync(LinkedEntities <WebResource> linked, bool showAllways)
        {
            await PerformShowingDifferenceContentAsync(linked, showAllways);

            await PerformShowingDifferenceDescriptionAsync(linked, showAllways);
        }
        private async Task PerformShowingDifferenceSingleXmlAsync(LinkedEntities <SavedQueryVisualization> linked, bool showAllways, string fieldName, string fieldTitle)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.OutputStrings.ShowingDifferenceXmlForFieldFormat1, fieldName);

            try
            {
                var service1 = await GetService1();

                var service2 = await GetService2();

                if (service1 != null && service2 != null)
                {
                    var repository1 = new SavedQueryVisualizationRepository(service1);
                    var repository2 = new SavedQueryVisualizationRepository(service2);

                    var chart1 = await repository1.GetByIdAsync(linked.Entity1.Id, ColumnSetInstances.AllColumns);

                    var chart2 = await repository2.GetByIdAsync(linked.Entity2.Id, ColumnSetInstances.AllColumns);

                    string xml1 = chart1.GetAttributeValue <string>(fieldName);
                    string xml2 = chart2.GetAttributeValue <string>(fieldName);

                    if (showAllways || !ContentComparerHelper.CompareXML(xml1, xml2).IsEqual)
                    {
                        string filePath1 = await CreateFileAsync(service1.ConnectionData, chart1.PrimaryEntityTypeCode, chart1.Name, fieldTitle, xml1);

                        string filePath2 = await CreateFileAsync(service2.ConnectionData, chart2.PrimaryEntityTypeCode, chart2.Name, fieldTitle, xml2);

                        if (!File.Exists(filePath1))
                        {
                            this._iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.InConnectionEntityFieldIsEmptyFormat4, service1.ConnectionData.Name, SavedQueryVisualization.Schema.EntityLogicalName, chart1.Name, fieldTitle);
                            this._iWriteToOutput.ActivateOutputWindow(null);
                        }

                        if (!File.Exists(filePath2))
                        {
                            this._iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.InConnectionEntityFieldIsEmptyFormat4, service2.ConnectionData.Name, SavedQueryVisualization.Schema.EntityLogicalName, chart2.Name, fieldTitle);
                            this._iWriteToOutput.ActivateOutputWindow(null);
                        }

                        if (File.Exists(filePath1) && File.Exists(filePath2))
                        {
                            await this._iWriteToOutput.ProcessStartProgramComparerAsync(service1.ConnectionData, filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2), service2.ConnectionData);
                        }
                        else
                        {
                            this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                            this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                        }
                    }
                }

                ToggleControls(true, Properties.OutputStrings.ShowingDifferenceXmlForFieldCompletedFormat1, fieldName);
            }
            catch (Exception ex)
            {
                _iWriteToOutput.WriteErrorToOutput(null, ex);

                ToggleControls(true, Properties.OutputStrings.ShowingDifferenceXmlForFieldFailedFormat1, fieldName);
            }
        }
Exemplo n.º 25
0
        private async Task PerformShowingDifferenceAllAsync(LinkedEntities <PluginAssembly> linked, bool showAllways)
        {
            await PerformShowingDifferenceAssemblyDescriptionAsync(linked, showAllways);

            //await PerformShowingDifferenceEntityDescriptionAsync(linked, showAllways);
        }
        private async Task PerformShowingDifferenceSingleXmlAsync(LinkedEntities <WebResource> linked, bool showAllways, string fieldName, string fieldTitle, FileExtension extension)
        {
            if (!this.IsControlsEnabled)
            {
                return;
            }

            ToggleControls(false, Properties.OutputStrings.ShowingDifferenceXmlForFieldFormat1, fieldName);

            try
            {
                var service1 = await GetService1();

                var service2 = await GetService2();

                if (service1 != null && service2 != null)
                {
                    var repository1 = new WebResourceRepository(service1);
                    var repository2 = new WebResourceRepository(service2);

                    var webResource1 = await repository1.GetByIdAsync(linked.Entity1.Id, ColumnSetInstances.AllColumns);

                    var webResource2 = await repository2.GetByIdAsync(linked.Entity2.Id, ColumnSetInstances.AllColumns);

                    string xml1 = webResource1.GetAttributeValue <string>(fieldName);
                    string xml2 = webResource2.GetAttributeValue <string>(fieldName);

                    if (showAllways || !ContentComparerHelper.CompareXML(xml1, xml2, false).IsEqual)
                    {
                        if (!string.IsNullOrEmpty(xml1))
                        {
                            if (string.Equals(fieldName, WebResource.Schema.Attributes.dependencyxml, StringComparison.InvariantCultureIgnoreCase))
                            {
                                xml1 = ContentComparerHelper.FormatXmlByConfiguration(
                                    xml1
                                    , _commonConfig
                                    , XmlOptionsControls.WebResourceDependencyXmlOptions
                                    , schemaName: AbstractDynamicCommandXsdSchemas.WebResourceDependencyXmlSchema
                                    , webResourceName: webResource1.Name
                                    );
                            }
                            else if (string.Equals(fieldName, WebResource.Schema.Attributes.contentjson, StringComparison.InvariantCultureIgnoreCase))
                            {
                                xml1 = ContentComparerHelper.FormatJson(xml1);
                            }
                        }

                        if (!string.IsNullOrEmpty(xml2))
                        {
                            if (string.Equals(fieldName, WebResource.Schema.Attributes.dependencyxml, StringComparison.InvariantCultureIgnoreCase))
                            {
                                xml2 = ContentComparerHelper.FormatXmlByConfiguration(
                                    xml2
                                    , _commonConfig
                                    , XmlOptionsControls.WebResourceDependencyXmlOptions
                                    , schemaName: AbstractDynamicCommandXsdSchemas.WebResourceDependencyXmlSchema
                                    , webResourceName: webResource2.Name
                                    );
                            }
                            else if (string.Equals(fieldName, WebResource.Schema.Attributes.contentjson, StringComparison.InvariantCultureIgnoreCase))
                            {
                                xml2 = ContentComparerHelper.FormatJson(xml2);
                            }
                        }

                        string filePath1 = await CreateFileAsync(service1.ConnectionData, webResource1.Name, fieldTitle, xml1, extension);

                        string filePath2 = await CreateFileAsync(service2.ConnectionData, webResource2.Name, fieldTitle, xml2, extension);

                        if (!File.Exists(filePath1))
                        {
                            this._iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.InConnectionEntityFieldIsEmptyFormat4, service1.ConnectionData.Name, Report.Schema.EntityLogicalName, webResource1.Name, fieldTitle);
                            this._iWriteToOutput.ActivateOutputWindow(null);
                        }

                        if (!File.Exists(filePath2))
                        {
                            this._iWriteToOutput.WriteToOutput(null, Properties.OutputStrings.InConnectionEntityFieldIsEmptyFormat4, service2.ConnectionData.Name, Report.Schema.EntityLogicalName, webResource2.Name, fieldTitle);
                            this._iWriteToOutput.ActivateOutputWindow(null);
                        }

                        if (File.Exists(filePath1) && File.Exists(filePath2))
                        {
                            await this._iWriteToOutput.ProcessStartProgramComparerAsync(service1.ConnectionData, filePath1, filePath2, Path.GetFileName(filePath1), Path.GetFileName(filePath2), service2.ConnectionData);
                        }
                        else
                        {
                            this._iWriteToOutput.PerformAction(service1.ConnectionData, filePath1);

                            this._iWriteToOutput.PerformAction(service2.ConnectionData, filePath2);
                        }
                    }
                }

                ToggleControls(true, Properties.OutputStrings.ShowingDifferenceXmlForFieldCompletedFormat1, fieldName);
            }
            catch (Exception ex)
            {
                _iWriteToOutput.WriteErrorToOutput(null, ex);

                ToggleControls(true, Properties.OutputStrings.ShowingDifferenceXmlForFieldFailedFormat1, fieldName);
            }
        }
        private async Task PerformShowingDifferenceAllAsync(LinkedEntities <SiteMap> linked, bool showAllways)
        {
            await PerformShowingDifferenceDescriptionAsync(linked, showAllways);

            await PerformShowingDifferenceSingleXmlAsync(linked, showAllways, SiteMap.Schema.Attributes.sitemapxml, SiteMap.Schema.Headers.sitemapxml);
        }
 private async Task PerformMouseDoubleClickAsync(LinkedEntities <SavedQueryVisualization> linked, bool showAllways)
 {
     await PerformShowingDifferenceDescriptionAsync(linked, true);
 }
Exemplo n.º 29
0
 public EntityViewItem(LinkedEntities <PluginAssembly> link)
 {
     this.Link = link;
 }
 public EntityViewItem(LinkedEntities <Report> link)
 {
     this.Link = link;
 }