@@ -15,127 +15,124 @@ function Get-NetHelp {
15
15
[string ]$Method
16
16
)
17
17
18
- if ($Docs = Get-HelpLocation $Type ) {
19
- $PSCmdlet.WriteVerbose (" Found '$Docs '." )
18
+ # if ($Docs = Get-HelpLocation $Type) {
19
+ # $PSCmdlet.WriteVerbose("Found '$Docs'.")
20
20
21
- $TypeName = $Type.FullName
22
- if ($Method ) {
23
- $Selector = " M:$TypeName .$Method "
24
- } else { # # TODO: Property?
25
- $Selector = " T:$TypeName "
26
- }
21
+ # $TypeName = $Type.FullName
22
+ # if ($Method) {
23
+ # $Selector = "M:$TypeName.$Method"
24
+ # } else { ## TODO: Property?
25
+ # $Selector = "T:$TypeName"
26
+ # }
27
27
28
- # # get summary, if possible
29
- $Help = Import-LocalNetHelp $Docs $Selector
28
+ # ## get summary, if possible
29
+ # $Help = Import-LocalNetHelp $Docs $Selector
30
30
31
- if ($Help ) {
32
- $Help # | Format-AssemblyHelp
33
- } else {
34
- Write-Host " While some local documentation was found, it was incomplete."
31
+ # if ($Help) {
32
+ # Write-Verbose $Help.OuterXml
33
+ # }
34
+ # }
35
+
36
+ $HelpObject = New-Object PSObject - Property @ {
37
+ Details = New-Object PSObject - Property @ {
38
+ Name = $Type.Name
39
+ Namespace = $Type.Namespace
40
+ SuperClass = $Type.BaseType
35
41
}
42
+ Properties = @ {}
43
+ Constructors = @ ()
44
+ Methods = @ {}
45
+ RelatedLinks = @ (
46
+ New-Object PSObject - Property @ {Title = " Online Version" ; Link = Get-HelpUri $Type }
47
+ )
48
+ }
49
+ $HelpObject.Details.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Details" )
50
+ $HelpObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo" )
51
+ if ($Detailed ) {
52
+ $HelpObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#DetailedView" )
36
53
} else {
37
- $HelpObject = New-Object PSObject - Property @ {
38
- Details = New-Object PSObject - Property @ {
39
- Name = $Type.Name
40
- Namespace = $Type.Namespace
41
- SuperClass = $Type.BaseType
42
- }
43
- Properties = @ {}
44
- Constructors = @ ()
45
- Methods = @ {}
46
- RelatedLinks = @ (
47
- New-Object PSObject - Property @ {Title = " Online Version" ; Link = Get-HelpUri $Type }
48
- )
49
- }
50
- $HelpObject.Details.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Details" )
51
- $HelpObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo" )
52
- if ($Detailed ) {
53
- $HelpObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#DetailedView" )
54
- # Write-Error "Local detailed help not available for type '$Type'."
55
- } else {
56
- $HelpObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net" )
57
- }
54
+ $HelpObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net" )
55
+ }
58
56
59
- foreach ($NetProperty in $Type.DeclaredProperties ) {
60
- $PropertyObject = New-Object PSObject - Property @ {
61
- Name = $NetProperty.Name
62
- Type = $NetProperty.PropertyType
63
- }
64
- $PropertyObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#Property" )
65
- $HelpObject.Properties.Add ($NetProperty.Name , $PropertyObject )
57
+ foreach ($NetProperty in $Type.DeclaredProperties ) {
58
+ $PropertyObject = New-Object PSObject - Property @ {
59
+ Name = $NetProperty.Name
60
+ Type = $NetProperty.PropertyType
66
61
}
62
+ $PropertyObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#Property" )
63
+ $HelpObject.Properties.Add ($NetProperty.Name , $PropertyObject )
64
+ }
67
65
68
- foreach ($NetConstructor in $Type.DeclaredConstructors | Where-Object {$_.IsPublic }) {
69
- $ConstructorObject = New-Object PSObject - Property @ {
70
- Name = $Type.Name
71
- Namespace = $Type.Namespace
72
- Parameters = $NetConstructor.GetParameters ()
73
- }
74
- $ConstructorObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#Constructor" )
75
-
76
- $HelpObject.Constructors += $ConstructorObject
66
+ foreach ($NetConstructor in $Type.DeclaredConstructors | Where-Object {$_.IsPublic }) {
67
+ $ConstructorObject = New-Object PSObject - Property @ {
68
+ Name = $Type.Name
69
+ Namespace = $Type.Namespace
70
+ Parameters = $NetConstructor.GetParameters ()
77
71
}
78
-
79
- foreach ($NetMethod in $Type.DeclaredMethods | Where-Object {$_.IsPublic -and (-not $_.IsSpecialName )} | Group-Object Name) {
80
- $MethodObject = New-Object PSObject - Property @ {
81
- Name = $NetMethod.Name
82
- Static = $NetMethod.Group [0 ].IsStatic
83
- Constructor = $NetMethod.Group [0 ].IsConstructor
84
- ReturnType = $NetMethod.Group [0 ].ReturnType
85
- Overloads = @ (
86
- $NetMethod.Group | ForEach-Object {
87
- $MethodOverload = New-Object PSObject - Property @ {
88
- Name = $NetMethod.Name
89
- Static = $_.IsStatic
90
- ReturnType = $_.ReturnType
91
- Parameters = @ (
92
- $_.GetParameters () | ForEach-Object {
93
- New-Object PSObject - Property @ {
94
- Name = $_.Name
95
- ParameterType = $_.ParameterType
96
- }
72
+ $ConstructorObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#Constructor" )
73
+
74
+ $HelpObject.Constructors += $ConstructorObject
75
+ }
76
+
77
+ foreach ($NetMethod in $Type.DeclaredMethods | Where-Object {$_.IsPublic -and (-not $_.IsSpecialName )} | Group-Object Name) {
78
+ $MethodObject = New-Object PSObject - Property @ {
79
+ Name = $NetMethod.Name
80
+ Static = $NetMethod.Group [0 ].IsStatic
81
+ Constructor = $NetMethod.Group [0 ].IsConstructor
82
+ ReturnType = $NetMethod.Group [0 ].ReturnType
83
+ Overloads = @ (
84
+ $NetMethod.Group | ForEach-Object {
85
+ $MethodOverload = New-Object PSObject - Property @ {
86
+ Name = $NetMethod.Name
87
+ Static = $_.IsStatic
88
+ ReturnType = $_.ReturnType
89
+ Parameters = @ (
90
+ $_.GetParameters () | ForEach-Object {
91
+ New-Object PSObject - Property @ {
92
+ Name = $_.Name
93
+ ParameterType = $_.ParameterType
97
94
}
98
- )
99
- Class = $HelpObject.Details.Name
100
- Namespace = $HelpObject.Details.Namespace
101
- }
102
- $MethodOverload.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#MethodOverload" )
103
- $MethodOverload
95
+ }
96
+ )
97
+ Class = $HelpObject.Details.Name
98
+ Namespace = $HelpObject.Details.Namespace
104
99
}
105
- )
106
- }
107
- $MethodObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#Method" )
108
-
109
- $HelpObject.Methods.Add ($NetMethod.Name , $MethodObject )
100
+ $MethodOverload.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#MethodOverload" )
101
+ $MethodOverload
102
+ }
103
+ )
104
+ }
105
+ $MethodObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#Method" )
106
+
107
+ $HelpObject.Methods.Add ($NetMethod.Name , $MethodObject )
108
+ }
109
+
110
+ if ($Property ) {
111
+ $PropertyObject = $HelpObject.Properties [$Property ]
112
+
113
+ if ($PropertyObject ) {
114
+ Add-Member - InputObject $PropertyObject - Name Class -Value $HelpObject.Details.Name - MemberType NoteProperty
115
+ Add-Member - InputObject $PropertyObject - Name Namespace - Value $HelpObject.Details.Namespace - MemberType NoteProperty
116
+ Add-Member - InputObject $PropertyObject - Name SuperClass - Value $HelpObject.Details.SuperClass - MemberType NoteProperty
117
+ $PropertyObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#PropertyDetail" )
118
+ return $PropertyObject
119
+ } else {
120
+ throw " Property named '$Property ' not found."
110
121
}
111
-
112
- if ($Property ) {
113
- $PropertyObject = $HelpObject.Properties [$Property ]
114
-
115
- if ($PropertyObject ) {
116
- Add-Member - InputObject $PropertyObject - Name Class -Value $HelpObject.Details.Name - MemberType NoteProperty
117
- Add-Member - InputObject $PropertyObject - Name Namespace - Value $HelpObject.Details.Namespace - MemberType NoteProperty
118
- Add-Member - InputObject $PropertyObject - Name SuperClass - Value $HelpObject.Details.SuperClass - MemberType NoteProperty
119
- $PropertyObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#PropertyDetail" )
120
- return $PropertyObject
121
- } else {
122
- throw " Property named '$Property ' not found."
123
- }
124
- } elseif ($Method ) {
125
- $MethodObject = $HelpObject.Methods [$Method ]
126
-
127
- if ($MethodObject ) {
128
- Add-Member - InputObject $MethodObject - Name Class -Value $HelpObject.Details.Name - MemberType NoteProperty
129
- Add-Member - InputObject $MethodObject - Name Namespace - Value $HelpObject.Details.Namespace - MemberType NoteProperty
130
- Add-Member - InputObject $MethodObject - Name SuperClass - Value $HelpObject.Details.SuperClass - MemberType NoteProperty
131
- $MethodObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#MethodDetail" )
132
-
133
- return $MethodObject
134
- } else {
135
- throw " Method named '$Method ' not found."
136
- }
122
+ } elseif ($Method ) {
123
+ $MethodObject = $HelpObject.Methods [$Method ]
124
+
125
+ if ($MethodObject ) {
126
+ Add-Member - InputObject $MethodObject - Name Class -Value $HelpObject.Details.Name - MemberType NoteProperty
127
+ Add-Member - InputObject $MethodObject - Name Namespace - Value $HelpObject.Details.Namespace - MemberType NoteProperty
128
+ Add-Member - InputObject $MethodObject - Name SuperClass - Value $HelpObject.Details.SuperClass - MemberType NoteProperty
129
+ $MethodObject.PSObject.TypeNames.Insert (0 , " ObjectHelpInfo#Net#MethodDetail" )
130
+
131
+ return $MethodObject
137
132
} else {
138
- return $HelpObject
133
+ throw " Method named ' $Method ' not found. "
139
134
}
135
+ } else {
136
+ return $HelpObject
140
137
}
141
138
}
0 commit comments