Skip to content

Commit 98295e9

Browse files
author
tznind
committed
Ensure ObservableCollection<> assembly and namespace are included in .Designer.cs fiiles
1 parent c62857e commit 98295e9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/FromCode/CodeToView.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections;
2+
using System.Collections.ObjectModel;
23
using System.ComponentModel;
34
using System.Reflection;
45
using System.Text.RegularExpressions;
@@ -160,6 +161,7 @@ public Assembly CompileAssembly()
160161
MetadataReference.CreateFromFile(typeof(System.Linq.Enumerable).Assembly.Location),
161162
MetadataReference.CreateFromFile(typeof(object).Assembly.Location),
162163
MetadataReference.CreateFromFile(typeof(MarshalByValueComponent).Assembly.Location),
164+
MetadataReference.CreateFromFile(typeof(ObservableCollection<string>).Assembly.Location),
163165

164166
// New assemblies required by Terminal.Gui version 2
165167
MetadataReference.CreateFromFile(typeof(Size).Assembly.Location),

src/ToCode/ViewToCode.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public void GenerateDesignerCs(Design rootDesign, Type viewType)
127127
ns.Imports.Add(new CodeNamespaceImport("Terminal.Gui"));
128128
ns.Imports.Add(new CodeNamespaceImport("System.Collections"));
129129
ns.Imports.Add(new CodeNamespaceImport("System.Collections.Generic"));
130+
ns.Imports.Add(new CodeNamespaceImport("System.Collections.ObjectModel"));
130131
ns.Imports.Add(new CodeNamespaceImport("System.Drawing"));
131132

132133
this.AddCustomHeaderForDesignerCsFile(ns);

0 commit comments

Comments
 (0)