Fix style issues (#10998)

This commit is contained in:
Ilya 2019-11-08 00:49:06 +05:00 committed by Aditya Patwardhan
parent 08e120ca2b
commit 9851b07b1d
50 changed files with 1230 additions and 920 deletions

View file

@ -9,21 +9,21 @@ using System.Windows;
namespace Microsoft.Management.UI
{
/// <summary>
/// Utilities in common in this assembly
/// Utilities in common in this assembly.
/// </summary>
internal static class CommonHelper
{
/// <summary>
/// Restore the values from the settings to the actual window position, size and state.
/// </summary>
/// <param name="target">the window we are setting position and size of</param>
/// <param name="userSettingTop">the value for top from the user settings</param>
/// <param name="userSettingLeft">the value for left from the user settings</param>
/// <param name="userSettingWidth">the value for width from the user settings</param>
/// <param name="userSettingHeight">the value for height from the user settings</param>
/// <param name="defaultWidth">the with used if <paramref name="userSettingWidth"/> is not valid</param>
/// <param name="defaultHeight">the height used if <paramref name="userSettingHeight"/> is not valid</param>
/// <param name="userSettingMaximized">true if the window is maximized in the user setting</param>
/// <param name="target">The window we are setting position and size of.</param>
/// <param name="userSettingTop">The value for top from the user settings.</param>
/// <param name="userSettingLeft">The value for left from the user settings.</param>
/// <param name="userSettingWidth">The value for width from the user settings.</param>
/// <param name="userSettingHeight">The value for height from the user settings.</param>
/// <param name="defaultWidth">The with used if <paramref name="userSettingWidth"/> is not valid.</param>
/// <param name="defaultHeight">The height used if <paramref name="userSettingHeight"/> is not valid.</param>
/// <param name="userSettingMaximized">True if the window is maximized in the user setting.</param>
internal static void SetStartingPositionAndSize(Window target, double userSettingTop, double userSettingLeft, double userSettingWidth, double userSettingHeight, double defaultWidth, double defaultHeight, bool userSettingMaximized)
{
bool leftInvalid = userSettingLeft < System.Windows.SystemParameters.VirtualScreenLeft ||

View file

@ -11,30 +11,30 @@ using System.Windows.Documents;
namespace Microsoft.Management.UI.Internal
{
/// <summary>
/// Builds a help paragraph for a cmdlet
/// Builds a help paragraph for a cmdlet.
/// </summary>
internal class HelpParagraphBuilder : ParagraphBuilder
{
/// <summary>
/// Indentation size
/// Indentation size.
/// </summary>
internal const int IndentSize = 4;
/// <summary>
/// new line separators
/// new line separators.
/// </summary>
private static readonly string[] Separators = new[] { "\r\n", "\n" };
/// <summary>
/// Object with the cmdelt
/// Object with the cmdelt.
/// </summary>
private readonly PSObject psObj;
/// <summary>
/// Initializes a new instance of the HelpParagraphBuilder class
/// Initializes a new instance of the HelpParagraphBuilder class.
/// </summary>
/// <param name="paragraph">paragraph being built</param>
/// <param name="psObj">object with help information</param>
/// <param name="paragraph">Paragraph being built.</param>
/// <param name="psObj">Object with help information.</param>
internal HelpParagraphBuilder(Paragraph paragraph, PSObject psObj)
: base(paragraph)
{
@ -53,11 +53,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the string value of a property or null if it could not be retrieved
/// Gets the string value of a property or null if it could not be retrieved.
/// </summary>
/// <param name="psObj">object with the property</param>
/// <param name="propertyName">property name</param>
/// <returns>the string value of a property or null if it could not be retrieved</returns>
/// <param name="psObj">Object with the property.</param>
/// <param name="propertyName">Property name.</param>
/// <returns>The string value of a property or null if it could not be retrieved.</returns>
internal static string GetPropertyString(PSObject psObj, string propertyName)
{
Debug.Assert(psObj != null, "ensured by caller");
@ -72,7 +72,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds the help text to the paragraph
/// Adds the help text to the paragraph.
/// </summary>
internal void AddTextToParagraphBuilder()
{
@ -131,11 +131,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the object property or null if it could not be retrieved
/// Gets the object property or null if it could not be retrieved.
/// </summary>
/// <param name="psObj">object with the property</param>
/// <param name="propertyName">property name</param>
/// <returns>the object property or null if it could not be retrieved</returns>
/// <param name="psObj">Object with the property.</param>
/// <param name="propertyName">Property name.</param>
/// <returns>The object property or null if it could not be retrieved.</returns>
private static PSPropertyInfo GetProperty(PSObject psObj, string propertyName)
{
Debug.Assert(psObj != null, "ensured by caller");
@ -143,12 +143,12 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets a PSObject and then a value from it or null if the value could not be retrieved
/// Gets a PSObject and then a value from it or null if the value could not be retrieved.
/// </summary>
/// <param name="psObj">PSObject that contains another PSObject as a property</param>
/// <param name="psObjectName">property name that contains the PSObject</param>
/// <param name="propertyName">property name in thye inner PSObject</param>
/// <returns>the string from the inner psObject property or null if it could not be retrieved</returns>
/// <param name="psObj">PSObject that contains another PSObject as a property.</param>
/// <param name="psObjectName">Property name that contains the PSObject.</param>
/// <param name="propertyName">Property name in thye inner PSObject.</param>
/// <returns>The string from the inner psObject property or null if it could not be retrieved.</returns>
private static string GetInnerPSObjectPropertyString(PSObject psObj, string psObjectName, string propertyName)
{
Debug.Assert(psObj != null, "ensured by caller");
@ -170,11 +170,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the value of a property or null if the value could not be retrieved
/// Gets the value of a property or null if the value could not be retrieved.
/// </summary>
/// <param name="psObj">object with the property</param>
/// <param name="propertyName">property name</param>
/// <returns>the value of a property or null if the value could not be retrieved</returns>
/// <param name="psObj">Object with the property.</param>
/// <param name="propertyName">Property name.</param>
/// <returns>The value of a property or null if the value could not be retrieved.</returns>
private static object GetPropertyObject(PSObject psObj, string propertyName)
{
Debug.Assert(psObj != null, "ensured by caller");
@ -198,11 +198,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the text from a property of type PSObject[] where the first object has a text property
/// Gets the text from a property of type PSObject[] where the first object has a text property.
/// </summary>
/// <param name="psObj">objhect to get text from</param>
/// <param name="propertyText">property with PSObject[] containing text</param>
/// <returns>the text from a property of type PSObject[] where the first object has a text property</returns>
/// <param name="psObj">Objhect to get text from.</param>
/// <param name="propertyText">Property with PSObject[] containing text.</param>
/// <returns>The text from a property of type PSObject[] where the first object has a text property.</returns>
private static string GetTextFromArray(PSObject psObj, string propertyText)
{
PSObject[] introductionObjects = HelpParagraphBuilder.GetPropertyObject(psObj, propertyText) as PSObject[];
@ -215,10 +215,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Returns the largest size of a group of strings
/// Returns the largest size of a group of strings.
/// </summary>
/// <param name="strs">strings to evaluate the largest size from</param>
/// <returns>the largest size of a group of strings</returns>
/// <param name="strs">Strings to evaluate the largest size from.</param>
/// <returns>The largest size of a group of strings.</returns>
private static int LargestSize(params string[] strs)
{
int returnValue = 0;
@ -235,21 +235,21 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Splits the string adding indentation before each line
/// Splits the string adding indentation before each line.
/// </summary>
/// <param name="str">string to add indentation to</param>
/// <returns>the string indented</returns>
/// <param name="str">String to add indentation to.</param>
/// <returns>The string indented.</returns>
private static string AddIndent(string str)
{
return HelpParagraphBuilder.AddIndent(str, 1);
}
/// <summary>
/// Splits the string adding indentation before each line
/// Splits the string adding indentation before each line.
/// </summary>
/// <param name="str">string to add indentation to</param>
/// <param name="numberOfIdents">number of indentations</param>
/// <returns>the string indented</returns>
/// <param name="str">String to add indentation to.</param>
/// <param name="numberOfIdents">Number of indentations.</param>
/// <returns>The string indented.</returns>
private static string AddIndent(string str, int numberOfIdents)
{
StringBuilder indent = new StringBuilder();
@ -258,11 +258,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Splits the string adding indentation before each line
/// Splits the string adding indentation before each line.
/// </summary>
/// <param name="str">string to add indentation to</param>
/// <param name="indentString">indentation string</param>
/// <returns>the string indented</returns>
/// <param name="str">String to add indentation to.</param>
/// <param name="indentString">Indentation string.</param>
/// <returns>The string indented.</returns>
private static string AddIndent(string str, string indentString)
{
if (str == null)
@ -289,11 +289,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Get the object array value of a property
/// Get the object array value of a property.
/// </summary>
/// <param name="obj">object containing the property</param>
/// <param name="propertyName">property with the array value</param>
/// <returns>the object array value of a property</returns>
/// <param name="obj">Object containing the property.</param>
/// <param name="propertyName">Property with the array value.</param>
/// <returns>The object array value of a property.</returns>
private static object[] GetPropertyObjectArray(PSObject obj, string propertyName)
{
object innerObject;
@ -312,11 +312,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds a section that contains only a string
/// Adds a section that contains only a string.
/// </summary>
/// <param name="setting">true if it should add the segment</param>
/// <param name="sectionName">name of the section to add</param>
/// <param name="sectionTitle">title of the section</param>
/// <param name="setting">True if it should add the segment.</param>
/// <param name="sectionName">Name of the section to add.</param>
/// <param name="sectionTitle">Title of the section.</param>
private void AddStringSection(bool setting, string sectionName, string sectionTitle)
{
string propertyValue;
@ -332,10 +332,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds the help syntax segment
/// Adds the help syntax segment.
/// </summary>
/// <param name="setting">true if it should add the segment</param>
/// <param name="sectionTitle">title of the section</param>
/// <param name="setting">True if it should add the segment.</param>
/// <param name="sectionTitle">Title of the section.</param>
private void AddSyntax(bool setting, string sectionTitle)
{
PSObject syntaxObject;
@ -446,11 +446,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds the help description segment
/// Adds the help description segment.
/// </summary>
/// <param name="setting">true if it should add the segment</param>
/// <param name="sectionTitle">title of the section</param>
/// <param name="propertyName">propertyName that has description</param>
/// <param name="setting">True if it should add the segment.</param>
/// <param name="sectionTitle">Title of the section.</param>
/// <param name="propertyName">PropertyName that has description.</param>
private void AddDescription(bool setting, string sectionTitle, string propertyName)
{
PSObject[] descriptionObjects;
@ -475,10 +475,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds the help examples segment
/// Adds the help examples segment.
/// </summary>
/// <param name="setting">true if it should add the segment</param>
/// <param name="sectionTitle">title of the section</param>
/// <param name="setting">True if it should add the segment.</param>
/// <param name="sectionTitle">Title of the section.</param>
private void AddExamples(bool setting, string sectionTitle)
{
if (!setting)
@ -713,12 +713,12 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds the help parameters segment
/// Adds the help parameters segment.
/// </summary>
/// <param name="setting">true if it should add the segment</param>
/// <param name="sectionTitle">title of the section</param>
/// <param name="paramPropertyName">name of the property which has properties</param>
/// <param name="helpCategory">category of help</param>
/// <param name="setting">True if it should add the segment.</param>
/// <param name="sectionTitle">Title of the section.</param>
/// <param name="paramPropertyName">Name of the property which has properties.</param>
/// <param name="helpCategory">Category of help.</param>
private void AddParameters(bool setting, string sectionTitle, string paramPropertyName, HelpCategory helpCategory)
{
if (!setting)
@ -860,10 +860,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds the help navigation links segment
/// Adds the help navigation links segment.
/// </summary>
/// <param name="setting">true if it should add the segment</param>
/// <param name="sectionTitle">title of the section</param>
/// <param name="setting">True if it should add the segment.</param>
/// <param name="sectionTitle">Title of the section.</param>
private void AddNavigationLink(bool setting, string sectionTitle)
{
if (!setting)
@ -907,12 +907,12 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds the help input or output segment
/// Adds the help input or output segment.
/// </summary>
/// <param name="setting">true if it should add the segment</param>
/// <param name="sectionTitle">title of the section</param>
/// <param name="inputOrOutputProperty">property with the outter object</param>
/// <param name="inputOrOutputInnerProperty">property with the inner object</param>
/// <param name="setting">True if it should add the segment.</param>
/// <param name="sectionTitle">Title of the section.</param>
/// <param name="inputOrOutputProperty">Property with the outter object.</param>
/// <param name="inputOrOutputInnerProperty">Property with the inner object.</param>
private void AddInputOrOutputEntries(bool setting, string sectionTitle, string inputOrOutputProperty, string inputOrOutputInnerProperty)
{
if (!setting)
@ -961,10 +961,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds the help notes segment
/// Adds the help notes segment.
/// </summary>
/// <param name="setting">true if it should add the segment</param>
/// <param name="sectionTitle">title of the section</param>
/// <param name="setting">True if it should add the segment.</param>
/// <param name="sectionTitle">Title of the section.</param>
private void AddNotes(bool setting, string sectionTitle)
{
if (!setting)

View file

@ -14,45 +14,45 @@ namespace Microsoft.Management.UI.Internal
/// ViewModel for the Help Dialog used to:
/// build the help document
/// search the help document
/// offer text for labels
/// offer text for labels.
/// </summary>
internal class HelpViewModel : INotifyPropertyChanged
{
/// <summary>
/// The builder for the help FlowDocument Paragraph used in a RichEditText control
/// The builder for the help FlowDocument Paragraph used in a RichEditText control.
/// </summary>
private readonly HelpParagraphBuilder helpBuilder;
/// <summary>
/// Searcher for selecting current matches in paragraph text
/// Searcher for selecting current matches in paragraph text.
/// </summary>
private readonly ParagraphSearcher searcher;
/// <summary>
/// Title of the help window
/// Title of the help window.
/// </summary>
private readonly string helpTitle;
/// <summary>
/// the zoom bound to the zoom slider value
/// the zoom bound to the zoom slider value.
/// </summary>
private double zoom = 100;
/// <summary>
/// Text to be found. This is bound to the find TextBox
/// Text to be found. This is bound to the find TextBox.
/// </summary>
private string findText;
/// <summary>
/// text for the number of matches found
/// text for the number of matches found.
/// </summary>
private string matchesLabel;
/// <summary>
/// Initializes a new instance of the HelpViewModel class
/// Initializes a new instance of the HelpViewModel class.
/// </summary>
/// <param name="psObj">object containing help</param>
/// <param name="documentParagraph">paragraph in which help text is built/searched</param>
/// <param name="psObj">Object containing help.</param>
/// <param name="documentParagraph">Paragraph in which help text is built/searched.</param>
internal HelpViewModel(PSObject psObj, Paragraph documentParagraph)
{
Debug.Assert(psObj != null, "ensured by caller");
@ -70,13 +70,13 @@ namespace Microsoft.Management.UI.Internal
#region INotifyPropertyChanged Members
/// <summary>
/// Used to notify of property changes
/// Used to notify of property changes.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
#endregion
/// <summary>
/// Gets or sets the Zoom bound to the zoom slider value
/// Gets or sets the Zoom bound to the zoom slider value.
/// </summary>
public double Zoom
{
@ -95,7 +95,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the value bound to the RichTextEdit zoom, which is calculated based on the zoom
/// Gets the value bound to the RichTextEdit zoom, which is calculated based on the zoom.
/// </summary>
public double ZoomLevel
{
@ -106,7 +106,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the label to be displayed for the zoom
/// Gets the label to be displayed for the zoom.
/// </summary>
public string ZoomLabel
{
@ -117,7 +117,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets or sets the text to be found
/// Gets or sets the text to be found.
/// </summary>
public string FindText
{
@ -135,7 +135,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the title of the window
/// Gets the title of the window.
/// </summary>
public string HelpTitle
{
@ -146,7 +146,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets or sets the label for current matches
/// Gets or sets the label for current matches.
/// </summary>
public string MatchesLabel
{
@ -163,7 +163,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets a value indicating whether there are matches to go to
/// Gets a value indicating whether there are matches to go to.
/// </summary>
public bool CanGoToNextOrPrevious
{
@ -174,7 +174,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the searcher for selecting current matches in paragraph text
/// Gets the searcher for selecting current matches in paragraph text.
/// </summary>
internal ParagraphSearcher Searcher
{
@ -182,7 +182,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the paragraph builder used to write help content
/// Gets the paragraph builder used to write help content.
/// </summary>
internal HelpParagraphBuilder HelpBuilder
{
@ -200,7 +200,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Increases Zoom if not above maximum
/// Increases Zoom if not above maximum.
/// </summary>
internal void ZoomIn()
{
@ -211,7 +211,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Decreases Zoom if not below minimum
/// Decreases Zoom if not below minimum.
/// </summary>
internal void ZoomOut()
{
@ -222,10 +222,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Called to update the matches label
/// Called to update the matches label.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void HelpBuilder_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "HighlightCount")
@ -236,7 +236,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Sets the current matches label
/// Sets the current matches label.
/// </summary>
private void SetMatchesLabel()
{
@ -268,9 +268,9 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Called internally to notify when a proiperty changed
/// Called internally to notify when a proiperty changed.
/// </summary>
/// <param name="propertyName">property name</param>
/// <param name="propertyName">Property name.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;

View file

@ -12,12 +12,12 @@ using Microsoft.Management.UI.Internal;
namespace Microsoft.Management.UI
{
/// <summary>
/// A window displaying help content and allowing search
/// A window displaying help content and allowing search.
/// </summary>
public partial class HelpWindow : Window
{
/// <summary>
/// Minimum zoom in the slider
/// Minimum zoom in the slider.
/// </summary>
public static double MinimumZoom
{
@ -28,7 +28,7 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Maximum zoom in the slider
/// Maximum zoom in the slider.
/// </summary>
public static double MaximumZoom
{
@ -39,7 +39,7 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Zoom interval
/// Zoom interval.
/// </summary>
public static double ZoomInterval
{
@ -50,14 +50,14 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// The ViewModel for the dialog
/// The ViewModel for the dialog.
/// </summary>
private readonly HelpViewModel viewModel;
/// <summary>
/// Initializes a new instance of the HelpWindow class
/// Initializes a new instance of the HelpWindow class.
/// </summary>
/// <param name="helpObject">the object with help information</param>
/// <param name="helpObject">The object with help information.</param>
public HelpWindow(PSObject helpObject)
{
InitializeComponent();
@ -82,9 +82,9 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Handles the mouse wheel to zoom in/out
/// Handles the mouse wheel to zoom in/out.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
{
if (Keyboard.Modifiers != ModifierKeys.Control)
@ -106,9 +106,9 @@ namespace Microsoft.Management.UI
/// <summary>
/// Handles key down to fix the Page/Douwn going to end of help issue
/// And to implement some additional shortcuts like Ctrl+F and ZoomIn/ZoomOut
/// And to implement some additional shortcuts like Ctrl+F and ZoomIn/ZoomOut.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.None)
@ -151,7 +151,7 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Reads the zoom part of the user settings
/// Reads the zoom part of the user settings.
/// </summary>
private void ReadZoomUserSetting()
{
@ -164,9 +164,9 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Handles Zoom in and Zoom out keys
/// Handles Zoom in and Zoom out keys.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
private void HandleZoomInAndZoomOut(KeyEventArgs e)
{
if (e.Key == Key.OemPlus || e.Key == Key.Add)
@ -183,10 +183,10 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Listens to changes in the zoom in order to update the user settings
/// Listens to changes in the zoom in order to update the user settings.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "Zoom")
@ -196,30 +196,30 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Saves the user settings
/// Saves the user settings.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void HelpDialog_Closed(object sender, System.EventArgs e)
{
HelpWindowSettings.Default.Save();
}
/// <summary>
/// Updates the user setting with window state
/// Updates the user setting with window state.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void HelpDialog_StateChanged(object sender, System.EventArgs e)
{
HelpWindowSettings.Default.HelpWindowMaximized = this.WindowState == WindowState.Maximized;
}
/// <summary>
/// Sets the positions from user settings and start monitoring position changes
/// Sets the positions from user settings and start monitoring position changes.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void HelpDialog_Loaded(object sender, RoutedEventArgs e)
{
this.StateChanged += new System.EventHandler(this.HelpDialog_StateChanged);
@ -228,10 +228,10 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Saves size changes in user settings
/// Saves size changes in user settings.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void HelpDialog_SizeChanged(object sender, SizeChangedEventArgs e)
{
HelpWindowSettings.Default.HelpWindowWidth = this.Width;
@ -239,10 +239,10 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Saves position changes in user settings
/// Saves position changes in user settings.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void HelpDialog_LocationChanged(object sender, System.EventArgs e)
{
HelpWindowSettings.Default.HelpWindowTop = this.Top;
@ -250,10 +250,10 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Called when the settings button is clicked
/// Called when the settings button is clicked.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void Settings_Click(object sender, RoutedEventArgs e)
{
SettingsDialog settings = new SettingsDialog();
@ -269,29 +269,29 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Called when the Previous button is clicked
/// Called when the Previous button is clicked.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void PreviousMatch_Click(object sender, RoutedEventArgs e)
{
this.MoveToNextMatch(false);
}
/// <summary>
/// Called when the Next button is clicked
/// Called when the Next button is clicked.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void NextMatch_Click(object sender, RoutedEventArgs e)
{
this.MoveToNextMatch(true);
}
/// <summary>
/// Moves to the previous or next match
/// Moves to the previous or next match.
/// </summary>
/// <param name="forward">true for forward false for backwards</param>
/// <param name="forward">True for forward false for backwards.</param>
private void MoveToNextMatch(bool forward)
{
TextPointer caretPosition = this.HelpText.CaretPosition;
@ -300,9 +300,9 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Moves to the caret and brings the view to the <paramref name="run"/>
/// Moves to the caret and brings the view to the <paramref name="run"/>.
/// </summary>
/// <param name="run">run to move to</param>
/// <param name="run">Run to move to.</param>
private void MoveToRun(Run run)
{
if (run == null)

View file

@ -18,29 +18,29 @@ namespace Microsoft.Management.UI.Internal
internal class ParagraphBuilder : INotifyPropertyChanged
{
/// <summary>
/// The text spans that should be bold
/// The text spans that should be bold.
/// </summary>
private readonly List<TextSpan> boldSpans;
/// <summary>
/// The text spans that should be highlighted
/// The text spans that should be highlighted.
/// </summary>
private readonly List<TextSpan> highlightedSpans;
/// <summary>
/// The text displayed
/// The text displayed.
/// </summary>
private readonly StringBuilder textBuilder;
/// <summary>
/// Paragraph built in BuildParagraph
/// Paragraph built in BuildParagraph.
/// </summary>
private readonly Paragraph paragraph;
/// <summary>
/// Initializes a new instance of the ParagraphBuilder class
/// Initializes a new instance of the ParagraphBuilder class.
/// </summary>
/// <param name="paragraph">paragraph we will be adding lines to in BuildParagraph</param>
/// <param name="paragraph">Paragraph we will be adding lines to in BuildParagraph.</param>
internal ParagraphBuilder(Paragraph paragraph)
{
if (paragraph == null)
@ -56,7 +56,7 @@ namespace Microsoft.Management.UI.Internal
#region INotifyPropertyChanged Members
/// <summary>
/// Used to notify of property changes
/// Used to notify of property changes.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
#endregion
@ -70,7 +70,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the paragraph built in BuildParagraph
/// Gets the paragraph built in BuildParagraph.
/// </summary>
internal Paragraph Paragraph
{
@ -129,11 +129,11 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Highlights all ocurrences of <paramref name="search"/>.
/// This is called after all calls to AddText have been made
/// This is called after all calls to AddText have been made.
/// </summary>
/// <param name="search">search string</param>
/// <param name="caseSensitive">true if search should be case sensitive</param>
/// <param name="wholeWord">true if we should search whole word only</param>
/// <param name="search">Search string.</param>
/// <param name="caseSensitive">True if search should be case sensitive.</param>
/// <param name="wholeWord">True if we should search whole word only.</param>
internal void HighlightAllInstancesOf(string search, bool caseSensitive, bool wholeWord)
{
this.highlightedSpans.Clear();
@ -179,10 +179,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Adds text to the paragraph later build with BuildParagraph
/// Adds text to the paragraph later build with BuildParagraph.
/// </summary>
/// <param name="str">text to be added</param>
/// <param name="bold">true if the text should be bold</param>
/// <param name="str">Text to be added.</param>
/// <param name="bold">True if the text should be bold.</param>
internal void AddText(string str, bool bold)
{
if (str == null)
@ -205,7 +205,7 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Called before a derived class starts adding text
/// to reset the current content
/// to reset the current content.
/// </summary>
internal void ResetAllText()
{
@ -217,10 +217,10 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Adds an inline to <paramref name="currentParagraph"/> based on the remaining parameters.
/// </summary>
/// <param name="currentParagraph">paragraph to add Inline to</param>
/// <param name="currentBold">true if text should be added in bold</param>
/// <param name="currentHighlighted">true if the text should be added with highlight</param>
/// <param name="sequence">the text to add and clear</param>
/// <param name="currentParagraph">Paragraph to add Inline to.</param>
/// <param name="currentBold">True if text should be added in bold.</param>
/// <param name="currentHighlighted">True if the text should be added with highlight.</param>
/// <param name="sequence">The text to add and clear.</param>
private static void AddInline(Paragraph currentParagraph, bool currentBold, bool currentHighlighted, StringBuilder sequence)
{
if (sequence.Length == 0)
@ -247,10 +247,10 @@ namespace Microsoft.Management.UI.Internal
/// propper span in <paramref name="allSpans"/> according to the <paramref name="caracterPosition"/>
/// This is an auxiliar method in BuildParagraph.
/// </summary>
/// <param name="currentSpanIndex">current index within <paramref name="allSpans"/></param>
/// <param name="currentSpan">current span within <paramref name="allSpans"/></param>
/// <param name="caracterPosition">caracter position. This comes from a position within this.textBuilder</param>
/// <param name="allSpans">the collection of spans. This is either this.boldSpans or this.highlightedSpans</param>
/// <param name="currentSpanIndex">Current index within <paramref name="allSpans"/>.</param>
/// <param name="currentSpan">Current span within <paramref name="allSpans"/>.</param>
/// <param name="caracterPosition">Caracter position. This comes from a position within this.textBuilder.</param>
/// <param name="allSpans">The collection of spans. This is either this.boldSpans or this.highlightedSpans.</param>
private static void MoveSpanToPosition(ref int currentSpanIndex, ref TextSpan? currentSpan, int caracterPosition, List<TextSpan> allSpans)
{
if (currentSpan == null || caracterPosition <= currentSpan.Value.End)
@ -276,10 +276,10 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Adds one individual text highlight
/// This is called after all calls to AddText have been made
/// This is called after all calls to AddText have been made.
/// </summary>
/// <param name="start">highlight start</param>
/// <param name="length">highlight length</param>
/// <param name="start">Highlight start.</param>
/// <param name="length">Highlight length.</param>
private void AddHighlight(int start, int length)
{
if (start < 0)
@ -296,9 +296,9 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Called internally to notify when a proiperty changed
/// Called internally to notify when a proiperty changed.
/// </summary>
/// <param name="propertyName">property name</param>
/// <param name="propertyName">Property name.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;
@ -309,25 +309,25 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// A text span used to mark bold and highlighed segments
/// A text span used to mark bold and highlighed segments.
/// </summary>
internal struct TextSpan
{
/// <summary>
/// Index of the first character in the span
/// Index of the first character in the span.
/// </summary>
private readonly int start;
/// <summary>
/// Index of the last character in the span
/// Index of the last character in the span.
/// </summary>
private readonly int end;
/// <summary>
/// Initializes a new instance of the TextSpan struct
/// Initializes a new instance of the TextSpan struct.
/// </summary>
/// <param name="start">Index of the first character in the span</param>
/// <param name="length">Index of the last character in the span</param>
/// <param name="start">Index of the first character in the span.</param>
/// <param name="length">Index of the last character in the span.</param>
internal TextSpan(int start, int length)
{
if (start < 0)
@ -345,7 +345,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the index of the first character in the span
/// Gets the index of the first character in the span.
/// </summary>
internal int Start
{
@ -353,7 +353,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the index of the first character in the span
/// Gets the index of the first character in the span.
/// </summary>
internal int End
{
@ -364,10 +364,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Returns true if the <paramref name="position"/> is between start and end (inclusive)
/// Returns true if the <paramref name="position"/> is between start and end (inclusive).
/// </summary>
/// <param name="position">position to verify if is in the span</param>
/// <returns>true if the <paramref name="position"/> is between start and end (inclusive)</returns>
/// <param name="position">Position to verify if is in the span.</param>
/// <returns>True if the <paramref name="position"/> is between start and end (inclusive).</returns>
internal bool Contains(int position)
{
return (position >= this.start) && (position <= this.end);

View file

@ -9,38 +9,38 @@ namespace Microsoft.Management.UI.Internal
{
/// <summary>
/// Moves through search highlights built in a ParagraphBuilder
/// changing the color of the current highlight
/// changing the color of the current highlight.
/// </summary>
internal class ParagraphSearcher
{
/// <summary>
/// Highlight for all matches except the current
/// Highlight for all matches except the current.
/// </summary>
internal static readonly Brush HighlightBrush = Brushes.Yellow;
/// <summary>
/// Highlight for the current match
/// Highlight for the current match.
/// </summary>
private static readonly Brush CurrentHighlightBrush = Brushes.Cyan;
/// <summary>
/// Current match being highlighted in search
/// Current match being highlighted in search.
/// </summary>
private Run currentHighlightedMatch;
/// <summary>
/// Initializes a new instance of the ParagraphSearcher class
/// Initializes a new instance of the ParagraphSearcher class.
/// </summary>
internal ParagraphSearcher()
{
}
/// <summary>
/// Move to the next highlight starting at the <paramref name="caretPosition"/>
/// Move to the next highlight starting at the <paramref name="caretPosition"/>.
/// </summary>
/// <param name="forward">true for next false for previous</param>
/// <param name="caretPosition">caret position</param>
/// <returns>the next highlight starting at the <paramref name="caretPosition"/></returns>
/// <param name="forward">True for next false for previous.</param>
/// <param name="caretPosition">Caret position.</param>
/// <returns>The next highlight starting at the <paramref name="caretPosition"/>.</returns>
internal Run MoveAndHighlightNextNextMatch(bool forward, TextPointer caretPosition)
{
Debug.Assert(caretPosition != null, "a caret position is allways valid");
@ -94,7 +94,7 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Resets the search for fresh calls to MoveAndHighlightNextNextMatch
/// Resets the search for fresh calls to MoveAndHighlightNextNextMatch.
/// </summary>
internal void ResetSearch()
{
@ -102,10 +102,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Returns true if <paramref name="run"/> is highlighted
/// Returns true if <paramref name="run"/> is highlighted.
/// </summary>
/// <param name="run">run to check if is highlighted</param>
/// <returns>true if <paramref name="run"/> is highlighted</returns>
/// <param name="run">Run to check if is highlighted.</param>
/// <returns>True if <paramref name="run"/> is highlighted.</returns>
private static bool Ishighlighted(Run run)
{
if (run == null)
@ -123,11 +123,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Get the next or previous run according to <paramref name="forward"/>
/// Get the next or previous run according to <paramref name="forward"/>.
/// </summary>
/// <param name="currentRun">the current run</param>
/// <param name="forward">true for next false for previous</param>
/// <returns>the next or previous run according to <paramref name="forward"/></returns>
/// <param name="currentRun">The current run.</param>
/// <param name="forward">True for next false for previous.</param>
/// <returns>The next or previous run according to <paramref name="forward"/>.</returns>
private static Run GetNextRun(Run currentRun, bool forward)
{
Bold parentBold = currentRun.Parent as Bold;
@ -148,10 +148,10 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Gets the run of an inline. Inlines in a ParagrahBuilder are either a Run or a Bold
/// which contains a Run
/// which contains a Run.
/// </summary>
/// <param name="inline">inline to get the run from</param>
/// <returns>the run of the inline</returns>
/// <param name="inline">Inline to get the run from.</param>
/// <returns>The run of the inline.</returns>
private static Run GetRun(Inline inline)
{
Bold inlineBold = inline as Bold;
@ -165,13 +165,13 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Gets the next highlighted run starting and including <paramref name="currentRun"/>
/// according to the direction specified in <paramref name="forward"/>
/// according to the direction specified in <paramref name="forward"/>.
/// </summary>
/// <param name="currentRun">the current run</param>
/// <param name="forward">true for next false for previous</param>
/// <param name="currentRun">The current run.</param>
/// <param name="forward">True for next false for previous.</param>
/// <returns>
/// the next highlighted run starting and including <paramref name="currentRun"/>
/// according to the direction specified in <paramref name="forward"/>
/// according to the direction specified in <paramref name="forward"/>.
/// </returns>
private static Run GetNextMatch(Run currentRun, bool forward)
{
@ -189,10 +189,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the run's paragraph
/// Gets the run's paragraph.
/// </summary>
/// <param name="run">run to get the paragraph from</param>
/// <returns>the run's paragraph</returns>
/// <param name="run">Run to get the paragraph from.</param>
/// <returns>The run's paragraph.</returns>
private static Paragraph GetParagraph(Run run)
{
Bold parentBold = run.Parent as Bold;
@ -202,10 +202,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Returns true if the run is the fiorst run of the paragraph
/// Returns true if the run is the fiorst run of the paragraph.
/// </summary>
/// <param name="run">run to check</param>
/// <returns>true if the run is the fiorst run of the paragraph</returns>
/// <param name="run">Run to check.</param>
/// <returns>True if the run is the fiorst run of the paragraph.</returns>
private static bool IsFirstRun(Run run)
{
Paragraph paragraph = GetParagraph(run);
@ -214,11 +214,11 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Gets the first or lasr run in the paragraph containing <paramref name="caretRun"/>
/// Gets the first or lasr run in the paragraph containing <paramref name="caretRun"/>.
/// </summary>
/// <param name="caretRun">run containing the caret</param>
/// <param name="forward">true for first false for last</param>
/// <returns>the first or last run in the paragraph containing <paramref name="caretRun"/></returns>
/// <param name="caretRun">Run containing the caret.</param>
/// <param name="forward">True for first false for last.</param>
/// <returns>The first or last run in the paragraph containing <paramref name="caretRun"/>.</returns>
private static Run GetFirstOrLastRun(Run caretRun, bool forward)
{
Debug.Assert(caretRun != null, "a caret run is allways valid");

View file

@ -7,12 +7,12 @@ namespace Microsoft.Management.UI
using Microsoft.Management.UI.Internal;
/// <summary>
/// Dialog with settings for the help dialog
/// Dialog with settings for the help dialog.
/// </summary>
public partial class SettingsDialog : Window
{
/// <summary>
/// Initializes a new instance of the SettingsDialog class
/// Initializes a new instance of the SettingsDialog class.
/// </summary>
public SettingsDialog()
{
@ -32,10 +32,10 @@ namespace Microsoft.Management.UI
}
/// <summary>
/// Called when the OK button has been clicked
/// Called when the OK button has been clicked.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void OK_Click(object sender, RoutedEventArgs e)
{
HelpWindowSettings.Default.HelpDescriptionDisplayed = this.Description.IsChecked == true;

View file

@ -11,7 +11,7 @@ namespace Microsoft.Management.UI.Internal
/// The CustomTypeComparer is responsible for holding custom comparers
/// for different types, which are in turn used to perform comparison
/// operations instead of the default IComparable comparison.
/// with a custom comparer
/// with a custom comparer.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
public static class CustomTypeComparer

View file

@ -29,7 +29,7 @@ namespace Microsoft.Management.UI.Internal
///
/// If a custom template is provided for this control, then the template MUST provide the following template parts:
///
/// PART_Picker - A required template part which must be of type PickerBase. This control provides basic functionality for Picker-like controls.
/// PART_Picker - A required template part which must be of type PickerBase. This control provides basic functionality for Picker-like controls.
///
/// </remarks>
[TemplatePart(Name="PART_Picker", Type=typeof(PickerBase))]

View file

@ -28,10 +28,10 @@ namespace Microsoft.Management.UI.Internal
///
/// If a custom template is provided for this control, then the template MUST provide the following template parts:
///
/// PART_DeleteButton - A required template part which must be of type Button. Button which keeps track of whether the row should be deleted.
/// PART_EditBox - A required template part which must be of type TextBox. Displays the text content in an editable manner.
/// PART_LinkButton - A required template part which must be of type Button. Displays the text content in a read-only manner and allows single click selection.
/// PART_RenameButton - A required template part which must be of type ToggleButton. Button which allows for editing the name of the item.
/// PART_DeleteButton - A required template part which must be of type Button. Button which keeps track of whether the row should be deleted.
/// PART_EditBox - A required template part which must be of type TextBox. Displays the text content in an editable manner.
/// PART_LinkButton - A required template part which must be of type Button. Displays the text content in a read-only manner and allows single click selection.
/// PART_RenameButton - A required template part which must be of type ToggleButton. Button which allows for editing the name of the item.
///
/// </remarks>
[TemplatePart(Name="PART_DeleteButton", Type=typeof(Button))]

View file

@ -20,8 +20,8 @@ namespace Microsoft.Management.UI.Internal
///
/// If a custom template is provided for this control, then the template MUST provide the following template parts:
///
/// PART_DropDown - A required template part which must be of type DismissiblePopup. The dropdown which hosts the picker.
/// PART_DropDownButton - A required template part which must be of type ToggleButton. The ToggleButton which controls whether the dropdown is open.
/// PART_DropDown - A required template part which must be of type DismissiblePopup. The dropdown which hosts the picker.
/// PART_DropDownButton - A required template part which must be of type ToggleButton. The ToggleButton which controls whether the dropdown is open.
///
/// </remarks>
[TemplatePart(Name="PART_DropDown", Type=typeof(DismissiblePopup))]

View file

@ -79,7 +79,7 @@ namespace Microsoft.Management.UI.Internal
/// Make this control to respect the ClipToBounds attribute value.
/// </summary>
/// <param name="layoutSlotSize">An instance of <see cref="System.Windows.Size"/> used for calculating an additional clip.</param>
/// <returns>Geometry to use as an additional clip in case when element is larger than available space</returns>
/// <returns>Geometry to use as an additional clip in case when element is larger than available space.</returns>
protected override Geometry GetLayoutClip(Size layoutSlotSize)
{
return ClipToBounds ? base.GetLayoutClip(layoutSlotSize) : null;

View file

@ -29,7 +29,7 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Trims excess whitespace from the given string.
/// </summary>
/// <param name="value">original string</param>
/// <param name="value">Original string.</param>
/// <param name="targetType">The parameter is not used.</param>
/// <param name="parameter">The parameter is not used.</param>
/// <param name="culture">The parameter is not used.</param>
@ -53,7 +53,7 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Trims extra whitespace from the given string during backward conversion.
/// </summary>
/// <param name="value">original string</param>
/// <param name="value">Original string.</param>
/// <param name="targetType">The parameter is not used.</param>
/// <param name="parameter">The parameter is not used.</param>
/// <param name="culture">The parameter is not used.</param>

View file

@ -19,8 +19,8 @@ namespace Microsoft.Management.UI.Internal
///
/// If a custom template is provided for this control, then the template MUST provide the following template parts:
///
/// PART_LeftGrip - A required template part which must be of type Thumb. The grip on the left.
/// PART_RightGrip - A required template part which must be of type Thumb. The grip on the right.
/// PART_LeftGrip - A required template part which must be of type Thumb. The grip on the left.
/// PART_RightGrip - A required template part which must be of type Thumb. The grip on the right.
///
/// </remarks>
[TemplatePart(Name="PART_LeftGrip", Type=typeof(Thumb))]

View file

@ -31,7 +31,7 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Overrides Visual.GetVisualChild, and returns a child at the specified index from a collection of child elements.
/// </summary>
/// <param name="index">The zero-based index of the requested child element in the collection. </param>
/// <param name="index">The zero-based index of the requested child element in the collection..</param>
/// <returns>The requested child element. This should not return null; if the provided index is out of range, an exception is thrown.</returns>
protected override Visual GetVisualChild(int index)
{
@ -52,7 +52,7 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Implements any custom measuring behavior for the popupAdorner.
/// </summary>
/// <param name="constraint">A size to constrain the popupAdorner to. </param>
/// <param name="constraint">A size to constrain the popupAdorner to..</param>
/// <returns>A Size object representing the amount of layout space needed by the popupAdorner.</returns>
protected override Size MeasureOverride(Size constraint)
{

View file

@ -34,7 +34,7 @@ namespace Microsoft.Management.UI.Internal
#region internal fields
#region StyleCop Suppression - generated code
/// <summary>
/// The current ICollectionView being displayed
/// The current ICollectionView being displayed.
/// </summary>
internal ICollectionView CollectionView;

View file

@ -142,7 +142,7 @@ namespace Microsoft.Management.UI.Internal
/// </summary>
/// <param name="subject">Target ManagementList.</param>
/// <param name="callback">RetryActionAfterLoaded callback method.</param>
/// <returns>true iff columns restorable</returns>
/// <returns>True iff columns restorable.</returns>
/// <exception cref="InvalidOperationException">
/// ManagementList.AutoGenerateColumns not supported.
/// </exception>

View file

@ -8,14 +8,14 @@ using System.Windows.Controls;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Interaction logic for AllModulesControl.xaml
/// Interaction logic for AllModulesControl.xaml.
/// </summary>
public partial class AllModulesControl : UserControl
{
#region Construction and Destructor
/// <summary>
/// Initializes a new instance of the AllModulesControl class
/// Initializes a new instance of the AllModulesControl class.
/// </summary>
public AllModulesControl()
{
@ -29,7 +29,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#endregion
/// <summary>
/// Gets current control of the ShowModuleControl
/// Gets current control of the ShowModuleControl.
/// </summary>
internal ShowModuleControl CurrentShowModuleControl
{

View file

@ -7,7 +7,7 @@ using System.Windows.Controls;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Interaction logic for CmdletControl.xaml
/// Interaction logic for CmdletControl.xaml.
/// </summary>
public partial class CmdletControl : UserControl
{
@ -18,7 +18,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region Construction and Destructor
/// <summary>
/// Initializes a new instance of the CmdletControl class
/// Initializes a new instance of the CmdletControl class.
/// </summary>
public CmdletControl()
{
@ -45,8 +45,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// DataContextChanged event.
/// </summary>
/// <param name="sender">Event sender</param>
/// <param name="e">Event args</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event args.</param>
private void ParameterSetTabControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (this.DataContext == null)
@ -68,8 +68,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Key down event for user press F1 button.
/// </summary>
/// <param name="sender">Event sender</param>
/// <param name="e">Event args</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event args.</param>
private void CmdletControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.F1)
@ -81,18 +81,18 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Help button event.
/// </summary>
/// <param name="sender">Event sender</param>
/// <param name="e">Event args</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event args.</param>
private void HelpButton_Click(object sender, RoutedEventArgs e)
{
this.CurrentCommandViewModel.OpenHelpWindow();
}
/// <summary>
/// Import Module Button event
/// Import Module Button event.
/// </summary>
/// <param name="sender">Event sender</param>
/// <param name="e">Event args</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event args.</param>
private void ImportModuleButton_Click(object sender, RoutedEventArgs e)
{
this.CurrentCommandViewModel.OnImportModule();

View file

@ -9,7 +9,7 @@ using System.Windows.Controls;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Button with images to represent enabled and disabled states
/// Button with images to represent enabled and disabled states.
/// </summary>
[SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes", Justification = "Required by XAML")]
public partial class ImageButton : ImageButtonBase
@ -24,10 +24,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Copies the automation id and name from the parent control to the inner button
/// Copies the automation id and name from the parent control to the inner button.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ImageButton_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
object thisAutomationId = this.GetValue(AutomationProperties.AutomationIdProperty);

View file

@ -17,25 +17,25 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
public class ImageButtonBase : Grid
{
/// <summary>
/// Command associated with this button
/// Command associated with this button.
/// </summary>
public static readonly DependencyProperty CommandProperty =
DependencyProperty.Register("Command", typeof(RoutedUICommand), typeof(ImageButton));
/// <summary>
/// Image to be used for the enabled state
/// Image to be used for the enabled state.
/// </summary>
public static readonly DependencyProperty EnabledImageSourceProperty =
DependencyProperty.Register("EnabledImageSource", typeof(ImageSource), typeof(ImageButton));
/// <summary>
/// Image to be used for the disabled state
/// Image to be used for the disabled state.
/// </summary>
public static readonly DependencyProperty DisabledImageSourceProperty =
DependencyProperty.Register("DisabledImageSource", typeof(ImageSource), typeof(ImageButton));
/// <summary>
/// Gets or sets the image to be used for the enabled state
/// Gets or sets the image to be used for the enabled state.
/// </summary>
public ImageSource EnabledImageSource
{
@ -44,7 +44,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets the image to be used for the disabled state
/// Gets or sets the image to be used for the disabled state.
/// </summary>
public ImageSource DisabledImageSource
{
@ -53,7 +53,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets the command associated with this button
/// Gets or sets the command associated with this button.
/// </summary>
public RoutedUICommand Command
{

View file

@ -9,7 +9,7 @@ using System.Windows.Data;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Converts a an ImageButtonBase to its corresponding ToolTip
/// Converts a an ImageButtonBase to its corresponding ToolTip.
/// </summary>
[SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes", Justification = "Needed for XAML")]
public class ImageButtonToolTipConverter : IValueConverter
@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <param name="targetType"><paramref name="targetType"/> is not used.</param>
/// <param name="parameter"><paramref name="parameter"/> is not used.</param>
/// <param name="culture"><paramref name="culture"/> is not used.</param>
/// <returns>The resulting object obtained from retrieving the property value in <paramref name="parameter"/> (or property values if <paramref name="parameter"/> contains dots) out of <paramref name="value"/>. </returns>
/// <returns>The resulting object obtained from retrieving the property value in <paramref name="parameter"/> (or property values if <paramref name="parameter"/> contains dots) out of <paramref name="value"/>. .</returns>
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
ImageButtonBase imageButtonBase = value as ImageButtonBase;

View file

@ -8,13 +8,13 @@ using System.Windows.Automation;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Toggle button with images to represent enabled and disabled states
/// Toggle button with images to represent enabled and disabled states.
/// </summary>
[SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes", Justification = "Required by XAML")]
public partial class ImageToggleButton : ImageButtonBase
{
/// <summary>
/// Value indicating the button is checked
/// Value indicating the button is checked.
/// </summary>
public static readonly DependencyProperty IsCheckedProperty =
DependencyProperty.Register("IsChecked", typeof(bool), typeof(ImageToggleButton));
@ -29,7 +29,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets a value indicating whether the button is checked
/// Gets or sets a value indicating whether the button is checked.
/// </summary>
public bool IsChecked
{
@ -38,10 +38,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Copies the automation id and name from the parent control to the inner button
/// Copies the automation id and name from the parent control to the inner button.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ImageButton_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
object thisAutomationId = this.GetValue(AutomationProperties.AutomationIdProperty);

View file

@ -10,12 +10,12 @@ using System.Windows.Controls;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Interaction logic for MultipleSelectionControl.xaml
/// Interaction logic for MultipleSelectionControl.xaml.
/// </summary>
public partial class MultipleSelectionControl : UserControl
{
/// <summary>
/// Initializes a new instance of the MultipleSelectionControl class
/// Initializes a new instance of the MultipleSelectionControl class.
/// </summary>
public MultipleSelectionControl()
{
@ -23,10 +23,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Show more items in new dialog
/// Show more items in new dialog.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ButtonBrowse_Click(object sender, RoutedEventArgs e)
{
MultipleSelectionDialog multipleSelectionDialog = new MultipleSelectionDialog();

View file

@ -6,14 +6,14 @@ using System.Windows.Controls;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Interaction logic for NotImportedCmdletControl.xaml
/// Interaction logic for NotImportedCmdletControl.xaml.
/// </summary>
public partial class NotImportedCmdletControl : UserControl
{
#region Construction and Destructor
/// <summary>
/// Initializes a new instance of the NotImportedCmdletControl class
/// Initializes a new instance of the NotImportedCmdletControl class.
/// </summary>
public NotImportedCmdletControl()
{

View file

@ -17,7 +17,7 @@ using Microsoft.PowerShell.Commands.ShowCommandExtension;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Interaction logic for ParameterSetControl.xaml
/// Interaction logic for ParameterSetControl.xaml.
/// </summary>
public partial class ParameterSetControl : UserControl
{
@ -33,7 +33,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region Construction and Destructor
/// <summary>
/// Initializes a new instance of the ParameterSetControl class
/// Initializes a new instance of the ParameterSetControl class.
/// </summary>
public ParameterSetControl()
{
@ -69,11 +69,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#endregion
/// <summary>
/// Creates a CheckBox for switch parameters
/// Creates a CheckBox for switch parameters.
/// </summary>
/// <param name="parameterViewModel">DataContext object</param>
/// <param name="rowNumber">Row number</param>
/// <returns>a CheckBox for switch parameters</returns>
/// <param name="parameterViewModel">DataContext object.</param>
/// <param name="rowNumber">Row number.</param>
/// <returns>a CheckBox for switch parameters.</returns>
private static CheckBox CreateCheckBox(ParameterViewModel parameterViewModel, int rowNumber)
{
CheckBox checkBox = new CheckBox();
@ -104,12 +104,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Creates a ComboBox control for input type field
/// Creates a ComboBox control for input type field.
/// </summary>
/// <param name="parameterViewModel">DataContext object</param>
/// <param name="rowNumber">Row number</param>
/// <param name="itemsSource">Control data source</param>
/// <returns>Return a ComboBox control</returns>
/// <param name="parameterViewModel">DataContext object.</param>
/// <param name="rowNumber">Row number.</param>
/// <param name="itemsSource">Control data source.</param>
/// <returns>Return a ComboBox control.</returns>
private static ComboBox CreateComboBoxControl(ParameterViewModel parameterViewModel, int rowNumber, IEnumerable itemsSource)
{
ComboBox comboBox = new ComboBox();
@ -142,12 +142,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Creates a MultiSelectCombo control for input type field
/// Creates a MultiSelectCombo control for input type field.
/// </summary>
/// <param name="parameterViewModel">DataContext object</param>
/// <param name="rowNumber">Row number</param>
/// <param name="itemsSource">Control data source</param>
/// <returns>Return a MultiSelectCombo control</returns>
/// <param name="parameterViewModel">DataContext object.</param>
/// <param name="rowNumber">Row number.</param>
/// <param name="itemsSource">Control data source.</param>
/// <returns>Return a MultiSelectCombo control.</returns>
private static MultipleSelectionControl CreateMultiSelectComboControl(ParameterViewModel parameterViewModel, int rowNumber, IEnumerable itemsSource)
{
MultipleSelectionControl multiControls = new MultipleSelectionControl();
@ -184,11 +184,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Creates a TextBox control for input type field
/// Creates a TextBox control for input type field.
/// </summary>
/// <param name="parameterViewModel">DataContext object</param>
/// <param name="rowNumber">Row number</param>
/// <returns>Return a TextBox control</returns>
/// <param name="parameterViewModel">DataContext object.</param>
/// <param name="rowNumber">Row number.</param>
/// <returns>Return a TextBox control.</returns>
private static TextBox CreateTextBoxControl(ParameterViewModel parameterViewModel, int rowNumber)
{
TextBox textBox = new TextBox();
@ -231,10 +231,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Called for a newly created multiline text box to increase its height and
/// Called for a newly created multiline text box to increase its height and.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private static void MultiLineTextBox_Loaded(object sender, RoutedEventArgs e)
{
TextBox senderTextBox = (TextBox)sender;
@ -251,8 +251,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// When user switch ParameterSet.It will trigger this event.
/// This event method will renew generate all controls for current ParameterSet.
/// </summary>
/// <param name="sender">Event sender</param>
/// <param name="e">Event args</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event args.</param>
private void ParameterSetControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
this.firstFocusableElement = null;
@ -328,8 +328,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// When user trigger click on anyone CheckBox. Get value from sender.
/// </summary>
/// <param name="sender">Event sender</param>
/// <param name="e">Event args</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event args.</param>
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
CheckBox senderCheck = (CheckBox)sender;
@ -341,9 +341,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region Private Method
/// <summary>
/// Creates a RowDefinition for MainGrid
/// Creates a RowDefinition for MainGrid.
/// </summary>
/// <returns>Return a RowDefinition object</returns>
/// <returns>Return a RowDefinition object.</returns>
private RowDefinition CreateNewRow()
{
RowDefinition row = new RowDefinition();
@ -352,9 +352,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Adds a control to MainGrid;
/// Adds a control to MainGrid;.
/// </summary>
/// <param name="uiControl">Will adding UIControl</param>
/// <param name="uiControl">Will adding UIControl.</param>
private void AddControlToMainGrid(UIElement uiControl)
{
if (this.firstFocusableElement == null && !(uiControl is Label))
@ -366,10 +366,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Creates a Lable control and add it to MainGrid
/// Creates a Lable control and add it to MainGrid.
/// </summary>
/// <param name="parameterViewModel">DataContext object</param>
/// <param name="rowNumber">Row number</param>
/// <param name="parameterViewModel">DataContext object.</param>
/// <param name="rowNumber">Row number.</param>
private void CreateAndAddLabel(ParameterViewModel parameterViewModel, int rowNumber)
{
Label label = this.CreateLabel(parameterViewModel, rowNumber);
@ -377,11 +377,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Creates a Label control for input type field
/// Creates a Label control for input type field.
/// </summary>
/// <param name="parameterViewModel">DataContext object</param>
/// <param name="rowNumber">Row number</param>
/// <returns>Return a Label control</returns>
/// <param name="parameterViewModel">DataContext object.</param>
/// <param name="rowNumber">Row number.</param>
/// <returns>Return a Label control.</returns>
private Label CreateLabel(ParameterViewModel parameterViewModel, int rowNumber)
{
Label label = new Label();

View file

@ -9,7 +9,7 @@ using System.Windows.Input;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Control taht shows cmdlets in a module and details for a selected cmdlet
/// Control taht shows cmdlets in a module and details for a selected cmdlet.
/// </summary>
public partial class ShowModuleControl : UserControl
{
@ -19,7 +19,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
private Window owner;
/// <summary>
/// Initializes a new instance of the ShowModuleControl class
/// Initializes a new instance of the ShowModuleControl class.
/// </summary>
public ShowModuleControl()
{
@ -56,8 +56,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// WPF sets up this behavior by using a mouse capture. We undo the behavior in the handler below
/// which removes the behavior.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void CommandList_PreviewMouseMove(object sender, MouseEventArgs e)
{
if (this.CommandList.IsMouseCaptured)
@ -70,8 +70,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// Ensures the selected item is scrolled into view and that the list is focused.
/// An item could be out of the view if the selection was changed in the object model
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void CommandList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (this.CommandList.SelectedItem == null)

View file

@ -21,17 +21,17 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
#region Private Fields
/// <summary>
/// Flag indicating a wait message is being displayed
/// Flag indicating a wait message is being displayed.
/// </summary>
private bool waitMessageDisplayed;
/// <summary>
/// True if this ViewModel is not supposed to show common parameters
/// True if this ViewModel is not supposed to show common parameters.
/// </summary>
private bool noCommonParameter;
/// <summary>
/// the filterName of command
/// the filterName of command.
/// </summary>
private string commandNameFilter;
@ -41,42 +41,42 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
private List<ModuleViewModel> modules;
/// <summary>
/// true if a command can be run
/// true if a command can be run.
/// </summary>
private bool canRun;
/// <summary>
/// true if a command can be copied
/// true if a command can be copied.
/// </summary>
private bool canCopy;
/// <summary>
/// the selected module being displayed in the GUI
/// the selected module being displayed in the GUI.
/// </summary>
private ModuleViewModel selectedModule;
/// <summary>
/// the visibility of the refresh button
/// the visibility of the refresh button.
/// </summary>
private Visibility refreshVisibility = Visibility.Collapsed;
/// <summary>
/// Provides an extra viewModel object that allows callers to control certain aspects of the GUI
/// Provides an extra viewModel object that allows callers to control certain aspects of the GUI.
/// </summary>
private object extraViewModel;
/// <summary>
/// private property for ZoomLevel
/// private property for ZoomLevel.
/// </summary>
private double zoomLevel = 1.0;
#endregion
#region Construction and Destructor
/// <summary>
/// Initializes a new instance of the AllModulesViewModel class
/// Initializes a new instance of the AllModulesViewModel class.
/// </summary>
/// <param name="importedModules">the loaded modules</param>
/// <param name="commands">commands to show</param>
/// <param name="importedModules">The loaded modules.</param>
/// <param name="commands">Commands to show.</param>
public AllModulesViewModel(Dictionary<string, ShowCommandModuleInfo> importedModules, IEnumerable<ShowCommandCommandInfo> commands)
{
if (commands == null || !commands.GetEnumerator().MoveNext())
@ -88,11 +88,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Initializes a new instance of the AllModulesViewModel class
/// Initializes a new instance of the AllModulesViewModel class.
/// </summary>
/// <param name="importedModules">the loaded modules</param>
/// <param name="commands">All PowerShell commands</param>
/// <param name="noCommonParameter">true not to show common parameters</param>
/// <param name="importedModules">The loaded modules.</param>
/// <param name="commands">All PowerShell commands.</param>
/// <param name="noCommonParameter">True not to show common parameters.</param>
public AllModulesViewModel(Dictionary<string, ShowCommandModuleInfo> importedModules, IEnumerable<ShowCommandCommandInfo> commands, bool noCommonParameter)
{
if (commands == null)
@ -107,35 +107,35 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region INotifyPropertyChanged Members
/// <summary>
/// PropertyChanged Event
/// PropertyChanged Event.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
#endregion
/// <summary>
/// Indicates the selected command in the selected module needs to display the help for a command
/// Indicates the selected command in the selected module needs to display the help for a command.
/// </summary>
public event EventHandler<HelpNeededEventArgs> SelectedCommandInSelectedModuleNeedsHelp;
/// <summary>
/// Indicates the selected command in the selected module needs to import a module for a command
/// Indicates the selected command in the selected module needs to import a module for a command.
/// </summary>
public event EventHandler<ImportModuleEventArgs> SelectedCommandInSelectedModuleNeedsImportModule;
/// <summary>
/// Indicates the selected command in the selected module should be run
/// Indicates the selected command in the selected module should be run.
/// </summary>
public event EventHandler<CommandEventArgs> RunSelectedCommandInSelectedModule;
/// <summary>
/// Indicates we want to refresh the viewModel
/// Indicates we want to refresh the viewModel.
/// </summary>
public event EventHandler<EventArgs> Refresh;
#region Public Properties
/// <summary>
/// Get or Sets Zoom level
/// Get or Sets Zoom level.
/// </summary>
public double ZoomLevel
{
@ -155,7 +155,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the tooltip for the refresh button
/// Gets the tooltip for the refresh button.
/// </summary>
public static string RefreshTooltip
{
@ -163,7 +163,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets the visibility of the refresh button
/// Gets or sets the visibility of the refresh button.
/// </summary>
public Visibility RefreshVisibility
{
@ -185,7 +185,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets a value indicating whether common parameters are displayed
/// Gets a value indicating whether common parameters are displayed.
/// </summary>
public bool NoCommonParameter
{
@ -193,7 +193,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets the filterName of command
/// Gets or sets the filterName of command.
/// </summary>
public string CommandNameFilter
{
@ -221,7 +221,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets the selected module being displayed in the GUI
/// Gets or sets the selected module being displayed in the GUI.
/// </summary>
public ModuleViewModel SelectedModule
{
@ -264,7 +264,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets a value indicating whether we can run a command
/// Gets a value indicating whether we can run a command.
/// </summary>
public bool CanRun
{
@ -275,7 +275,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets a value indicating whether we can copy a command
/// Gets a value indicating whether we can copy a command.
/// </summary>
public bool CanCopy
{
@ -294,7 +294,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the visibility of the wait message
/// Gets the visibility of the wait message.
/// </summary>
public Visibility WaitMessageVisibility
{
@ -305,7 +305,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the visibility of the main grid
/// Gets the visibility of the main grid.
/// </summary>
public Visibility MainGridVisibility
{
@ -316,7 +316,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets a value indicating whether the main grid is displayed
/// Gets a value indicating whether the main grid is displayed.
/// </summary>
public bool MainGridDisplayed
{
@ -327,7 +327,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets a value indicating whether the wait message is displayed
/// Gets or sets a value indicating whether the wait message is displayed.
/// </summary>
public bool WaitMessageDisplayed
{
@ -354,7 +354,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets an extra viewModel object that allows callers to control certain aspects of the GUI
/// Gets or sets an extra viewModel object that allows callers to control certain aspects of the GUI.
/// </summary>
public object ExtraViewModel
{
@ -377,9 +377,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#endregion
/// <summary>
/// Returns the selected script
/// Returns the selected script.
/// </summary>
/// <returns>the selected script</returns>
/// <returns>The selected script.</returns>
public string GetScript()
{
if (this.SelectedModule == null)
@ -396,7 +396,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Triggers Refresh
/// Triggers Refresh.
/// </summary>
internal void OnRefresh()
{
@ -411,7 +411,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// If current modules name is ALL, then return true.
/// </summary>
/// <param name="name">The modules name</param>
/// <param name="name">The modules name.</param>
/// <returns>Return true is the module name is ALLModulesViewModel.</returns>
private static bool IsAll(string name)
{
@ -423,8 +423,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// SetCanRun for IsThereASelectedImportedCommandWhereAllMandatoryParametersHaveValues
/// SetCanCopy for SetCanCopy
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void SelectedModule_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "IsThereASelectedImportedCommandWhereAllMandatoryParametersHaveValues")
@ -479,9 +479,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Initialize AllModulesViewModel.
/// </summary>
/// <param name="importedModules">All loaded modules</param>
/// <param name="commands">List of commands in all modules</param>
/// <param name="noCommonParameterInModel">Whether showing common parameter</param>
/// <param name="importedModules">All loaded modules.</param>
/// <param name="commands">List of commands in all modules.</param>
/// <param name="noCommonParameterInModel">Whether showing common parameter.</param>
private void Initialization(Dictionary<string, ShowCommandModuleInfo> importedModules, IEnumerable<ShowCommandCommandInfo> commands, bool noCommonParameterInModel)
{
if (commands == null)
@ -555,9 +555,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Compare two ModuleViewModel target and source.
/// </summary>
/// <param name="source">The source ModuleViewModel</param>
/// <param name="target">The target ModuleViewModel</param>
/// <returns>Compare result</returns>
/// <param name="source">The source ModuleViewModel.</param>
/// <param name="target">The target ModuleViewModel.</param>
/// <returns>Compare result.</returns>
private int Compare(ModuleViewModel source, ModuleViewModel target)
{
if (AllModulesViewModel.IsAll(source.Name) && !AllModulesViewModel.IsAll(target.Name))
@ -574,29 +574,29 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Called when the SelectedCommandNeedsHelp event is triggered in the Selected Module
/// Called when the SelectedCommandNeedsHelp event is triggered in the Selected Module.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void SelectedModule_SelectedCommandNeedsHelp(object sender, HelpNeededEventArgs e)
{
this.OnSelectedCommandInSelectedModuleNeedsHelp(e);
}
/// <summary>
/// Called when the SelectedCommandNeedsImportModule event is triggered in the Selected Module
/// Called when the SelectedCommandNeedsImportModule event is triggered in the Selected Module.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void SelectedModule_SelectedCommandNeedsImportModule(object sender, ImportModuleEventArgs e)
{
this.OnSelectedCommandInSelectedModuleNeedsImportModule(e);
}
/// <summary>
/// Triggers SelectedCommandInSelectedModuleNeedsHelp
/// Triggers SelectedCommandInSelectedModuleNeedsHelp.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
private void OnSelectedCommandInSelectedModuleNeedsHelp(HelpNeededEventArgs e)
{
EventHandler<HelpNeededEventArgs> handler = this.SelectedCommandInSelectedModuleNeedsHelp;
@ -607,9 +607,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Triggers SelectedCommandInSelectedModuleNeedsImportModule
/// Triggers SelectedCommandInSelectedModuleNeedsImportModule.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
private void OnSelectedCommandInSelectedModuleNeedsImportModule(ImportModuleEventArgs e)
{
EventHandler<ImportModuleEventArgs> handler = this.SelectedCommandInSelectedModuleNeedsImportModule;
@ -620,19 +620,19 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Called when the RunSelectedCommand is triggered in the selected module
/// Called when the RunSelectedCommand is triggered in the selected module.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void SelectedModule_RunSelectedCommand(object sender, CommandEventArgs e)
{
this.OnRunSelectedCommandInSelectedModule(e);
}
/// <summary>
/// Triggers RunSelectedCommandInSelectedModule
/// Triggers RunSelectedCommandInSelectedModule.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
private void OnRunSelectedCommandInSelectedModule(CommandEventArgs e)
{
EventHandler<CommandEventArgs> handler = this.RunSelectedCommandInSelectedModule;
@ -643,9 +643,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// If property changed will be notify
/// If property changed will be notify.
/// </summary>
/// <param name="propertyName">The changed property</param>
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;

View file

@ -6,26 +6,26 @@ using System;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Arguments for the event triggered when something happens at the cmdlet level
/// Arguments for the event triggered when something happens at the cmdlet level.
/// </summary>
public class CommandEventArgs : EventArgs
{
/// <summary>
/// the command targeted by the event
/// the command targeted by the event.
/// </summary>
private CommandViewModel command;
/// <summary>
/// Initializes a new instance of the CommandEventArgs class.
/// </summary>
/// <param name="command">the command targeted by the event</param>
/// <param name="command">The command targeted by the event.</param>
public CommandEventArgs(CommandViewModel command)
{
this.command = command;
}
/// <summary>
/// Gets the command targeted by the event
/// Gets the command targeted by the event.
/// </summary>
public CommandViewModel Command
{

View file

@ -28,22 +28,22 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
#region Private Fields
/// <summary>
/// The name of the AllParameterSets
/// The name of the AllParameterSets.
/// </summary>
private const string SharedParameterSetName = "__AllParameterSets";
/// <summary>
/// Grid length constant
/// Grid length constant.
/// </summary>
private static readonly GridLength star = new GridLength(1, GridUnitType.Star);
/// <summary>
/// The module containing this cmdlet in the gui
/// The module containing this cmdlet in the gui.
/// </summary>
private ModuleViewModel parentModule;
/// <summary>
/// The name of the default ParameterSet
/// The name of the default ParameterSet.
/// </summary>
private string defaultParameterSetName;
@ -73,28 +73,28 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
private ParameterSetViewModel comonParameters;
/// <summary>
/// The ShowCommandCommandInfo this model is based on
/// The ShowCommandCommandInfo this model is based on.
/// </summary>
private ShowCommandCommandInfo commandInfo;
/// <summary>
/// value indicating whether the selected parameter set has all mandatory parameters valid
/// value indicating whether the selected parameter set has all mandatory parameters valid.
/// </summary>
private bool selectedParameterSetAllMandatoryParametersHaveValues;
/// <summary>
/// value indicating whether the command name should be qualified by the module in GetScript
/// value indicating whether the command name should be qualified by the module in GetScript.
/// </summary>
private bool moduleQualifyCommandName;
/// <summary>
/// The height for common parameters that will depend on CommonParameterVisibility
/// The height for common parameters that will depend on CommonParameterVisibility.
/// </summary>
private GridLength commonParametersHeight;
#endregion
/// <summary>
/// Prevents a default instance of the CommandViewModel class from being created
/// Prevents a default instance of the CommandViewModel class from being created.
/// </summary>
private CommandViewModel()
{
@ -103,25 +103,25 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region INotifyPropertyChanged Members
/// <summary>
/// PropertyChanged Event
/// PropertyChanged Event.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
#endregion
/// <summary>
/// Indicates the command needs to display the help for a command
/// Indicates the command needs to display the help for a command.
/// </summary>
public event EventHandler<HelpNeededEventArgs> HelpNeeded;
/// <summary>
/// Indicates a module needs to be imported
/// Indicates a module needs to be imported.
/// </summary>
public event EventHandler<EventArgs> ImportModule;
#region Public Properties
/// <summary>
/// Gets or sets a value indicating whether the command name should be qualified by the module in GetScript
/// Gets or sets a value indicating whether the command name should be qualified by the module in GetScript.
/// </summary>
public bool ModuleQualifyCommandName
{
@ -130,7 +130,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets a value indicating whether the common parameters are expanded
/// Gets or sets a value indicating whether the common parameters are expanded.
/// </summary>
public bool AreCommonParametersExpanded
{
@ -227,7 +227,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the visibility for the single ParameterSetControl displayed when there is only 1 parameter set
/// Gets the visibility for the single ParameterSetControl displayed when there is only 1 parameter set.
/// </summary>
public Visibility SingleParameterSetControlVisibility
{
@ -251,7 +251,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets the height for common parameters that will depend on CommonParameterVisibility
/// Gets or sets the height for common parameters that will depend on CommonParameterVisibility.
/// </summary>
public GridLength CommonParametersHeight
{
@ -273,7 +273,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the visibility for the control displayed when the module is not imported
/// Gets the visibility for the control displayed when the module is not imported.
/// </summary>
public Visibility NotImportedVisibility
{
@ -284,7 +284,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the visibility for the control displayed when there are no parameters
/// Gets the visibility for the control displayed when there are no parameters.
/// </summary>
public Visibility NoParameterVisibility
{
@ -296,7 +296,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets a value indicating whether the cmdlet comes from a module which is imported
/// Gets a value indicating whether the cmdlet comes from a module which is imported.
/// </summary>
public bool IsImported
{
@ -323,7 +323,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the module path if it is not null or empty, or the name otherwise
/// Gets the module path if it is not null or empty, or the name otherwise.
/// </summary>
public string ModuleName
{
@ -350,7 +350,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets Tooltip string for the cmdlet
/// Gets Tooltip string for the cmdlet.
/// </summary>
public string ToolTip
{
@ -366,7 +366,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the message to be displayed when the cmdlet belongs to a module that is not imported
/// Gets the message to be displayed when the cmdlet belongs to a module that is not imported.
/// </summary>
public string ImportModuleMessage
{
@ -382,7 +382,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the title for the cmdlet details
/// Gets the title for the cmdlet details.
/// </summary>
public string DetailsTitle
{
@ -407,7 +407,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#endregion
/// <summary>
/// Gets a Grid length constant
/// Gets a Grid length constant.
/// </summary>
internal static GridLength Star
{
@ -417,7 +417,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Gets the builded PowerShell script.
/// </summary>
/// <returns>Return script as string</returns>
/// <returns>Return script as string.</returns>
public string GetScript()
{
StringBuilder builder = new StringBuilder();
@ -467,7 +467,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Determins whether current command name and a specifed ParameterSetName have same name.
/// </summary>
/// <param name="name">The name of ShareParameterSet</param>
/// <param name="name">The name of ShareParameterSet.</param>
/// <returns>Return true is ShareParameterSet. Else return false.</returns>
internal static bool IsSharedParameterSetName(string name)
{
@ -477,9 +477,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Creates a new CommandViewModel out the <paramref name="commandInfo"/>.
/// </summary>
/// <param name="module">Module to which the CommandViewModel will belong to</param>
/// <param name="commandInfo">Will showing command</param>
/// <param name="noCommonParameters">true to ommit displaying common parameter</param>
/// <param name="module">Module to which the CommandViewModel will belong to.</param>
/// <param name="commandInfo">Will showing command.</param>
/// <param name="noCommonParameters">True to ommit displaying common parameter.</param>
/// <exception cref="ArgumentNullException">If commandInfo is null</exception>
/// <exception cref="RuntimeException">
/// If could not create the CommandViewModel. For instance the ShowCommandCommandInfo corresponding to
@ -487,7 +487,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// are retrieved:
/// function CrashMe ([I.Am.A.Type.That.Does.Not.Exist]$name) {}
/// </exception>
/// <returns>The CommandViewModel corresponding to commandInfo</returns>
/// <returns>The CommandViewModel corresponding to commandInfo.</returns>
internal static CommandViewModel GetCommandViewModel(ModuleViewModel module, ShowCommandCommandInfo commandInfo, bool noCommonParameters)
{
if (commandInfo == null)
@ -554,7 +554,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Called to trigger the event fired when help is needed for the command
/// Called to trigger the event fired when help is needed for the command.
/// </summary>
internal void OnHelpNeeded()
{
@ -566,7 +566,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Called to trigger the event fired when a module needs to be imported
/// Called to trigger the event fired when a module needs to be imported.
/// </summary>
internal void OnImportModule()
{
@ -579,7 +579,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region Private Methods
/// <summary>
/// Called to set the height for common parameters initially or when the AreCommonParametersExpanded changes
/// Called to set the height for common parameters initially or when the AreCommonParametersExpanded changes.
/// </summary>
private void SetCommonParametersHeight()
{
@ -587,11 +587,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Compares source and target by being the default parameter set and then by name
/// Compares source and target by being the default parameter set and then by name.
/// </summary>
/// <param name="source">source paremeterset</param>
/// <param name="target">target parameterset</param>
/// <returns>0 if they are the same, -1 if source is smaller, 1 if source is larger</returns>
/// <param name="source">Source paremeterset.</param>
/// <param name="target">Target parameterset.</param>
/// <returns>0 if they are the same, -1 if source is smaller, 1 if source is larger.</returns>
private int Compare(ParameterSetViewModel source, ParameterSetViewModel target)
{
if (this.defaultParameterSetName != null)
@ -616,9 +616,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// If property changed will be notify
/// If property changed will be notify.
/// </summary>
/// <param name="propertyName">The changed property</param>
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;
@ -629,10 +629,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Called when the PropertyChanged event is triggered on the SelectedParameterSet
/// Called when the PropertyChanged event is triggered on the SelectedParameterSet.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void SelectedParameterSet_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (!e.PropertyName.Equals("AllMandatoryParametersHaveValues"))

View file

@ -6,26 +6,26 @@ using System;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Arguments for the event triggered when it is necessary to display help for a command
/// Arguments for the event triggered when it is necessary to display help for a command.
/// </summary>
public class HelpNeededEventArgs : EventArgs
{
/// <summary>
/// the name for the command needing help
/// the name for the command needing help.
/// </summary>
private string commandName;
/// <summary>
/// Initializes a new instance of the HelpNeededEventArgs class.
/// </summary>
/// <param name="commandName">the name for the command needing help</param>
/// <param name="commandName">The name for the command needing help.</param>
public HelpNeededEventArgs(string commandName)
{
this.commandName = commandName;
}
/// <summary>
/// Gets the name for the command needing help
/// Gets the name for the command needing help.
/// </summary>
public string CommandName
{

View file

@ -6,17 +6,17 @@ using System;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Arguments for the event triggered when it is necessary to display help for a command
/// Arguments for the event triggered when it is necessary to display help for a command.
/// </summary>
public class ImportModuleEventArgs : EventArgs
{
/// <summary>
/// the name for the command belonging to the module to be imported
/// the name for the command belonging to the module to be imported.
/// </summary>
private string commandName;
/// <summary>
/// the module path or name for the module we want to import
/// the module path or name for the module we want to import.
/// </summary>
private string parentModuleName;
@ -29,8 +29,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Initializes a new instance of the ImportModuleEventArgs class.
/// </summary>
/// <param name="commandName">the name for the command needing help</param>
/// <param name="parentModuleName">the name of the module containing the command</param>
/// <param name="commandName">The name for the command needing help.</param>
/// <param name="parentModuleName">The name of the module containing the command.</param>
/// <param name="selectedModuleName">
/// the name of the module that is selected, which can be different from parentModuleName
/// if "All" is selected
@ -43,7 +43,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the name for the command belonging to the module to be imported
/// Gets the name for the command belonging to the module to be imported.
/// </summary>
public string CommandName
{
@ -51,7 +51,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the module path or name for the module we want to import
/// Gets the module path or name for the module we want to import.
/// </summary>
public string ParentModuleName
{

View file

@ -19,7 +19,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
public class ModuleViewModel : INotifyPropertyChanged
{
/// <summary>
/// True if the module is imported
/// True if the module is imported.
/// </summary>
private bool isModuleImported;
@ -29,12 +29,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
private string name;
/// <summary>
/// Filter commands property of this module
/// Filter commands property of this module.
/// </summary>
private ObservableCollection<CommandViewModel> filteredCommands;
/// <summary>
/// The selected command property of this module
/// The selected command property of this module.
/// </summary>
private CommandViewModel selectedCommand;
@ -50,12 +50,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
private bool isThereASelectedImportedCommandWhereAllMandatoryParametersHaveValues;
/// <summary>
/// value indicating whether there is a selected command
/// value indicating whether there is a selected command.
/// </summary>
private bool isThereASelectedCommand;
/// <summary>
/// The AllModulesViewModel containing this, if any
/// The AllModulesViewModel containing this, if any.
/// </summary>
private AllModulesViewModel allModules;
@ -63,8 +63,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Initializes a new instance of the ModuleViewModel class.
/// </summary>
/// <param name="name">Module name</param>
/// <param name="importedModules">All loaded modules</param>
/// <param name="name">Module name.</param>
/// <param name="importedModules">All loaded modules.</param>
public ModuleViewModel(string name, Dictionary<string, ShowCommandModuleInfo> importedModules)
{
if (name == null)
@ -92,29 +92,29 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region INotifyPropertyChanged Members
/// <summary>
/// PropertyChanged Event
/// PropertyChanged Event.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
#endregion
/// <summary>
/// Indicates the selected command in needs to display the help for a command
/// Indicates the selected command in needs to display the help for a command.
/// </summary>
public event EventHandler<HelpNeededEventArgs> SelectedCommandNeedsHelp;
/// <summary>
/// Indicates the selected command needs to import a module
/// Indicates the selected command needs to import a module.
/// </summary>
public event EventHandler<ImportModuleEventArgs> SelectedCommandNeedsImportModule;
/// <summary>
/// Indicates the selected command should be run
/// Indicates the selected command should be run.
/// </summary>
public event EventHandler<CommandEventArgs> RunSelectedCommand;
#region Public Property
/// <summary>
/// Gets the name property of this ModuleView
/// Gets the name property of this ModuleView.
/// </summary>
public string Name
{
@ -122,7 +122,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the GUI friendly module name
/// Gets the GUI friendly module name.
/// </summary>
public string DisplayName
{
@ -138,7 +138,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets CommandControl is visibility or not
/// Gets CommandControl is visibility or not.
/// </summary>
public Visibility CommandControlVisibility
{
@ -146,7 +146,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets CommandControl Height
/// Gets CommandControl Height.
/// </summary>
public GridLength CommandRowHeight
{
@ -154,7 +154,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the commands under in this module
/// Gets the commands under in this module.
/// </summary>
public List<CommandViewModel> Commands
{
@ -162,7 +162,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the filter commands of this module
/// Gets the filter commands of this module.
/// </summary>
public ObservableCollection<CommandViewModel> FilteredCommands
{
@ -170,7 +170,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets the selected commands of this module
/// Gets or sets the selected commands of this module.
/// </summary>
public CommandViewModel SelectedCommand
{
@ -216,7 +216,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets a value indicating whether there is a selected command
/// Gets or sets a value indicating whether there is a selected command.
/// </summary>
public bool IsThereASelectedCommand
{
@ -263,7 +263,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the AllModulesViewModel containing this, if any
/// Gets the AllModulesViewModel containing this, if any.
/// </summary>
public AllModulesViewModel AllModules
{
@ -275,7 +275,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#endregion
/// <summary>
/// Gets a value indicating whether the module is imported
/// Gets a value indicating whether the module is imported.
/// </summary>
internal bool IsModuleImported
{
@ -286,18 +286,18 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Sets the AllModulesViewModel containing this
/// Sets the AllModulesViewModel containing this.
/// </summary>
/// <param name="parentAllModules">the AllModulesViewModel containing this</param>
/// <param name="parentAllModules">The AllModulesViewModel containing this.</param>
internal void SetAllModules(AllModulesViewModel parentAllModules)
{
this.allModules = parentAllModules;
}
/// <summary>
/// Sorts commands and optionally sets ModuleQualifyCommandName
/// Sorts commands and optionally sets ModuleQualifyCommandName.
/// </summary>
/// <param name="markRepeatedCmdlets">true to mark repeated commands with a flag that will produce a module qualified name in GetScript</param>
/// <param name="markRepeatedCmdlets">True to mark repeated commands with a flag that will produce a module qualified name in GetScript.</param>
internal void SortCommands(bool markRepeatedCmdlets)
{
this.commands.Sort(this.Compare);
@ -324,9 +324,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// According commandNameFilter to filter command,and added the filter commands into filteredCommands property
/// According commandNameFilter to filter command,and added the filter commands into filteredCommands property.
/// </summary>
/// <param name="filter">current filter</param>
/// <param name="filter">Current filter.</param>
internal void RefreshFilteredCommands(string filter)
{
this.filteredCommands.Clear();
@ -373,7 +373,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Callled in response to a GUI event that requires the command to be run
/// Callled in response to a GUI event that requires the command to be run.
/// </summary>
internal void OnRunSelectedCommand()
{
@ -385,9 +385,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Triggers the SelectedCommandNeedsHelp event
/// Triggers the SelectedCommandNeedsHelp event.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
internal void OnSelectedCommandNeedsHelp(HelpNeededEventArgs e)
{
EventHandler<HelpNeededEventArgs> handler = this.SelectedCommandNeedsHelp;
@ -398,7 +398,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Triggers the SelectedCommandNeedsImportModule event
/// Triggers the SelectedCommandNeedsImportModule event.
/// </summary>
internal void OnSelectedCommandNeedsImportModule()
{
@ -411,12 +411,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region Private Method
/// <summary>
/// Uses pattern matching if pattern is not null or calls MatchesEvenIfInPlural otherwise
/// Uses pattern matching if pattern is not null or calls MatchesEvenIfInPlural otherwise.
/// </summary>
/// <param name="filterPattern">pattern corresponding to filter</param>
/// <param name="commandName">command name string</param>
/// <param name="filter">filter string</param>
/// <returns>true if coparisonText matches str or pattern</returns>
/// <param name="filterPattern">Pattern corresponding to filter.</param>
/// <param name="commandName">Command name string.</param>
/// <param name="filter">Filter string.</param>
/// <returns>True if coparisonText matches str or pattern.</returns>
private static bool Matches(WildcardPattern filterPattern, string commandName, string filter)
{
if (filterPattern != null)
@ -428,11 +428,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Returns true if filter matches commandName, even when filter is in the plural
/// Returns true if filter matches commandName, even when filter is in the plural.
/// </summary>
/// <param name="commandName">command name string</param>
/// <param name="filter">filter string</param>
/// <returns>return match result</returns>
/// <param name="commandName">Command name string.</param>
/// <param name="filter">Filter string.</param>
/// <returns>Return match result.</returns>
private static bool MatchesEvenIfInPlural(string commandName, string filter)
{
if (commandName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) != -1)
@ -456,30 +456,30 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Handles the HelpNeeded event in the selected command and triggers the SelectedCommandNeedsHelp event
/// Handles the HelpNeeded event in the selected command and triggers the SelectedCommandNeedsHelp event.
/// </summary>
/// <param name="sender">HelpNeeded event sender</param>
/// <param name="e">HelpNeeded event argument</param>
/// <param name="sender">HelpNeeded event sender.</param>
/// <param name="e">HelpNeeded event argument.</param>
private void SelectedCommand_HelpNeeded(object sender, HelpNeededEventArgs e)
{
this.OnSelectedCommandNeedsHelp(e);
}
/// <summary>
/// Handles the ImportModule event in the selected command and triggers the SelectedCommandNeedsImportModule event
/// Handles the ImportModule event in the selected command and triggers the SelectedCommandNeedsImportModule event.
/// </summary>
/// <param name="sender">HelpNeeded event sender</param>
/// <param name="e">HelpNeeded event argument</param>
/// <param name="sender">HelpNeeded event sender.</param>
/// <param name="e">HelpNeeded event argument.</param>
private void SelectedCommand_ImportModule(object sender, EventArgs e)
{
this.OnSelectedCommandNeedsImportModule();
}
/// <summary>
/// Called when the SelectedCommand property changes to update IsThereASelectedImportedCommandWhereAllMandatoryParametersHaveValues
/// Called when the SelectedCommand property changes to update IsThereASelectedImportedCommandWhereAllMandatoryParametersHaveValues.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void SelectedCommand_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (!e.PropertyName.Equals("SelectedParameterSetAllMandatoryParametersHaveValues"))
@ -504,11 +504,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Compare source commandmodule is equal like target commandmodule
/// Compare source commandmodule is equal like target commandmodule.
/// </summary>
/// <param name="source">source commandmodule </param>
/// <param name="target">target commandmodule</param>
/// <returns>return compare result</returns>
/// <param name="source">Source commandmodule.</param>
/// <param name="target">Target commandmodule.</param>
/// <returns>Return compare result.</returns>
private int Compare(CommandViewModel source, CommandViewModel target)
{
return string.Compare(source.Name, target.Name, StringComparison.OrdinalIgnoreCase);
@ -516,9 +516,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#endregion
/// <summary>
/// If property changed will be notify
/// If property changed will be notify.
/// </summary>
/// <param name="propertyName">The changed property</param>
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;

View file

@ -24,7 +24,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
private string name;
/// <summary>
/// value indicating all mandatory parameters have values
/// value indicating all mandatory parameters have values.
/// </summary>
private bool allMandatoryParametersHaveValues;
@ -38,8 +38,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Initializes a new instance of the ParameterSetViewModel class.
/// </summary>
/// <param name="name">The name of the parameterSet</param>
/// <param name="parameters">The array parametes of the parameterSet</param>
/// <param name="name">The name of the parameterSet.</param>
/// <param name="parameters">The array parametes of the parameterSet.</param>
[SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Justification = "this type is internal, made public only for WPF Binding")]
public ParameterSetViewModel(
string name,
@ -76,7 +76,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region INotifyPropertyChanged Members
/// <summary>
/// PropertyChanged Event
/// PropertyChanged Event.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
@ -84,7 +84,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region Public Property
/// <summary>
/// Gets the ParameterSet Name
/// Gets the ParameterSet Name.
/// </summary>
public string Name
{
@ -92,7 +92,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the Parameters of this parameterset
/// Gets the Parameters of this parameterset.
/// </summary>
public List<ParameterViewModel> Parameters
{
@ -100,7 +100,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets a value indicating whether all mandatory parameters have values
/// Gets or sets a value indicating whether all mandatory parameters have values.
/// </summary>
public bool AllMandatoryParametersHaveValues
{
@ -122,9 +122,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region Public Method
/// <summary>
/// Creates script according parameters of this parameterset
/// Creates script according parameters of this parameterset.
/// </summary>
/// <returns>Return script of this parameterset parameters</returns>
/// <returns>Return script of this parameterset parameters.</returns>
public string GetScript()
{
if (this.Parameters == null || this.Parameters.Count == 0)
@ -179,9 +179,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the individual parameter count of this parameterset
/// Gets the individual parameter count of this parameterset.
/// </summary>
/// <returns>Return individual parameter count of this parameterset</returns>
/// <returns>Return individual parameter count of this parameterset.</returns>
public int GetIndividualParameterCount()
{
if (this.Parameters == null || this.Parameters.Count == 0)
@ -209,11 +209,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region Internal Method
/// <summary>
/// Compare source parametermodel is equal like target parametermodel
/// Compare source parametermodel is equal like target parametermodel.
/// </summary>
/// <param name="source">the source of parametermodel</param>
/// <param name="target">the target of parametermodel</param>
/// <returns>Return compare result</returns>
/// <param name="source">The source of parametermodel.</param>
/// <param name="target">The target of parametermodel.</param>
/// <returns>Return compare result.</returns>
internal static int Compare(ParameterViewModel source, ParameterViewModel target)
{
if (source.Parameter.IsMandatory && !target.Parameter.IsMandatory)
@ -232,12 +232,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#endregion
/// <summary>
/// Gets the delimited poarameter if it needs delimitation and is not delimited
/// Gets the delimited poarameter if it needs delimitation and is not delimited.
/// </summary>
/// <param name="parameterValue">value needing delimitation</param>
/// <param name="openDelimiter">open delimitation</param>
/// <param name="closeDelimiter">close delimitation</param>
/// <returns>the delimited poarameter if it needs delimitation and is not delimited</returns>
/// <param name="parameterValue">Value needing delimitation.</param>
/// <param name="openDelimiter">Open delimitation.</param>
/// <param name="closeDelimiter">Close delimitation.</param>
/// <returns>The delimited poarameter if it needs delimitation and is not delimited.</returns>
private static string GetDelimitedParameter(string parameterValue, string openDelimiter, string closeDelimiter)
{
string parameterValueTrimmed = parameterValue.Trim();
@ -262,11 +262,11 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Returns '0' if the <paramref name="parameterValue"/> does not need delimitation, '1' if it does, and a quote character if it needs to be delimited with a quote
/// Returns '0' if the <paramref name="parameterValue"/> does not need delimitation, '1' if it does, and a quote character if it needs to be delimited with a quote.
/// </summary>
/// <param name="parameterValue">parameter value to check</param>
/// <param name="requireScriptblock">true if the parameter value should be a scriptblock</param>
/// <returns>'0' if the parameter does not need delimitation, '1' if it needs, '\'' if it needs to be delimited with single quote and '\"' if it needs to be delimited with double quotes</returns>
/// <param name="parameterValue">Parameter value to check.</param>
/// <param name="requireScriptblock">True if the parameter value should be a scriptblock.</param>
/// <returns>'0' if the parameter does not need delimitation, '1' if it needs, '\'' if it needs to be delimited with single quote and '\"' if it needs to be delimited with double quotes.</returns>
private static char ParameterNeedsDelimitation(string parameterValue, bool requireScriptblock)
{
Token[] tokens;
@ -341,7 +341,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Called to evaluate the value of AllMandatoryParametersHaveValues
/// Called to evaluate the value of AllMandatoryParametersHaveValues.
/// </summary>
private void EvaluateAllMandatoryParametersHaveValues()
{
@ -364,9 +364,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// If property changed will be notify
/// If property changed will be notify.
/// </summary>
/// <param name="propertyName">The changed property</param>
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;
@ -377,10 +377,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Used to track changes to parameter values in order to verify the enabled state of buttons
/// Used to track changes to parameter values in order to verify the enabled state of buttons.
/// </summary>
/// <param name="sender">event arguments</param>
/// <param name="e">event sender</param>
/// <param name="sender">Event arguments.</param>
/// <param name="e">Event sender.</param>
private void MandatoryParameter_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (!e.PropertyName.Equals("Value", StringComparison.Ordinal))

View file

@ -31,12 +31,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
private ShowCommandParameterInfo parameter;
/// <summary>
/// value entered in the GUI for the parameter
/// value entered in the GUI for the parameter.
/// </summary>
private object parameterValue;
/// <summary>
/// Name of the parameter set this parameter is in
/// Name of the parameter set this parameter is in.
/// </summary>
private string parameterSetName;
@ -44,8 +44,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <summary>
/// Initializes a new instance of the ParameterViewModel class.
/// </summary>
/// <param name="parameter">The parameter information for this parameter</param>
/// <param name="parameterSetName">the name of the parameter set this parameter is in</param>
/// <param name="parameter">The parameter information for this parameter.</param>
/// <param name="parameterSetName">The name of the parameter set this parameter is in.</param>
public ParameterViewModel(ShowCommandParameterInfo parameter, string parameterSetName)
{
if (parameter == null)
@ -75,7 +75,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#region INotifyPropertyChanged Members
/// <summary>
/// PropertyChanged Event
/// PropertyChanged Event.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
@ -92,7 +92,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets or sets the value for this parameter from the GUI
/// Gets or sets the value for this parameter from the GUI.
/// </summary>
public object Value
{
@ -112,7 +112,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the parameter name
/// Gets the parameter name.
/// </summary>
public string Name
{
@ -120,7 +120,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets the name of the parameter set this parameter is in
/// Gets the name of the parameter set this parameter is in.
/// </summary>
public string ParameterSetName
{
@ -128,7 +128,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets a value indicating whether this parameter is in the shared parameterset
/// Gets a value indicating whether this parameter is in the shared parameterset.
/// </summary>
public bool IsInSharedParameterSet
{
@ -136,7 +136,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets Name with an extra suffix to indicate if the parameter is mandatory to serve
/// Gets Name with an extra suffix to indicate if the parameter is mandatory to serve.
/// </summary>
public string NameTextLabel
{
@ -156,7 +156,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets Label in the case this parameter is used in a combo box
/// Gets Label in the case this parameter is used in a combo box.
/// </summary>
public string NameCheckLabel
{
@ -173,7 +173,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets Tooltip string for the parameter
/// Gets Tooltip string for the parameter.
/// </summary>
public string ToolTip
{
@ -189,7 +189,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets a value indicating whether the parameter is mandatory
/// Gets a value indicating whether the parameter is mandatory.
/// </summary>
public bool IsMandatory
{
@ -197,7 +197,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Gets a value indicating whether the parameter has a value
/// Gets a value indicating whether the parameter has a value.
/// </summary>
public bool HasValue
{
@ -219,14 +219,14 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
#endregion
/// <summary>
/// Evaluates the tooltip based on the parameters
/// Evaluates the tooltip based on the parameters.
/// </summary>
/// <param name="typeName">parameter type name</param>
/// <param name="position">parameter position</param>
/// <param name="mandatory">true if the parameter is mandatory</param>
/// <param name="shared">true if the parameter is shared by parameter sets</param>
/// <param name="valueFromPipeline">true if the parameter takes value from the pipeline</param>
/// <returns> the tooltip based on the parameters</returns>
/// <param name="typeName">Parameter type name.</param>
/// <param name="position">Parameter position.</param>
/// <param name="mandatory">True if the parameter is mandatory.</param>
/// <param name="shared">True if the parameter is shared by parameter sets.</param>
/// <param name="valueFromPipeline">True if the parameter takes value from the pipeline.</param>
/// <returns> the tooltip based on the parameters.</returns>
internal static string EvaluateTooltip(string typeName, int position, bool mandatory, bool shared, bool valueFromPipeline)
{
StringBuilder returnValue = new StringBuilder(string.Format(
@ -263,9 +263,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// If property changed will be notify
/// If property changed will be notify.
/// </summary>
/// <param name="propertyName">The changed property</param>
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;

View file

@ -6,7 +6,7 @@ using System.Windows;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Interaction logic for MultipleSelectionDialog.xaml
/// Interaction logic for MultipleSelectionDialog.xaml.
/// </summary>
public partial class MultipleSelectionDialog : Window
{
@ -19,10 +19,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// OK Click event function
/// OK Click event function.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ButtonOK_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
@ -30,10 +30,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Cancel Click event function
/// Cancel Click event function.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ButtonCancel_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = false;

View file

@ -11,27 +11,27 @@ using Microsoft.Management.UI.Internal.ShowCommand;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Interaction logic for CmdletGUI.xaml
/// Interaction logic for CmdletGUI.xaml.
/// </summary>
public partial class ShowAllModulesWindow : Window
{
/// <summary>
/// private constants for ZoomLevel
/// private constants for ZoomLevel.
/// </summary>
private double zoomLevel = 1.0;
/// <summary>
/// Zoom Increments
/// Zoom Increments.
/// </summary>
private const double ZOOM_INCREMENT = 0.2;
/// <summary>
/// Max ZoomLevel
/// Max ZoomLevel.
/// </summary>
private const double ZOOM_MAX = 3.0;
/// <summary>
/// Min ZoomLevel
/// Min ZoomLevel.
/// </summary>
private const double ZOOM_MIN = 0.5;
@ -93,9 +93,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Saves the user settings
/// Saves the user settings.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
protected override void OnClosed(System.EventArgs e)
{
ShowCommandSettings.Default.Save();
@ -103,20 +103,20 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Sets the focus on the CommandName control
/// Sets the focus on the CommandName control.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ShowAllModulesWindow_Loaded(object sender, RoutedEventArgs e)
{
this.AllModulesControl.CommandName.Focus();
}
/// <summary>
/// Saves size changes in user settings
/// Saves size changes in user settings.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ShowAllModulesWindow_SizeChanged(object sender, SizeChangedEventArgs e)
{
ShowCommandSettings.Default.ShowCommandsWidth = this.Width;
@ -124,10 +124,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Saves position changes in user settings
/// Saves position changes in user settings.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ShowAllModulesWindow_LocationChanged(object sender, System.EventArgs e)
{
ShowCommandSettings.Default.ShowCommandsTop = this.Top;
@ -135,20 +135,20 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Updates the user setting with window state
/// Updates the user setting with window state.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ShowAllModulesWindow_StateChanged(object sender, System.EventArgs e)
{
ShowCommandSettings.Default.ShowCommandsWindowMaximized = this.WindowState == WindowState.Maximized;
}
/// <summary>
/// Implements ZoomIn
/// Implements ZoomIn.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="sender">.</param>
/// <param name="e">.</param>
private void ZoomEventHandlerPlus(object sender, ExecutedRoutedEventArgs e)
{
AllModulesViewModel viewModel = this.DataContext as AllModulesViewModel;
@ -172,10 +172,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Implements ZoomOut
/// Implements ZoomOut.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="sender">.</param>
/// <param name="e">.</param>
private void ZoomEventHandlerMinus(object sender, ExecutedRoutedEventArgs e)
{
AllModulesViewModel viewModel = this.DataContext as AllModulesViewModel;

View file

@ -8,7 +8,7 @@ using Microsoft.Management.UI.Internal.ShowCommand;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Interaction logic for CmdletGUI.xaml
/// Interaction logic for CmdletGUI.xaml.
/// </summary>
public partial class ShowCommandWindow : Window
{
@ -26,9 +26,9 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Saves the user settings
/// Saves the user settings.
/// </summary>
/// <param name="e">event arguments</param>
/// <param name="e">Event arguments.</param>
protected override void OnClosed(System.EventArgs e)
{
ShowCommandSettings.Default.Save();
@ -36,10 +36,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Saves size changes in user settings
/// Saves size changes in user settings.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ShowCommandWindow_SizeChanged(object sender, SizeChangedEventArgs e)
{
ShowCommandSettings.Default.ShowOneCommandWidth = this.Width;
@ -47,10 +47,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Saves position changes in user settings
/// Saves position changes in user settings.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ShowCommandWindow_LocationChanged(object sender, System.EventArgs e)
{
ShowCommandSettings.Default.ShowOneCommandTop = this.Top;
@ -58,10 +58,10 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
/// <summary>
/// Updates the user setting with window state
/// Updates the user setting with window state.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void ShowCommandWindow_StateChanged(object sender, System.EventArgs e)
{
ShowCommandSettings.Default.ShowOneCommandWindowMaximized = this.WindowState == WindowState.Maximized;

View file

@ -13,15 +13,15 @@ using Microsoft.PowerShell.Commands.ShowCommandInternal;
namespace Microsoft.PowerShell.Commands.Internal
{
/// <summary>
/// Implements thw WPF window part of the the ShowWindow option of get-help
/// Implements thw WPF window part of the the ShowWindow option of get-help.
/// </summary>
internal static class HelpWindowHelper
{
/// <summary>
/// Shows the help window
/// Shows the help window.
/// </summary>
/// <param name="helpObj">object with help information</param>
/// <param name="cmdlet">cmdlet calling this method</param>
/// <param name="helpObj">Object with help information.</param>
/// <param name="cmdlet">Cmdlet calling this method.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called from methods called using reflection")]
private static void ShowHelpWindow(PSObject helpObj, PSCmdlet cmdlet)
{

View file

@ -23,17 +23,17 @@ namespace Microsoft.Management.UI.Internal
#region private Fields
/// <summary>
/// Zoom Increments
/// Zoom Increments.
/// </summary>
private const double ZOOM_INCREMENT = 0.2;
/// <summary>
/// Max ZoomLevel
/// Max ZoomLevel.
/// </summary>
private const double ZOOM_MAX = 3.0;
/// <summary>
/// Min ZoomLevel
/// Min ZoomLevel.
/// </summary>
private const double ZOOM_MIN = 0.5;
@ -53,11 +53,11 @@ namespace Microsoft.Management.UI.Internal
private ObservableCollection<PSObject> listItems;
/// <summary>
/// Event used for the thread gridViewWindows signaling main thread after Windows loaded
/// Event used for the thread gridViewWindows signaling main thread after Windows loaded.
/// </summary>
private AutoResetEvent gridViewWindowLoaded;
/// <summary> Is used to store any Management list calls exceptions. </summary>
/// <summary>Is used to store any Management list calls exceptions.</summary>
private Exception exception = null;
/// <summary>
@ -76,17 +76,17 @@ namespace Microsoft.Management.UI.Internal
private static readonly string CancelButtonContent = XamlLocalizableResources.OutGridView_Button_Cancel;
/// <summary>
/// Used to store selected items in the ok processing
/// Used to store selected items in the ok processing.
/// </summary>
private List<PSObject> selectedItems;
/// <summary>
/// The GUI thread of Out-GridView
/// The GUI thread of Out-GridView.
/// </summary>
private Thread guiThread;
/// <summary>
/// private constants for ZoomLevel
/// private constants for ZoomLevel.
/// </summary>
private double zoomLevel = 1.0;
@ -119,9 +119,9 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Start a new thread as STA for gridView Window.
/// </summary>
/// <param name="invocation">commands of the PowerShell.</param>
/// <param name="outputModeOptions">selection mode of the list</param>
/// <param name="closedEvent">closedEvent</param>
/// <param name="invocation">Commands of the PowerShell.</param>
/// <param name="outputModeOptions">Selection mode of the list.</param>
/// <param name="closedEvent">ClosedEvent.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "The method is called using reflection.")]
private void StartWindow(string invocation, string outputModeOptions, AutoResetEvent closedEvent)
{
@ -200,10 +200,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Implements ZoomIn
/// Implements ZoomIn.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="sender">.</param>
/// <param name="e">.</param>
private void ZoomEventHandlerPlus(object sender, ExecutedRoutedEventArgs e)
{
if (this.zoomLevel == 0)
@ -224,10 +224,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Implements ZoomOut
/// Implements ZoomOut.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="sender">.</param>
/// <param name="e">.</param>
private void ZoomEventHandlerMinus(object sender, ExecutedRoutedEventArgs e)
{
if (this.zoomLevel >= ZOOM_MIN)
@ -244,8 +244,8 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Creates a new ManagementList.
/// </summary>
/// <param name="outputMode">Output mode of the out-gridview</param>
/// <returns>A new ManagementList</returns>
/// <param name="outputMode">Output mode of the out-gridview.</param>
/// <returns>A new ManagementList.</returns>
private ManagementList CreateManagementList(string outputMode)
{
ManagementList newList = new ManagementList();
@ -262,8 +262,8 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Creates a new main grid for window.
/// </summary>
/// <param name="outputMode">Output mode of the out-gridview</param>
/// <returns>A new mainGrid</returns>
/// <param name="outputMode">Output mode of the out-gridview.</param>
/// <returns>A new mainGrid.</returns>
private Grid CreateMainGrid(string outputMode)
{
Grid mainGrid = new Grid();
@ -287,7 +287,7 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Creates a OK button.
/// </summary>
/// <returns>A new buttonGrid</returns>
/// <returns>A new buttonGrid.</returns>
private Grid CreateButtonGrid()
{
Grid buttonGrid = new Grid();
@ -313,7 +313,7 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Creates a OK button.
/// </summary>
/// <returns>A new OK button</returns>
/// <returns>A new OK button.</returns>
private Button CreateOKButton()
{
Button ok = new Button();
@ -330,7 +330,7 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Creates a Cancel button.
/// </summary>
/// <returns>A new Cancel button</returns>
/// <returns>A new Cancel button.</returns>
private Button CreateCancelButton()
{
Button cancel = new Button();
@ -345,10 +345,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Store the selected items for use in EndProcessing
/// Store the selected items for use in EndProcessing.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void OK_Click(object sender, RoutedEventArgs e)
{
if (this.managementList.List.SelectedItems.Count != 0)
@ -364,10 +364,10 @@ namespace Microsoft.Management.UI.Internal
}
/// <summary>
/// Closes the window
/// Closes the window.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void Cancel_Click(object sender, RoutedEventArgs e)
{
this.gridViewWindow.Close();
@ -376,14 +376,14 @@ namespace Microsoft.Management.UI.Internal
/// <summary>
/// Gets selected items from List.
/// </summary>
/// <returns>Selected items of the list</returns>
/// <returns>Selected items of the list.</returns>
private List<PSObject> SelectedItems()
{
return this.selectedItems;
}
/// <summary>
/// Closes the window
/// Closes the window.
/// </summary>
public void CloseWindow()
{

View file

@ -21,7 +21,7 @@ using Microsoft.PowerShell.Commands.ShowCommandExtension;
namespace Microsoft.PowerShell.Commands.ShowCommandInternal
{
/// <summary>
/// Implements thw WPF window part of the show-command cmdlet
/// Implements thw WPF window part of the show-command cmdlet.
/// </summary>
internal class ShowCommandHelper : IDisposable
{
@ -36,67 +36,67 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
private DispatcherOperationCallback methodThatReturnsDialog;
/// <summary>
/// Event set when the window is closed
/// Event set when the window is closed.
/// </summary>
private AutoResetEvent windowClosed = new AutoResetEvent(false);
/// <summary>
/// Event set when help is needed
/// Event set when help is needed.
/// </summary>
private AutoResetEvent helpNeeded = new AutoResetEvent(false);
/// <summary>
/// Event set when it is necessary to import a module
/// Event set when it is necessary to import a module.
/// </summary>
private AutoResetEvent importModuleNeeded = new AutoResetEvent(false);
/// <summary>
/// Event set when the window is loaded
/// Event set when the window is loaded.
/// </summary>
private AutoResetEvent windowLoaded = new AutoResetEvent(false);
/// <summary>
/// String with the command that needs help set when helpNeeded is set
/// String with the command that needs help set when helpNeeded is set.
/// </summary>
private string commandNeedingHelp;
/// <summary>
/// String with the command name that needs to import a module
/// String with the command name that needs to import a module.
/// </summary>
private string commandNeedingImportModule;
/// <summary>
/// String with the module name that needs to be imported
/// String with the module name that needs to be imported.
/// </summary>
private string parentModuleNeedingImportModule;
/// <summary>
/// String with the selected module at the time a module needs to be imported
/// String with the selected module at the time a module needs to be imported.
/// </summary>
private string selectedModuleNeedingImportModule;
/// <summary>
/// Keeps the window for the implementation of CloseWindow
/// Keeps the window for the implementation of CloseWindow.
/// </summary>
private Window window;
/// <summary>
/// host window, if any
/// host window, if any.
/// </summary>
private Window hostWindow;
/// <summary>
/// ViewModel when showing all modules
/// ViewModel when showing all modules.
/// </summary>
private AllModulesViewModel allModulesViewModel;
/// <summary>
/// ViewModel when showing a single command
/// ViewModel when showing a single command.
/// </summary>
private CommandViewModel commandViewModel;
/// <summary>
/// true when the window is closed with cancel
/// true when the window is closed with cancel.
/// </summary>
private bool dialogCanceled = true;
#endregion fields
@ -282,14 +282,14 @@ Function PSGetSerializedShowCommandInfo
#region constructor and destructor
/// <summary>
/// Prevents a default instance of the ShowCommandHelper class from being created
/// Prevents a default instance of the ShowCommandHelper class from being created.
/// </summary>
private ShowCommandHelper()
{
}
/// <summary>
/// Finalizes an instance of the ShowCommandHelper class
/// Finalizes an instance of the ShowCommandHelper class.
/// </summary>
~ShowCommandHelper()
{
@ -299,7 +299,7 @@ Function PSGetSerializedShowCommandInfo
#region properties called using reflection
/// <summary>
/// Gets the Screen Width
/// Gets the Screen Width.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private static double ScreenWidth
@ -311,7 +311,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the Screen Height
/// Gets the Screen Height.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private static double ScreenHeight
@ -323,7 +323,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the event set when the show-command window is closed
/// Gets the event set when the show-command window is closed.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private AutoResetEvent WindowClosed
@ -335,7 +335,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the event set when help is needed for a command
/// Gets the event set when help is needed for a command.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private AutoResetEvent HelpNeeded
@ -347,7 +347,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the event set when it is necessary to import a module
/// Gets the event set when it is necessary to import a module.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private AutoResetEvent ImportModuleNeeded
@ -359,7 +359,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the event set when the window is loaded
/// Gets the event set when the window is loaded.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private AutoResetEvent WindowLoaded
@ -371,7 +371,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the command needing help when HelpNeeded is set
/// Gets the command needing help when HelpNeeded is set.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private string CommandNeedingHelp
@ -383,7 +383,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the module we want to import
/// Gets the module we want to import.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private string ParentModuleNeedingImportModule
@ -395,7 +395,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets a value indicating whether there is a host window
/// Gets a value indicating whether there is a host window.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private bool HasHostWindow
@ -409,7 +409,7 @@ Function PSGetSerializedShowCommandInfo
#region public Dispose
/// <summary>
/// Dispose method in IDisposeable
/// Dispose method in IDisposeable.
/// </summary>
public void Dispose()
{
@ -420,9 +420,9 @@ Function PSGetSerializedShowCommandInfo
#region internal static methods called using reflection from show-command
/// <summary>
/// Sets the text in the clipboard
/// Sets the text in the clipboard.
/// </summary>
/// <param name="text">text to set the clipboard to</param>
/// <param name="text">Text to set the clipboard to.</param>
internal static void SetClipboardText(string text)
{
try
@ -444,11 +444,11 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the command to be run to get commands and imported modules
/// Gets the command to be run to get commands and imported modules.
/// </summary>
/// <param name="isRemoteRunspace">Boolean flag determining whether Show-Command is queried in the local or remote runspace scenario </param>
/// <param name="isFirstChance">Boolean flag to indicate that it is the second attempt to query Show-Command data </param>
/// <returns>the command to be run to get commands and imported modules</returns>
/// <param name="isRemoteRunspace">Boolean flag determining whether Show-Command is queried in the local or remote runspace scenario.</param>
/// <param name="isFirstChance">Boolean flag to indicate that it is the second attempt to query Show-Command data.</param>
/// <returns>The command to be run to get commands and imported modules.</returns>
internal static string GetShowAllModulesCommand(bool isRemoteRunspace = false, bool isFirstChance = true)
{
string scriptBase;
@ -476,9 +476,9 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Retrieves the script for Get-SerializedCommand from local machine
/// Retrieves the script for Get-SerializedCommand from local machine.
/// </summary>
/// <returns>String representation of the script for Get-SerializedCommand</returns>
/// <returns>String representation of the script for Get-SerializedCommand.</returns>
private static string GetSerializedCommandScript()
{
return string.Format(
@ -490,12 +490,12 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the command to be run to in order to import a module and refresh the command data
/// Gets the command to be run to in order to import a module and refresh the command data.
/// </summary>
/// <param name="module">module we want to import</param>
/// <param name="isRemoteRunspace">Boolean flag determining whether Show-Command is queried in the local or remote runspace scenario </param>
/// <param name="isFirstChance">Boolean flag to indicate that it is the second attempt to query Show-Command data </param>
/// <returns>the command to be run to in order to import a module and refresh the command data</returns>
/// <param name="module">Module we want to import.</param>
/// <param name="isRemoteRunspace">Boolean flag determining whether Show-Command is queried in the local or remote runspace scenario.</param>
/// <param name="isFirstChance">Boolean flag to indicate that it is the second attempt to query Show-Command data.</param>
/// <returns>The command to be run to in order to import a module and refresh the command data.</returns>
internal static string GetImportModuleCommand(string module, bool isRemoteRunspace = false, bool isFirstChance = true)
{
string scriptBase = "Import-Module " + ShowCommandHelper.SingleQuote(module);
@ -521,20 +521,20 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// gets the command to be run in order to show help for a command
/// Gets the command to be run in order to show help for a command.
/// </summary>
/// <param name="command">command we want to get help from</param>
/// <returns>the command to be run in order to show help for a command</returns>
/// <param name="command">Command we want to get help from.</param>
/// <returns>The command to be run in order to show help for a command.</returns>
internal static string GetHelpCommand(string command)
{
return "Get-Help " + ShowCommandHelper.SingleQuote(command);
}
/// <summary>
/// Constructs a dictionary of imported modules based on the module names
/// Constructs a dictionary of imported modules based on the module names.
/// </summary>
/// <param name="moduleObjects">the imported modules</param>
/// <returns>a dictionary of imported modules based on the module names</returns>
/// <param name="moduleObjects">The imported modules.</param>
/// <returns>a dictionary of imported modules based on the module names.</returns>
internal static Dictionary<string, ShowCommandModuleInfo> GetImportedModulesDictionary(object[] moduleObjects)
{
Dictionary<string, ShowCommandModuleInfo> returnValue = new Dictionary<string, ShowCommandModuleInfo>(StringComparer.OrdinalIgnoreCase);
@ -563,10 +563,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Constructs a list of commands out of <paramref name="commandObjects"/>
/// Constructs a list of commands out of <paramref name="commandObjects"/>.
/// </summary>
/// <param name="commandObjects">the results of a get-command command</param>
/// <returns>a list of commands out of <paramref name="commandObjects"/></returns>
/// <param name="commandObjects">The results of a get-command command.</param>
/// <returns>a list of commands out of <paramref name="commandObjects"/>.</returns>
internal static List<ShowCommandCommandInfo> GetCommandList(object[] commandObjects)
{
List<ShowCommandCommandInfo> returnValue = new List<ShowCommandCommandInfo>();
@ -591,10 +591,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Constructs an array of objects out of <paramref name="commandObjects"/>
/// Constructs an array of objects out of <paramref name="commandObjects"/>.
/// </summary>
/// <param name="commandObjects">The result of a get-command command</param>
/// <returns>An array of objects out of <paramref name="commandObjects"/></returns>
/// <param name="commandObjects">The result of a get-command command.</param>
/// <returns>An array of objects out of <paramref name="commandObjects"/>.</returns>
internal static object[] ObjectArrayFromObjectCollection(object commandObjects)
{
object[] objectArray = commandObjects as object[];
@ -613,12 +613,12 @@ Function PSGetSerializedShowCommandInfo
/// The new ViewModel will have the command selected according to <paramref name="selectedModuleNeedingImportModule"/>,
/// <paramref name="parentModuleNeedingImportModule"/> and <paramref name="commandNeedingImportModule"/>.
/// </summary>
/// <param name="oldViewModel">the viewModel before the module was imported</param>
/// <param name="importedModules">the list of imported modules</param>
/// <param name="commands">the list of commands</param>
/// <param name="selectedModuleNeedingImportModule">the name of the module that was selected in <paramref name="oldViewModel"/></param>
/// <param name="parentModuleNeedingImportModule">the name of the module that was imported</param>
/// <param name="commandNeedingImportModule">the name of the command that was selected in <paramref name="oldViewModel"/></param>
/// <param name="oldViewModel">The viewModel before the module was imported.</param>
/// <param name="importedModules">The list of imported modules.</param>
/// <param name="commands">The list of commands.</param>
/// <param name="selectedModuleNeedingImportModule">The name of the module that was selected in <paramref name="oldViewModel"/>.</param>
/// <param name="parentModuleNeedingImportModule">The name of the module that was imported.</param>
/// <param name="commandNeedingImportModule">The name of the command that was selected in <paramref name="oldViewModel"/>.</param>
/// <returns>The new ViewModel based on <paramref name="importedModules"/> and <paramref name="commands"/>.</returns>
internal static AllModulesViewModel GetNewAllModulesViewModel(AllModulesViewModel oldViewModel, Dictionary<string, ShowCommandModuleInfo> importedModules, IEnumerable<ShowCommandCommandInfo> commands, string selectedModuleNeedingImportModule, string parentModuleNeedingImportModule, string commandNeedingImportModule)
{
@ -674,12 +674,12 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets an error message to be displayed when failed to import a module
/// Gets an error message to be displayed when failed to import a module.
/// </summary>
/// <param name="command">command belongiong to the module to import</param>
/// <param name="module">module to import</param>
/// <param name="error">error importing the module</param>
/// <returns>an error message to be displayed when failed to import a module</returns>
/// <param name="command">Command belongiong to the module to import.</param>
/// <param name="module">Module to import.</param>
/// <param name="error">Error importing the module.</param>
/// <returns>An error message to be displayed when failed to import a module.</returns>
internal static string GetImportModuleFailedMessage(string command, string module, string error)
{
return string.Format(
@ -691,10 +691,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Single quotes <paramref name="str"/>
/// Single quotes <paramref name="str"/>.
/// </summary>
/// <param name="str">string to quote</param>
/// <returns><paramref name="str"/> single quoted</returns>
/// <param name="str">String to quote.</param>
/// <returns><paramref name="str"/> single quoted.</returns>
internal static string SingleQuote(string str)
{
if (str == null)
@ -708,10 +708,10 @@ Function PSGetSerializedShowCommandInfo
#region internal static methods used internally in this assembly
/// <summary>
/// Gets the host window, if it is present or null if it is not
/// Gets the host window, if it is present or null if it is not.
/// </summary>
/// <param name="cmdlet">cmdlet calling this method</param>
/// <returns>the host window, if it is present or null if it is not</returns>
/// <param name="cmdlet">Cmdlet calling this method.</param>
/// <returns>The host window, if it is present or null if it is not.</returns>
internal static Window GetHostWindow(PSCmdlet cmdlet)
{
PSPropertyInfo windowProperty = cmdlet.Host.PrivateData.Properties["Window"];
@ -734,14 +734,14 @@ Function PSGetSerializedShowCommandInfo
#region static private methods used only on this file
/// <summary>
/// Gets a property value using reflection
/// Gets a property value using reflection.
/// </summary>
/// <param name="type">type containing the property</param>
/// <param name="obj">object containing the property (null for a static property)</param>
/// <param name="propertyName">name of property to get</param>
/// <param name="bindingFlags">flags passed to reflection</param>
/// <param name="type">Type containing the property.</param>
/// <param name="obj">Object containing the property (null for a static property).</param>
/// <param name="propertyName">Name of property to get.</param>
/// <param name="bindingFlags">Flags passed to reflection.</param>
/// <returns>
/// property value or null if it was not able to retrieve it. This method is not suitable to return a property value that might be null.
/// Property value or null if it was not able to retrieve it. This method is not suitable to return a property value that might be null.
/// </returns>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called from a method called using reflection")]
private static object GetPropertyValue(Type type, object obj, string propertyName, BindingFlags bindingFlags)
@ -779,14 +779,14 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Sets a property value using reflection
/// Sets a property value using reflection.
/// </summary>
/// <param name="type">type containing the property</param>
/// <param name="obj">object containing the property (null for a static property)</param>
/// <param name="propertyName">name of property to set</param>
/// <param name="value">value to set the property with</param>
/// <param name="bindingFlags">flags passed to reflection</param>
/// <returns>true if it was able to set</returns>
/// <param name="type">Type containing the property.</param>
/// <param name="obj">Object containing the property (null for a static property).</param>
/// <param name="propertyName">Name of property to set.</param>
/// <param name="value">Value to set the property with.</param>
/// <param name="bindingFlags">Flags passed to reflection.</param>
/// <returns>True if it was able to set.</returns>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called from a method called using reflection")]
private static bool SetPropertyValue(Type type, object obj, string propertyName, object value, BindingFlags bindingFlags)
{
@ -825,9 +825,9 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets the suffix that adds imported modules to a command
/// Gets the suffix that adds imported modules to a command.
/// </summary>
/// <returns>the suffix that adds imported modules to a command</returns>
/// <returns>The suffix that adds imported modules to a command.</returns>
private static string GetGetModuleSuffix()
{
return ",@(get-module)";
@ -837,11 +837,11 @@ Function PSGetSerializedShowCommandInfo
#region private methods called using reflection from show-command
/// <summary>
/// Gets the command to be run when calling show-command for a particular command
/// Gets the command to be run when calling show-command for a particular command.
/// </summary>
/// <param name="commandName">the particular command we are running show-command on</param>
/// <param name="includeAliasAndModules">true if we want to include aliases and retrieve modules</param>
/// <returns>the command to be run when calling show-command for a particular command</returns>
/// <param name="commandName">The particular command we are running show-command on.</param>
/// <param name="includeAliasAndModules">True if we want to include aliases and retrieve modules.</param>
/// <returns>The command to be run when calling show-command for a particular command.</returns>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private static string GetShowCommandCommand(string commandName, bool includeAliasAndModules)
{
@ -852,13 +852,13 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Gets a CommandViewModel of a CommandInfo
/// Gets a CommandViewModel of a CommandInfo.
/// </summary>
/// <param name="command">command we want to get a CommandViewModel of</param>
/// <param name="noCommonParameter">true if we do not want common parameters</param>
/// <param name="importedModules">the loaded modules</param>
/// <param name="moduleQualify">True to qualify command with module name in GetScript</param>
/// <returns>a CommandViewModel of a CommandInfo</returns>
/// <param name="command">Command we want to get a CommandViewModel of.</param>
/// <param name="noCommonParameter">True if we do not want common parameters.</param>
/// <param name="importedModules">The loaded modules.</param>
/// <param name="moduleQualify">True to qualify command with module name in GetScript.</param>
/// <returns>A CommandViewModel of a CommandInfo.</returns>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private static object GetCommandViewModel(ShowCommandCommandInfo command, bool noCommonParameter, Dictionary<string, ShowCommandModuleInfo> importedModules, bool moduleQualify)
{
@ -868,9 +868,9 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Dispatches a message to the window for it to activate
/// Dispatches a message to the window for it to activate.
/// </summary>
/// <param name="window">window to be activated</param>
/// <param name="window">Window to be activated.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called from ActivateWindow() which is called using reflection")]
private static void ActivateWindow(Window window)
{
@ -884,15 +884,15 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Shows the window listing cmdlets
/// Shows the window listing cmdlets.
/// </summary>
/// <param name="cmdlet">cmdlet calling this method</param>
/// <param name="importedModules">All loaded modules</param>
/// <param name="commands">commands to be listed</param>
/// <param name="noCommonParameter">true if we should not show common parameters</param>
/// <param name="windowWidth">window width</param>
/// <param name="windowHeight">window height</param>
/// <param name="passThrough">true if the GUI should mention ok instead of run</param>
/// <param name="cmdlet">Cmdlet calling this method.</param>
/// <param name="importedModules">All loaded modules.</param>
/// <param name="commands">Commands to be listed.</param>
/// <param name="noCommonParameter">True if we should not show common parameters.</param>
/// <param name="windowWidth">Window width.</param>
/// <param name="windowHeight">Window height.</param>
/// <param name="passThrough">True if the GUI should mention ok instead of run.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private void ShowAllModulesWindow(PSCmdlet cmdlet, Dictionary<string, ShowCommandModuleInfo> importedModules, IEnumerable<ShowCommandCommandInfo> commands, bool noCommonParameter, double windowWidth, double windowHeight, bool passThrough)
{
@ -924,7 +924,7 @@ Function PSGetSerializedShowCommandInfo
/// Calls ShowsDialog on methodThatReturnsDialog either in a separate thread or dispatched
/// to the hostWindow thread if there is a hostWindow
/// </summary>
/// <param name="cmdlet">cmdlet used to retrieve the host window</param>
/// <param name="cmdlet">Cmdlet used to retrieve the host window.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called from a method called using reflection")]
private void CallShowDialog(PSCmdlet cmdlet)
{
@ -949,7 +949,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Called from CallMethodThatShowsDialog as the thtead start when there is no host window
/// Called from CallMethodThatShowsDialog as the thtead start when there is no host window.
/// </summary>
private void PlainInvokeAndShowDialog()
{
@ -957,13 +957,13 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Shows the window for the cmdlet
/// Shows the window for the cmdlet.
/// </summary>
/// <param name="cmdlet">cmdlet calling this method</param>
/// <param name="commandViewModelObj">command to show in the window</param>
/// <param name="windowWidth">window width</param>
/// <param name="windowHeight">window height</param>
/// <param name="passThrough">true if the GUI should mention ok instead of run</param>
/// <param name="cmdlet">Cmdlet calling this method.</param>
/// <param name="commandViewModelObj">Command to show in the window.</param>
/// <param name="windowWidth">Window width.</param>
/// <param name="windowHeight">Window height.</param>
/// <param name="passThrough">True if the GUI should mention ok instead of run.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private void ShowCommandWindow(PSCmdlet cmdlet, object commandViewModelObj, double windowWidth, double windowHeight, bool passThrough)
{
@ -995,10 +995,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Called when the module importation is done
/// Called when the module importation is done.
/// </summary>
/// <param name="importedModules">all modules currently imported</param>
/// <param name="commands">commands to be displayed</param>
/// <param name="importedModules">All modules currently imported.</param>
/// <param name="commands">Commands to be displayed.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private void ImportModuleDone(Dictionary<string, ShowCommandModuleInfo> importedModules, IEnumerable<ShowCommandCommandInfo> commands)
{
@ -1023,9 +1023,9 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Called when the module importation has failed
/// Called when the module importation has failed.
/// </summary>
/// <param name="reason">reason why the module importation failed</param>
/// <param name="reason">Reason why the module importation failed.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private void ImportModuleFailed(Exception reason)
{
@ -1047,9 +1047,9 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Called when the results or get-help are ready in order to display the help window for a command
/// Called when the results or get-help are ready in order to display the help window for a command.
/// </summary>
/// <param name="getHelpResults">results of a get-help call</param>
/// <param name="getHelpResults">Results of a get-help call.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private void DisplayHelp(Collection<PSObject> getHelpResults)
{
@ -1068,7 +1068,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Activates this.window
/// Activates this.window.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private void ActivateWindow()
@ -1080,9 +1080,9 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// returns the script to execute if dialog has not been canceled
/// Returns the script to execute if dialog has not been canceled.
/// </summary>
/// <returns>the script to execute if dialog has not been canceled</returns>
/// <returns>The script to execute if dialog has not been canceled.</returns>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called using reflection")]
private string GetScript()
{
@ -1097,9 +1097,9 @@ Function PSGetSerializedShowCommandInfo
#region instance private methods used only on this file
/// <summary>
/// Sets up window settings common between the two flavors of show-command
/// Sets up window settings common between the two flavors of show-command.
/// </summary>
/// <param name="commandWindow">the window being displayed</param>
/// <param name="commandWindow">The window being displayed.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called from ShowAllModulesWindow and ShowCommandWindow which are called with reflection")]
private void SetupWindow(Window commandWindow)
{
@ -1109,10 +1109,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Handles the SelectedCommandInSelectedModuleNeedsImportModule event
/// Handles the SelectedCommandInSelectedModuleNeedsImportModule event.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void CommandNeedsImportModule(object sender, ImportModuleEventArgs e)
{
this.commandNeedingImportModule = e.CommandName;
@ -1123,10 +1123,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Handles the SelectedCommandInSelectedModuleNeedsHelp event
/// Handles the SelectedCommandInSelectedModuleNeedsHelp event.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void CommandNeedsHelp(object sender, HelpNeededEventArgs e)
{
this.commandNeedingHelp = e.CommandName;
@ -1134,10 +1134,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Called when the window is closed to set this.dialogCanceled
/// Called when the window is closed to set this.dialogCanceled.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void Window_Closed(object sender, EventArgs e)
{
if (this.hostWindow != null)
@ -1150,10 +1150,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Called when the window is loaded to set this.Window_Loaded
/// Called when the window is loaded to set this.Window_Loaded.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.window.Loaded -= new RoutedEventHandler(this.Window_Loaded);
@ -1161,12 +1161,12 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Sets up event listening on the buttons
/// Sets up event listening on the buttons.
/// </summary>
/// <param name="run">button to run command</param>
/// <param name="copy">button to copy command code</param>
/// <param name="cancel">button to close window</param>
/// <param name="passThrough">true to change the text of Run to OK</param>
/// <param name="run">Button to run command.</param>
/// <param name="copy">Button to copy command code.</param>
/// <param name="cancel">Button to close window.</param>
/// <param name="passThrough">True to change the text of Run to OK.</param>
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called from methods called using reflection")]
private void SetupButtonEvents(Button run, Button copy, Button cancel, bool passThrough)
{
@ -1181,7 +1181,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Sets up event listening for a new viewModel
/// Sets up event listening for a new viewModel.
/// </summary>
private void SetupViewModel()
{
@ -1191,10 +1191,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Copies the script into the clipboard
/// Copies the script into the clipboard.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void Buttons_CopyClick(object sender, RoutedEventArgs e)
{
string script = this.InternalGetScript();
@ -1207,10 +1207,10 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Sets a succesfull dialog result and then closes the window
/// Sets a succesfull dialog result and then closes the window.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void Buttons_RunClick(object sender, RoutedEventArgs e)
{
this.dialogCanceled = false;
@ -1220,15 +1220,15 @@ Function PSGetSerializedShowCommandInfo
/// <summary>
/// Closes the window.
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
/// <param name="sender">Event sender.</param>
/// <param name="e">Event arguments.</param>
private void Buttons_CancelClick(object sender, RoutedEventArgs e)
{
this.CloseWindow();
}
/// <summary>
/// closes the window.
/// Closes the window.
/// </summary>
private void CloseWindow()
{
@ -1267,9 +1267,9 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// returns the script to execute
/// Returns the script to execute.
/// </summary>
/// <returns>the script to execute</returns>
/// <returns>The script to execute.</returns>
private string InternalGetScript()
{
if (this.allModulesViewModel != null)
@ -1286,9 +1286,9 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Implements IDisposable logic
/// Implements IDisposable logic.
/// </summary>
/// <param name="isDisposing">true if being called from Dispose</param>
/// <param name="isDisposing">True if being called from Dispose.</param>
private void Dispose(bool isDisposing)
{
if (isDisposing)

View file

@ -19,7 +19,7 @@ namespace Microsoft.PowerShell.Commands.Internal
private static string StartProcess(
string tool,
string args,
string stdin = "" )
string stdin = "")
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = false;

View file

@ -1914,7 +1914,7 @@ namespace System.Management.Automation
/// <returns></returns>
internal SerializationMethod GetSerializationMethod(TypeTable backupTypeTable)
{
SerializationMethod result = TypeTable.defaultSerializationMethod;
SerializationMethod result = TypeTable.DefaultSerializationMethod;
TypeTable typeTable = backupTypeTable ?? this.GetTypeTable();
if (typeTable != null)
@ -1922,7 +1922,7 @@ namespace System.Management.Automation
PSMemberSet standardMemberSet = TypeTableGetMemberDelegate<PSMemberSet>(this,
typeTable, TypeTable.PSStandardMembers);
result = (SerializationMethod)GetNoteSettingValue(standardMemberSet,
TypeTable.SerializationMethodNode, TypeTable.defaultSerializationMethod, typeof(SerializationMethod), true, this);
TypeTable.SerializationMethodNode, TypeTable.DefaultSerializationMethod, typeof(SerializationMethod), true, this);
}
return result;

File diff suppressed because it is too large Load diff

View file

@ -5725,7 +5725,6 @@ namespace System.Management.Automation.Language
// First look for assignment, since PipelineRule once handled that and this supercedes that.
// We may end up with an expression here as a result,
// in which case we hang on to it to pass it into the first pipeline rule call.
Token assignToken = null;
ExpressionAst expr;
@ -5764,7 +5763,6 @@ namespace System.Management.Automation.Language
{
// ErrorRecovery: we are very likely at EOF because pretty much anything should result in some
// pipeline, so just keep parsing.
IScriptExtent errorExtent = After(assignToken);
ReportIncompleteInput(
errorExtent,
@ -5941,7 +5939,7 @@ namespace System.Management.Automation.Language
// G
// G pipeline-tail:
// G new-lines:opt '|' new-lines:opt command pipeline-tail:opt
//
var pipelineElements = new List<CommandBaseAst>();
IScriptExtent startExtent = null;
@ -5989,7 +5987,6 @@ namespace System.Management.Automation.Language
if (pipelineElements.Count > 0)
{
// ErrorRecovery: this is a semantic error, so just keep parsing.
ReportError(
expr.Extent,
nameof(ParserStrings.ExpressionsMustBeFirstInPipeline),
@ -6008,7 +6005,6 @@ namespace System.Management.Automation.Language
// ErrorRecovery:
// We are likely at EOF, since almost anything else should result in a pipeline,
// so just keep parsing
IScriptExtent errorExtent = After(assignToken);
ReportIncompleteInput(
errorExtent,

View file

@ -5348,7 +5348,7 @@ namespace System.Management.Automation.Language
public abstract class ChainableAst : PipelineBaseAst
{
/// <summary>
/// Construct a new chainable AST with the given extent.
/// Initializes a new instance of the new chainable AST with the given extent.
/// </summary>
/// <param name="extent">The script extent of the AST.</param>
protected ChainableAst(IScriptExtent extent) : base(extent)
@ -5363,7 +5363,7 @@ namespace System.Management.Automation.Language
public class PipelineChainAst : ChainableAst
{
/// <summary>
/// Create a new statement chain AST from two statements and an operator.
/// Initializes a new instance of the new statement chain AST from two statements and an operator.
/// </summary>
/// <param name="extent">The extent of the chained statement.</param>
/// <param name="lhsChain">The pipeline or pipeline chain to the left of the operator.</param>
@ -5403,28 +5403,31 @@ namespace System.Management.Automation.Language
}
/// <summary>
/// The left hand pipeline in the chain.
/// Gets the left hand pipeline in the chain.
/// </summary>
public ChainableAst LhsPipelineChain { get; }
/// <summary>
/// The right hand pipeline in the chain.
/// Gets the right hand pipeline in the chain.
/// </summary>
public PipelineAst RhsPipeline { get; }
/// <summary>
/// The chaining operator used.
/// Gets the chaining operator used.
/// </summary>
public TokenKind Operator { get; }
/// <summary>
/// Indicates whether this chain has been invoked with the background operator.
/// Gets a flag that indicates whether this chain has been invoked with the background operator.
/// </summary>
public bool Background { get; }
/// <summary>
/// Create a copy of this Ast.
/// </summary>
/// <returns>
/// A fresh copy of this PipelineChainAst instance.
/// </returns>
public override Ast Copy()
{
return new PipelineChainAst(Extent, CopyElement(LhsPipelineChain), CopyElement(RhsPipeline), Operator, Background);

View file

@ -3912,7 +3912,7 @@ namespace System.Management.Automation
/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">Breakpoints.</param>
/// <param name="breakpoints">Breakpoints to set.</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints) =>
_wrappedDebugger.SetBreakpoints(breakpoints);

View file

@ -2009,7 +2009,7 @@ namespace System.Management.Automation
/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">Breakpoints.</param>
/// <param name="breakpoints">Breakpoints to set.</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints) =>
_runspace.Debugger?.SetBreakpoints(breakpoints);

View file

@ -525,28 +525,35 @@ namespace System.Management.Automation
var scriptblockBodyString = pipelineAst.Extent.Text;
var pipelineOffset = pipelineAst.Extent.StartOffset;
var variables = pipelineAst.FindAll(x => x is VariableExpressionAst, true);
// Used to make sure that the job runs in the current directory
const string cmdPrefix = @"Microsoft.PowerShell.Management\Set-Location -LiteralPath $using:pwd ; ";
// Minimize allocations by initializing the stringbuilder to the size of the source string + prefix + space for ${using:} * 2
System.Text.StringBuilder updatedScriptblock = new System.Text.StringBuilder(cmdPrefix.Length + scriptblockBodyString.Length + 18);
updatedScriptblock.Append(cmdPrefix);
int position = 0;
// Prefix variables in the scriptblock with $using:
foreach (var v in variables)
{
var vName = ((VariableExpressionAst)v).VariablePath.UserPath;
var variableName = ((VariableExpressionAst)v).VariablePath.UserPath;
// Skip variables that don't exist
if (funcContext._executionContext.EngineSessionState.GetVariable(vName) == null)
if (funcContext._executionContext.EngineSessionState.GetVariable(variableName) == null)
{
continue;
}
// Skip PowerShell magic variables
if (Regex.Match(vName,
if (Regex.Match(
variableName,
"^(global:){0,1}(PID|PSVersionTable|PSEdition|PSHOME|HOST|TRUE|FALSE|NULL)$",
RegexOptions.IgnoreCase | RegexOptions.CultureInvariant).Success == false
)
RegexOptions.IgnoreCase | RegexOptions.CultureInvariant).Success == false)
{
updatedScriptblock.Append(scriptblockBodyString.Substring(position, v.Extent.StartOffset - pipelineOffset - position));
updatedScriptblock.Append("${using:");
updatedScriptblock.Append(CodeGeneration.EscapeVariableName(vName));
updatedScriptblock.Append(CodeGeneration.EscapeVariableName(variableName));
updatedScriptblock.Append('}');
position = v.Extent.EndOffset - pipelineOffset;
}
@ -555,11 +562,13 @@ namespace System.Management.Automation
updatedScriptblock.Append(scriptblockBodyString.Substring(position));
var sb = ScriptBlock.Create(updatedScriptblock.ToString());
var commandInfo = new CmdletInfo("Start-Job", typeof(StartJobCommand));
commandProcessor = context.CommandDiscovery.LookupCommandProcessor(
commandInfo, CommandOrigin.Internal, false, context.EngineSessionState);
commandProcessor = context.CommandDiscovery.LookupCommandProcessor(commandInfo, CommandOrigin.Internal, false, context.EngineSessionState);
var parameter = CommandParameterInternal.CreateParameterWithArgument(
/*parameterAst*/pipelineAst, "ScriptBlock", null,
/*argumentAst*/pipelineAst, sb,
parameterAst: pipelineAst,
"ScriptBlock",
null,
argumentAst: pipelineAst,
sb,
false);
commandProcessor.AddParameter(parameter);
pipelineProcessor.Add(commandProcessor);

View file

@ -20,8 +20,8 @@ namespace TestExe
case "-createchildprocess":
CreateChildProcess(args);
break;
// Used to test functionality depending on $LASTEXITCODE, like &&/|| operators
case "-returncode":
// Used to test functionality depending on $LASTEXITCODE, like &&/|| operators
Console.WriteLine(args[1]);
return int.Parse(args[1]);
default: