File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed
Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ $isBindable = $false
2+ foreach ($attr in $this.Attributes ) {
3+ $reflectedType = $attr.TypeName.GetReflectionType ()
4+ if ((-not $reflectedType ) -or
5+ $reflectedType -notin [ComponentModel.DefaultBindingPropertyAttribute ],
6+ [ComponentModel.BindableAttribute ],
7+ [ComponentModel.ComplexBindingPropertiesAttribute ]) {
8+ continue
9+ }
10+
11+ $positionalArguments = @ (
12+ foreach ($positionalParameter in $attr.PositionalArguments ) {
13+ $positionalParameter.Value
14+ }
15+ )
16+ $realAttribute =
17+ if ($positionalArguments ) {
18+ $reflectedType ::new($positionalArguments )
19+ } else {
20+ $reflectedType ::new()
21+ }
22+
23+
24+ foreach ($namedArgument in $attr.NamedArguments ) {
25+ if ($namedArgument.ArgumentName -eq ' Name' ) {
26+ $realAttribute .$ ($namedArgument.ArgumentName ) = $namedArgument.Argument.Value
27+ }
28+ }
29+ $realAttribute
30+ }
Original file line number Diff line number Diff line change 1+ $isBindable = $false
2+ foreach ($attr in $this.Attributes ) {
3+ $reflectedType = $attr.TypeName.GetReflectionType ()
4+ if ($reflectedType -ne [ComponentModel.DefaultBindingPropertyAttribute ]) {
5+ if ($reflectedType -eq [ComponentModel.BindableAttribute ]) {
6+ if ($attr.PositionalArguments.Value -eq $false ) {
7+ return ' '
8+ } else {
9+ $isBindable = $true
10+ }
11+ }
12+ continue
13+ }
14+
15+ foreach ($positionalParameter in $attr.PositionalArguments ) {
16+ return $positionalParameter.Value
17+ }
18+
19+ foreach ($namedArgument in $attr.NamedArguments ) {
20+ if ($namedArgument.ArgumentName -eq ' Name' ) {
21+ return $namedArgument.Argument.Value
22+ }
23+ }
24+ }
25+
26+
27+ if ($isBindable ) {
28+ return $this.Name.VariablePath.ToString ()
29+ } else {
30+ return ' '
31+ }
You can’t perform that action at this time.
0 commit comments