Skip to content

Commit

Permalink
Supported patterns should be copied over on cloning a WinControlIdentity
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfactor26 committed Dec 25, 2022
1 parent a7f84c8 commit b122e02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Pixel.Automation.UIA.Components/WinControlIdentity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class WinControlIdentity : ControlIdentity

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


#region required during scraping
Expand All @@ -84,7 +84,7 @@ public int ProcessId

public WinControlIdentity() : base()
{
this.SupportedPatterns = new List<string>();

}


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

};
clone.SupportedPatterns.AddRange(this.SupportedPatterns);
return clone;
}

Expand Down

0 comments on commit b122e02

Please sign in to comment.