Skip to content

Commit a080b5b

Browse files
committed
Add missing XML documentation comments
1 parent 09e5fbc commit a080b5b

10 files changed

+141
-1
lines changed

src/PowerShellEditorServices/Console/CollectionFieldDetails.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
namespace Microsoft.PowerShell.EditorServices.Console
1010
{
11+
/// <summary>
12+
/// Contains the details of an colleciton input field shown
13+
/// from an InputPromptHandler. This class is meant to be
14+
/// serializable to the user's UI.
15+
/// </summary>
1116
public class CollectionFieldDetails : FieldDetails
1217
{
1318
#region Private Fields
@@ -22,6 +27,14 @@ public class CollectionFieldDetails : FieldDetails
2227

2328
#region Constructors
2429

30+
/// <summary>
31+
/// Creates an instance of the CollectionFieldDetails class.
32+
/// </summary>
33+
/// <param name="name">The field's name.</param>
34+
/// <param name="label">The field's label.</param>
35+
/// <param name="fieldType">The field's value type.</param>
36+
/// <param name="isMandatory">If true, marks the field as mandatory.</param>
37+
/// <param name="defaultValue">The field's default value.</param>
2538
public CollectionFieldDetails(
2639
string name,
2740
string label,
@@ -51,6 +64,14 @@ public CollectionFieldDetails(
5164

5265
#region Public Methods
5366

67+
/// <summary>
68+
/// Gets the next field to display if this is a complex
69+
/// field, otherwise returns null.
70+
/// </summary>
71+
/// <returns>
72+
/// A FieldDetails object if there's another field to
73+
/// display or if this field is complete.
74+
/// </returns>
5475
public override FieldDetails GetNextField()
5576
{
5677
if (!this.isEntryComplete)
@@ -71,6 +92,13 @@ public override FieldDetails GetNextField()
7192
}
7293
}
7394

95+
/// <summary>
96+
/// Sets the field's value.
97+
/// </summary>
98+
/// <param name="fieldValue">The field's value.</param>
99+
/// <param name="hasValue">
100+
/// True if a value has been supplied by the user, false if the user supplied no value.
101+
/// </param>
74102
public override void SetValue(object fieldValue, bool hasValue)
75103
{
76104
if (hasValue)
@@ -84,6 +112,11 @@ public override void SetValue(object fieldValue, bool hasValue)
84112
}
85113
}
86114

115+
/// <summary>
116+
/// Gets the field's final value after the prompt is
117+
/// complete.
118+
/// </summary>
119+
/// <returns>The field's final value.</returns>
87120
protected override object OnGetValue()
88121
{
89122
object collection = this.collectionItems;

src/PowerShellEditorServices/Console/ConsoleChoicePromptHandler.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ protected override void ShowPrompt(PromptStyle promptStyle)
9393
}
9494
}
9595

96+
/// <summary>
97+
/// Reads an input string from the user.
98+
/// </summary>
99+
/// <param name="cancellationToken">A CancellationToken that can be used to cancel the prompt.</param>
100+
/// <returns>A Task that can be awaited to get the user's response.</returns>
96101
protected override Task<string> ReadInputString(CancellationToken cancellationToken)
97102
{
98103
return this.consoleHost.ReadSimpleLine(cancellationToken);

src/PowerShellEditorServices/Console/ConsoleInputPromptHandler.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,21 @@ protected override void ShowErrorMessage(Exception e)
9292
OutputType.Error);
9393
}
9494

95+
/// <summary>
96+
/// Reads an input string from the user.
97+
/// </summary>
98+
/// <param name="cancellationToken">A CancellationToken that can be used to cancel the prompt.</param>
99+
/// <returns>A Task that can be awaited to get the user's response.</returns>
95100
protected override Task<string> ReadInputString(CancellationToken cancellationToken)
96101
{
97102
return this.consoleHost.ReadSimpleLine(cancellationToken);
98103
}
99104

105+
/// <summary>
106+
/// Reads a SecureString from the user.
107+
/// </summary>
108+
/// <param name="cancellationToken">A CancellationToken that can be used to cancel the prompt.</param>
109+
/// <returns>A Task that can be awaited to get the user's response.</returns>
100110
protected override Task<SecureString> ReadSecureString(CancellationToken cancellationToken)
101111
{
102112
return this.consoleHost.ReadSecureLine(cancellationToken);

src/PowerShellEditorServices/Console/ConsoleService.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public void PopPromptHandlerContext()
219219
}
220220

