From 6d48431191e88c14028877d3e2c28bffa6247104 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Sun, 12 Jun 2022 23:26:39 -0500 Subject: [PATCH] Added Microsoft.Iris.Debug.DataMappingModel --- UIX/Microsoft/Iris/Debug/DebugSettings.cs | 23 +++++++++++++++++-- .../Iris/Markup/CompiledMarkupLoader.cs | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/UIX/Microsoft/Iris/Debug/DebugSettings.cs b/UIX/Microsoft/Iris/Debug/DebugSettings.cs index 9efcb86..a15a717 100644 --- a/UIX/Microsoft/Iris/Debug/DebugSettings.cs +++ b/UIX/Microsoft/Iris/Debug/DebugSettings.cs @@ -1,5 +1,11 @@ using System.Collections.Generic; +#if NET40_OR_GREATER || NET6_0_OR_GREATER +using DataMappingModelsList = System.Collections.ObjectModel.ObservableCollection; +#else +using DataMappingModelsList = System.Collections.Generic.List; +#endif + namespace Microsoft.Iris.Debug { public class DebugSettings @@ -10,8 +16,7 @@ namespace Microsoft.Iris.Debug public TraceSettings TraceSettings { get; } = TraceSettings.Current; public bool GenerateDataMappingModels { get; set; } = true; - public List<(string Provider, string Type, string Code)> DataMappingModels { get; } - = new List<(string Provider, string Type, string Code)>(); + public DataMappingModelsList DataMappingModels { get; } = new DataMappingModelsList(); public Bridge Bridge { get; } = #if OPENZUNE @@ -20,4 +25,18 @@ namespace Microsoft.Iris.Debug new(); #endif } + + public class DataMappingModel + { + internal DataMappingModel(string provider, string type, string generatedCode) + { + Provider = provider; + Type = type; + GeneratedCode = generatedCode; + } + + public string Provider { get; internal set; } + public string Type { get; internal set; } + public string GeneratedCode { get; internal set; } + } } diff --git a/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs index 7973005..d721d16 100644 --- a/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs +++ b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs @@ -498,7 +498,7 @@ namespace Microsoft.Iris.Markup if (Application.DebugSettings.GenerateDataMappingModels) Application.DebugSettings.DataMappingModels.Add( - (markupDataMapping.Provider, markupDataMapping.TargetType.Name, markupDataMapping.GenerateModelCode()) + new Debug.DataMappingModel(markupDataMapping.Provider, markupDataMapping.TargetType.Name, markupDataMapping.GenerateModelCode()) ); } _loadResultTarget.SetDataMappingsTable(dataMappingsTable);