Files
PowerShell/src/System.Management.Automation/engine/PSClassInfo.cs
T

91 lines
2.7 KiB
C#
Raw Normal View History

//-----------------------------------------------------------------------
// <copyright file="DscResourceInfo.cs" company="Microsoft Corporation">
// Copyright (C) 2013 Microsoft Corporation
// </copyright>
//-----------------------------------------------------------------------
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace System.Management.Automation
{
/// <summary>
/// Contains a PS Class information
/// </summary>
2016-07-29 13:02:49 -07:00
public sealed class PSClassInfo
{
/// <summary>
/// Initializes a new instance of the PSClassInfo class
/// </summary>
2017-01-16 13:31:14 -08:00
/// <param name="name">Name of the PS Class.</param>
2016-07-29 13:02:49 -07:00
internal PSClassInfo(string name)
{
2016-07-29 13:02:49 -07:00
this.Name = name;
}
2016-07-29 13:02:49 -07:00
/// <summary>
/// Name of the class.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Collection of members of the class.
/// </summary>
public ReadOnlyCollection<PSClassMemberInfo> Members { get; private set; }
2016-07-29 13:02:49 -07:00
/// <summary>
/// Updates members of the class.
/// </summary>
/// <param name="members">Updated members</param>
public void UpdateMembers(IList<PSClassMemberInfo> members)
{
if (members != null)
this.Members = new ReadOnlyCollection<PSClassMemberInfo>(members);
}
/// <summary>
/// Module in which the class is implemented in.
/// </summary>
2016-07-29 13:02:49 -07:00
public PSModuleInfo Module { get; internal set; }
/// <summary>
/// Gets the help file path for the cmdlet.
/// </summary>
2016-08-02 13:29:09 -07:00
public string HelpFile { get; internal set; } = String.Empty;
}
/// <summary>
/// Contains a class field information
/// </summary>
public sealed class PSClassMemberInfo
{
/// <summary>
/// Initializes a new instance of the PSClassMemberInfo class
/// </summary>
internal PSClassMemberInfo(string name, string memberType, string defaultValue)
{
if (String.IsNullOrEmpty(name))
throw new ArgumentNullException("name");
this.Name = name;
this.TypeName = memberType;
this.DefaultValue = defaultValue;
}
/// <summary>
/// Gets or sets name of the member
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Gets or sets type of the member
/// </summary>
public string TypeName { get; private set; }
2016-07-29 13:02:49 -07:00
/// <summary>
/// Default value of the Field.
/// </summary>
2016-07-29 13:02:49 -07:00
public string DefaultValue { get; private set; }
}
}