221221
/// <summary>
222-
/// Cancels the currently executing command.
222+
/// Cancels the currently executing command or prompt.
223223
/// </summary>
224224
public void SendControlC()
225225
{
@@ -234,13 +234,23 @@ public void SendControlC()
234234
}
235235
}
236236

237+
/// <summary>
238+
/// Reads an input string from the user.
239+
/// </summary>
240+
/// <param name="cancellationToken">A CancellationToken that can be used to cancel the prompt.</param>
241+
/// <returns>A Task that can be awaited to get the user's response.</returns>
237242
public async Task<string> ReadSimpleLine(CancellationToken cancellationToken)
238243
{
239244
string inputLine = await this.consoleReadLine.ReadSimpleLine(cancellationToken);
240245
this.WriteOutput(string.Empty, true);
241246
return inputLine;
242247
}
243248

249+
/// <summary>
250+
/// Reads a SecureString from the user.
251+
/// </summary>
252+
/// <param name="cancellationToken">A CancellationToken that can be used to cancel the prompt.</param>
253+
/// <returns>A Task that can be awaited to get the user's response.</returns>
244254
public async Task<SecureString> ReadSecureLine(CancellationToken cancellationToken)
245255
{
246256
SecureString secureString = await this.consoleReadLine.ReadSecureLine(cancellationToken);

src/PowerShellEditorServices/Console/CredentialFieldDetails.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,22 @@
99

1010
namespace Microsoft.PowerShell.EditorServices.Console
1111
{
12+
/// <summary>
13+
/// Contains the details of a PSCredential field shown
14+
/// from an InputPromptHandler. This class is meant to
15+
/// be serializable to the user's UI.
16+
/// </summary>
1217
public class CredentialFieldDetails : FieldDetails
1318
{
1419
private string userName;
1520
private SecureString password;
1621

22+
/// <summary>
23+
/// Creates an instance of the CredentialFieldDetails class.
24+
/// </summary>
25+
/// <param name="name">The field's name.</param>
26+
/// <param name="label">The field's label.</param>
27+
/// <param name="userName">The initial value of the userName field.</param>
1728
public CredentialFieldDetails(
1829
string name,
1930
string label,
@@ -28,6 +39,14 @@ public CredentialFieldDetails(
2839
}
2940
}
3041

42+
/// <summary>
43+
/// Creates an instance of the CredentialFieldDetails class.
44+
/// </summary>
45+
/// <param name="name">The field's name.</param>
46+
/// <param name="label">The field's label.</param>
47+
/// <param name="fieldType">The field's value type.</param>
48+
/// <param name="isMandatory">If true, marks the field as mandatory.</param>
49+
/// <param name="defaultValue">The field's default value.</param>
3150
public CredentialFieldDetails(
3251
string name,
3352
string label,
@@ -42,6 +61,14 @@ public CredentialFieldDetails(
4261

4362
#region Public Methods
4463

64+
/// <summary>
65+
/// Gets the next field to display if this is a complex
66+
/// field, otherwise returns null.
67+
/// </summary>
68+
/// <returns>
69+
/// A FieldDetails object if there's another field to
70+
/// display or if this field is complete.
71+
/// </returns>
4572
public override FieldDetails GetNextField()
4673
{
4774
if (this.password != null)
@@ -58,6 +85,13 @@ public override FieldDetails GetNextField()
5885
return this;
5986
}
6087

88+
/// <summary>
89+
/// Sets the field's value.
90+
/// </summary>
91+
/// <param name="fieldValue">The field's value.</param>
92+
/// <param name="hasValue">
93+
/// True if a value has been supplied by the user, false if the user supplied no value.
94+
/// </param>
6195
public override void SetValue(object fieldValue, bool hasValue)
6296
{
6397
if (hasValue)
@@ -73,6 +107,11 @@ public override void SetValue(object fieldValue, bool hasValue)
73107
}
74108
}
75109

110+
/// <summary>
111+
/// Gets the field's final value after the prompt is
112+
/// complete.
113+
/// </summary>
114+
/// <returns>The field's final value.</returns>
76115
protected override object OnGetValue()
77116
{
78117
return new PSCredential(this.userName, this.password);

src/PowerShellEditorServices/Console/FieldDetails.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ public FieldDetails(
100100

101101
#region Public Methods
102102

103+
/// <summary>
104+
/// Sets the field's value.
105+
/// </summary>
106+
/// <param name="fieldValue">The field's value.</param>
107+
/// <param name="hasValue">
108+
/// True if a value has been supplied by the user, false if the user supplied no value.
109+
/// </param>
103110
public virtual void SetValue(object fieldValue, bool hasValue)
104111
{
105112
if (hasValue)
@@ -108,6 +115,11 @@ public virtual void SetValue(object fieldValue, bool hasValue)
108115
}
109116
}
110117

118+
/// <summary>
119+
/// Gets the field's final value after the prompt is
120+
/// complete.
121+
/// </summary>
122+
/// <returns>The field's final value.</returns>
111123
public object GetValue()
112124
{
113125
object fieldValue = this.OnGetValue();
@@ -130,6 +142,11 @@ public object GetValue()
130142
return fieldValue;
131143
}
132144

145+
/// <summary>
146+
/// Gets the field's final value after the prompt is
147+
/// complete.
148+
/// </summary>
149+
/// <returns>The field's final value.</returns>
133150
protected virtual object OnGetValue()
134151
{
135152
return this.fieldValue;

src/PowerShellEditorServices/Console/IConsoleHost.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,23 @@ void WriteOutput(
5757
/// <returns>A new InputPromptHandler instance.</returns>
5858
InputPromptHandler GetInputPromptHandler();
5959

60+
/// <summary>
61+
/// Reads an input string from the user.
62+
/// </summary>
63+
/// <param name="cancellationToken">A CancellationToken that can be used to cancel the prompt.</param>
64+
/// <returns>A Task that can be awaited to get the user's response.</returns>
6065
Task<string> ReadSimpleLine(CancellationToken cancellationToken);
6166

67+
/// <summary>
68+
/// Reads a SecureString from the user.
69+
/// </summary>
70+
/// <param name="cancellationToken">A CancellationToken that can be used to cancel the prompt.</param>
71+
/// <returns>A Task that can be awaited to get the user's response.</returns>
6272
Task<SecureString> ReadSecureLine(CancellationToken cancellationToken);
6373

74+
/// <summary>
75+
/// Cancels the currently executing command or prompt.
76+
/// </summary>
6477
void SendControlC();
6578

6679
/// <summary>

src/PowerShellEditorServices/Session/EditorSession.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public class EditorSession
7979
/// <param name="profilePaths">
8080
/// An object containing the profile paths for the session.
8181
/// </param>
82+
/// <param name="enableConsoleRepl">
83+
/// Enables a terminal-based REPL for this session.
84+
/// </param>
8285
public void StartSession(
8386
HostDetails hostDetails,
8487
ProfilePaths profilePaths,

src/PowerShellEditorServices/Session/PowerShellContext.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ public PowerShellContext(HostDetails hostDetails, ProfilePaths profilePaths)
149149
/// </summary>
150150
/// <param name="hostDetails">Provides details about the host application.</param>
151151
/// <param name="profilePaths">An object containing the profile paths for the session.</param>
152+
/// <param name="enableConsoleRepl">
153+
/// Enables a terminal-based REPL for this session.
154+
/// </param>
152155
public PowerShellContext(
153156
HostDetails hostDetails,
154157
ProfilePaths profilePaths,
@@ -1435,6 +1438,10 @@ private void HandleRunspaceStateChanged(object sender, RunspaceStateEventArgs ar
14351438
// NOTE: This event is 'internal' because the DebugService provides
14361439
// the publicly consumable event.
14371440
internal event EventHandler<DebuggerStopEventArgs> DebuggerStop;
1441+
1442+
/// <summary>
1443+
/// Raised when the debugger is resumed after it was previously stopped.
1444+
/// </summary>
14381445
public event EventHandler<DebuggerResumeAction> DebuggerResumed;
14391446

14401447
private void OnDebuggerStop(object sender, DebuggerStopEventArgs e)

src/PowerShellEditorServices/Session/SessionPSHost.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ internal IConsoleHost ConsoleHost
5656
/// <param name="hostSupportsInteractiveSession">
5757
/// An implementation of IHostSupportsInteractiveSession for runspace management.
5858
/// </param>
59+
/// <param name="enableConsoleRepl">
60+
/// Enables a terminal-based REPL for this session.
61+
/// </param>
5962
public ConsoleServicePSHost(
6063
HostDetails hostDetails,
6164
IHostSupportsInteractiveSession hostSupportsInteractiveSession,

0 commit comments

Comments
 (0)