99
1010namespace 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 ) ;
0 commit comments