Skip to content

Commit b122e02

Browse files
committed
Supported patterns should be copied over on cloning a WinControlIdentity
1 parent a7f84c8 commit b122e02

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Pixel.Automation.UIA.Components/WinControlIdentity.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class WinControlIdentity : ControlIdentity
6060

6161
[DataMember(Order = 310)]
6262
[Category("Supported Patterns")]
63-
public List<string> SupportedPatterns { get; set; }
63+
public List<string> SupportedPatterns { get; set; } = new();
6464

6565

6666
#region required during scraping
@@ -84,7 +84,7 @@ public int ProcessId
8484

8585
public WinControlIdentity() : base()
8686
{
87-
this.SupportedPatterns = new List<string>();
87+
8888
}
8989

9090

@@ -114,6 +114,7 @@ public override object Clone()
114114
Next = this.Next?.Clone() as WinControlIdentity
115115

116116
};
117+
clone.SupportedPatterns.AddRange(this.SupportedPatterns);
117118
return clone;
118119
}
119120

0 commit comments

Comments
 (0)