Initial run of code formatter

I (Jason Shirk) ran https://github.com/dotnet/codeformatter with the default rules, basically:

    codeformatter /nocopyright "/c:DEBUG,UNIX,CORECLR" @files.rsp

This caused a few problems building, which were fixed up manually.

Notable changes:

`this.` is removed unless needed to disambiguate.
private instance fields are renamed to have a `_` prefix.
private static fields are renamed to have a `s_` prefix.

I left some projects alone (like PackageManagement) and also left some generated code alone.
This commit is contained in:
PowerShell Team authored and Jason Shirk (POWERSHELL) committed 2016-08-01 15:57:03 -07:00
1 parent bc4fe11888
commit 403ae3f53f
953 files changed
+71009 -64819

No files matched your search

@@ -16,9 +16,9 @@ using Microsoft.Win32;
namespace System.Management.Automation
{
#region Reflection and Type related extensions
#region Reflection and Type related extensions
#region Enums
#region Enums
[Flags]
internal enum MemberTypes
@@ -31,7 +31,7 @@ namespace System.Management.Automation
All = 0xbf,
}
#endregion Enums
#endregion Enums
/// <summary>
/// The type extension methods within this partial class are only used for CoreCLR powershell.
@@ -42,17 +42,17 @@ namespace System.Management.Automation
/// </summary>
internal static partial class PSTypeExtensions
{
#region Miscs
#region Miscs
internal static bool IsSubclassOf(this Type targetType, Type type)
{
return targetType.GetTypeInfo().IsSubclassOf(type);
}
#endregion Miscs
#endregion Miscs
#region Interface
#region Interface
internal static Type GetInterface(this Type type, string name)
{
// The search is case-sensitive, as it's in the full CLR version
@@ -66,10 +66,10 @@ namespace System.Management.Automation
implementedInterface => String.Equals(name, implementedInterface.Name, stringComparison));
}
#endregion Interface
#endregion Interface
#region Member
#region Member
internal static MemberInfo[] GetMember(this Type type, string name, MemberTypes memberType, BindingFlags bindingAttr)
{
if (bindingAttr == 0)
@@ -105,10 +105,10 @@ namespace System.Management.Automation
return members.ToArray();
}
#endregion Member
#endregion Member
#region Field
#region Field
internal static FieldInfo[] GetFields(this Type type, string name, BindingFlags bindingFlags)
{
return GetFields(type, name, bindingFlags, false);
@@ -188,10 +188,10 @@ namespace System.Management.Automation
return fields.ToArray();
}
#endregion Field
#endregion Field
#region Property
#region Property
internal static PropertyInfo[] GetProperties(this Type type, string name, BindingFlags bindingFlags)
{
return GetProperties(type, name, bindingFlags, false);
@@ -272,7 +272,7 @@ namespace System.Management.Automation
return properties.ToArray();
}
#region Property Helper Methods
#region Property Helper Methods
private static bool IsInstanceProperty(PropertyInfo property)
{
@@ -364,11 +364,11 @@ namespace System.Management.Automation
return true;
}
#endregion Property Helper Methods
#endregion Property Helper Methods
#endregion Property
#endregion Property
#region Constructor
#region Constructor
/// <summary>
/// Search for a constructor that matches the specified bindingFlags and parameter types
@@ -389,7 +389,7 @@ namespace System.Management.Automation
return results != null ? GetMatchingConstructor(results, types) : null;
}
internal static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingFlags, string binderNotUsed,
internal static ConstructorInfo GetConstructor(this Type type, BindingFlags bindingFlags, string binderNotUsed,
CallingConventions callConvention, Type[] types, string modifiersNotUsed)
{
if (binderNotUsed != null || modifiersNotUsed != null)
@@ -523,9 +523,9 @@ namespace System.Management.Automation
return ctors.ToArray();
}
#endregion Constructor
#endregion Constructor
#region Method
#region Method
internal static MethodInfo GetMethod(this Type targetType, string name, BindingFlags bindingFlags, string binderNotUsed, Type[] types, string modifierNotUsed)
{
@@ -696,11 +696,11 @@ namespace System.Management.Automation
return methods.ToArray();
}
#endregion Method
#endregion Method
#region TypeCode
#region TypeCode
private static readonly Dictionary<Type, TypeCode> TypeCodeMap =
private static readonly Dictionary<Type, TypeCode> s_typeCodeMap =
new Dictionary<Type, TypeCode>()
{
// 'DBNull = 2' is removed from 'System.TypeCode' in CoreCLR. We return
@@ -720,7 +720,7 @@ namespace System.Management.Automation
{typeof(Double),TypeCode.Double},
{typeof(string),TypeCode.String},
{typeof(Decimal),TypeCode.Decimal},
{typeof(DateTime),TypeCode.DateTime},
{typeof(DateTime),TypeCode.DateTime},
};
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -728,19 +728,19 @@ namespace System.Management.Automation
{
if (type == null)
return TypeCode.Empty;
if (TypeCodeMap.ContainsKey(type))
return TypeCodeMap[type];
if (s_typeCodeMap.ContainsKey(type))
return s_typeCodeMap[type];
if (type.GetTypeInfo().IsEnum)
return GetTypeCode(Enum.GetUnderlyingType(type));
return TypeCode.Object;
}
#endregion TypeCode
#endregion TypeCode
}
#endregion Reflection and Type related extensions
#endregion Reflection and Type related extensions
#region Environment Extensions
#region Environment Extensions
// TODO:CORECLR - Environment Extensions need serious work to refine.
internal enum EnvironmentVariableTarget
{
@@ -751,13 +751,13 @@ namespace System.Management.Automation
internal static partial class Environment
{
#region Forward_To_System.Environment
#region Forward_To_System.Environment
#region Properties
#region Properties
public static int CurrentManagedThreadId
{
get
{
get
{
return System.Environment.CurrentManagedThreadId;
}
@@ -803,9 +803,9 @@ namespace System.Management.Automation
}
}
#endregion Properties
#endregion Properties
#region Methods
#region Methods
public static string ExpandEnvironmentVariables(string name)
{
@@ -867,19 +867,19 @@ namespace System.Management.Automation
System.Environment.SetEnvironmentVariable(variable, value);
}
#endregion Methods
#endregion Methods
#endregion Forward_To_System.Environment
#endregion Forward_To_System.Environment
private const int MaxMachineNameLength = 256;
private static string[] commandLineArgs = new string[0];
private static string[] s_commandLineArgs = new string[0];
public static string[] GetCommandLineArgs()
{
return commandLineArgs;
return s_commandLineArgs;
}
#region EnvironmentVariable_Extensions
#region EnvironmentVariable_Extensions
/// <summary>
/// The code is mostly copied from the .NET implementation.
@@ -982,9 +982,9 @@ namespace System.Management.Automation
#endif
}
#endregion EnvironmentVariable_Extensions
#endregion EnvironmentVariable_Extensions
#region Property_Extensions
#region Property_Extensions
internal static string WinGetUserDomainName()
{
@@ -1028,7 +1028,7 @@ namespace System.Management.Automation
}
}
}
internal static string WinGetUserName()
{
StringBuilder domainName = new StringBuilder(1024);
@@ -1083,11 +1083,11 @@ namespace System.Management.Automation
{
get
{
if (m_os == null)
if (s_os == null)
{
if (Platform.IsWindows)
{
m_os = WinOSVersion;
s_os = WinOSVersion;
}
else
{
@@ -1096,13 +1096,13 @@ namespace System.Management.Automation
// Porting note: cannot put this in CorePsPlatform since
// System.Management.Automation.Environment only exists in CoreCLR
// builds of monad.
m_os = new Environment.OperatingSystem(new Version(1,0,0,0),"");
s_os = new Environment.OperatingSystem(new Version(1, 0, 0, 0), "");
}
}
return m_os;
return s_os;
}
}
private static volatile OperatingSystem m_os;
private static volatile OperatingSystem s_os;
/// <summary>
/// Windows OSVersion implementation
@@ -1123,10 +1123,10 @@ namespace System.Management.Automation
return new OperatingSystem(v, osviex.CSDVersion);
}
}
#endregion Property_Extensions
#region SpecialFolder_Extensions
#endregion Property_Extensions
#region SpecialFolder_Extensions
/// <summary>
/// The code is copied from the .NET implementation.
@@ -1223,9 +1223,9 @@ namespace System.Management.Automation
return folderPath ?? string.Empty;
}
#endregion SpecialFolder_Extensions
#endregion SpecialFolder_Extensions
#region NativeMethods
#region NativeMethods
/// <summary>
/// DllImport uses the ApiSet dll that is available on CSS, since this code
@@ -1244,7 +1244,7 @@ namespace System.Management.Automation
internal static extern byte GetUserNameEx(int format, [Out] StringBuilder domainName, ref uint domainNameLen);
[DllImport("api-ms-win-core-localization-l1-2-1.dll", CharSet = CharSet.Unicode)]
internal static extern int FormatMessage(int dwFlags, IntPtr lpSource, int dwMessageId,
internal static extern int FormatMessage(int dwFlags, IntPtr lpSource, int dwMessageId,
int dwLanguageId, [Out]StringBuilder lpBuffer,
int nSize, IntPtr va_list_arguments);
@@ -1291,9 +1291,9 @@ namespace System.Management.Automation
}
}
#endregion NativeMethods
#endregion NativeMethods
#region NestedTypes
#region NestedTypes
// Porting note: MyDocuments does not exist on .NET Core, but Personal does, and
// they both point to your "documents repository," which on linux, is just the
@@ -1367,12 +1367,12 @@ namespace System.Management.Automation
}
}
#endregion NestedTypes
#endregion NestedTypes
}
#endregion Environment Extensions
#endregion Environment Extensions
#region Non-generic collection extensions
#region Non-generic collection extensions
/// <summary>
/// Add the AttributeCollection type with stripped functionalities for powershell on CoreCLR.
@@ -1388,7 +1388,7 @@ namespace System.Management.Automation
/// </summary>
public static readonly AttributeCollection Empty = new AttributeCollection(null);
#region Constructors
#region Constructors
/// <summary>
/// AttributeCollection protected constructor
@@ -1396,7 +1396,7 @@ namespace System.Management.Automation
protected AttributeCollection()
{
}
/// <summary>
/// AttributeCollection public constructor
/// </summary>
@@ -1408,7 +1408,7 @@ namespace System.Management.Automation
attributes = new Attribute[0];
}
this._attributes = attributes;
_attributes = attributes;
for (int i = 0; i < attributes.Length; i++)
{
if (attributes[i] == null)
@@ -1418,9 +1418,9 @@ namespace System.Management.Automation
}
}
#endregion Constructors
#endregion Constructors
#region Methods
#region Methods
/// <summary>
/// Copies the collection to an array, starting at the specified index.
@@ -1446,9 +1446,9 @@ namespace System.Management.Automation
return this.GetEnumerator();
}
#endregion Methods
#endregion Methods
#region Properties
#region Properties
private readonly Attribute[] _attributes;
/// <summary>
@@ -1459,7 +1459,7 @@ namespace System.Management.Automation
{
get
{
return this._attributes;
return _attributes;
}
}
@@ -1511,12 +1511,12 @@ namespace System.Management.Automation
}
}
#endregion Properties
#endregion Properties
}
#endregion Non-generic collection extensions
#endregion Non-generic collection extensions
#region Misc extensions
#region Misc extensions
/// <summary>
/// Add the Pointer type with stripped functionalities for PowerShell on CoreCLR.
@@ -1531,7 +1531,7 @@ namespace System.Management.Automation
{
}
#region Methods
#region Methods
/// <summary>
/// Boxes the supplied unmanaged memory pointer and the type associated with that pointer into a managed Pointer wrapper object.
@@ -1572,7 +1572,7 @@ namespace System.Management.Automation
return ((Pointer)ptr)._ptr;
}
#endregion Methods
#endregion Methods
}
internal static class ListExtensions
@@ -1609,7 +1609,7 @@ namespace System.Management.Automation
}
}
#endregion Misc extensions
#endregion Misc extensions
}
@@ -1631,7 +1631,7 @@ namespace Microsoft.PowerShell.CoreCLR
public static Assembly LoadFrom(string assemblyPath)
{
return ClrFacade.LoadFrom(assemblyPath);
}
}
/// <summary>
/// Load an assembly given its byte stream
@@ -21,7 +21,6 @@ using SpecialFolder = System.Management.Automation.Environment.SpecialFolder;
namespace System.Management.Automation
{
/// <summary>
/// These are platform abstractions and platform specific implementations
///
@@ -30,7 +29,6 @@ namespace System.Management.Automation
/// </summary>
public static class Platform
{
/// <summary>
/// True if the current platform is Linux.
/// </summary>
@@ -38,11 +36,11 @@ namespace System.Management.Automation
{
get
{
#if CORECLR
#if CORECLR
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
#else
#else
return false;
#endif
#endif
}
}
@@ -53,11 +51,11 @@ namespace System.Management.Automation
{
get
{
#if CORECLR
#if CORECLR
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
#else
#else
return false;
#endif
#endif
}
}
@@ -68,11 +66,11 @@ namespace System.Management.Automation
{
get
{
#if CORECLR
#if CORECLR
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#else
#else
return true;
#endif
#endif
}
}
@@ -83,11 +81,11 @@ namespace System.Management.Automation
{
get
{
#if CORECLR
#if CORECLR
return true;
#else
#else
return false;
#endif
#endif
}
}
@@ -127,20 +125,20 @@ namespace System.Management.Automation
/// <summary>
/// function for choosing directory location of PowerShell for profile loading
/// </summary>
public static string SelectProductNameForDirectory (Platform.XDG_Type dirpath)
public static string SelectProductNameForDirectory(Platform.XDG_Type dirpath)
{
//TODO: XDG_DATA_DIRS implementation as per GitHub issue #1060
string xdgconfighome = System.Environment.GetEnvironmentVariable("XDG_CONFIG_HOME");
string xdgdatahome = System.Environment.GetEnvironmentVariable("XDG_DATA_HOME");
string xdgcachehome = System.Environment.GetEnvironmentVariable("XDG_CACHE_HOME");
string xdgConfigHomeDefault = Path.Combine ( System.Environment.GetEnvironmentVariable("HOME"), ".config", "powershell");
string xdgDataHomeDefault = Path.Combine( System.Environment.GetEnvironmentVariable("HOME"), ".local", "share", "powershell");
string xdgModuleDefault = Path.Combine ( xdgDataHomeDefault, "Modules");
string xdgCacheDefault = Path.Combine (System.Environment.GetEnvironmentVariable("HOME"), ".cache", "powershell");
string xdgConfigHomeDefault = Path.Combine(System.Environment.GetEnvironmentVariable("HOME"), ".config", "powershell");
string xdgDataHomeDefault = Path.Combine(System.Environment.GetEnvironmentVariable("HOME"), ".local", "share", "powershell");
string xdgModuleDefault = Path.Combine(xdgDataHomeDefault, "Modules");
string xdgCacheDefault = Path.Combine(System.Environment.GetEnvironmentVariable("HOME"), ".cache", "powershell");
switch (dirpath){
switch (dirpath)
{
case Platform.XDG_Type.CONFIG:
//the user has set XDG_CONFIG_HOME corrresponding to profile path
if (String.IsNullOrEmpty(xdgconfighome))
@@ -156,8 +154,8 @@ namespace System.Management.Automation
case Platform.XDG_Type.DATA:
//the user has set XDG_DATA_HOME corresponding to module path
if (String.IsNullOrEmpty(xdgdatahome)){
if (String.IsNullOrEmpty(xdgdatahome))
{
// create the xdg folder if needed
if (!Directory.Exists(xdgDataHomeDefault))
{
@@ -172,8 +170,8 @@ namespace System.Management.Automation
case Platform.XDG_Type.MODULES:
//the user has set XDG_DATA_HOME corresponding to module path
if (String.IsNullOrEmpty(xdgdatahome)){
if (String.IsNullOrEmpty(xdgdatahome))
{
//xdg values have not been set
if (!Directory.Exists(xdgModuleDefault)) //module folder not always guaranteed to exist
{
@@ -218,18 +216,18 @@ namespace System.Management.Automation
//This folder is the default in the event of all other failures for data storage
if (!Directory.Exists(xdgConfigHomeDefault))
{
try {
try
{
Directory.CreateDirectory(xdgConfigHomeDefault);
}
catch{
catch
{
Console.Error.WriteLine("Failed to create default data directory: " + xdgConfigHomeDefault);
}
}
return xdgConfigHomeDefault;
}
}
// Platform methods prefixed NonWindows are:
@@ -273,12 +271,12 @@ namespace System.Management.Automation
return Unix.NativeMethods.GetUserFromPid(path);
}
#if CORECLR
#if CORECLR
internal static string NonWindowsGetFolderPath(SpecialFolder folder)
{
return Unix.GetFolderPath(folder);
}
#endif
#endif
internal static string NonWindowsInternalGetLinkType(FileSystemInfo fileInfo)
{
@@ -371,21 +369,21 @@ namespace System.Management.Automation
internal static class Unix
{
private static string _userName;
private static string s_userName;
public static string UserName
{
get
{
if (string.IsNullOrEmpty(_userName))
if (string.IsNullOrEmpty(s_userName))
{
_userName = NativeMethods.GetUserName();
if (string.IsNullOrEmpty(_userName))
s_userName = NativeMethods.GetUserName();
if (string.IsNullOrEmpty(s_userName))
{
int lastError = Marshal.GetLastWin32Error();
throw new InvalidOperationException("Unix.UserName error: " + lastError);
}
}
return _userName;
return s_userName;
}
}
@@ -408,7 +406,7 @@ namespace System.Management.Automation
}
}
#if CORECLR
#if CORECLR
public static string GetFolderPath(SpecialFolder folder)
{
string s = null;
@@ -441,7 +439,7 @@ namespace System.Management.Automation
}
return s;
}
#endif
#endif
public static bool IsHardLink(ref IntPtr handle)
{
@@ -469,7 +467,6 @@ namespace System.Management.Automation
int lastError = Marshal.GetLastWin32Error();
throw new InvalidOperationException("Unix.IsHardLink error: " + lastError);
}
}
public static void SetDate(SetDateInfoInternal info)
@@ -521,7 +518,7 @@ namespace System.Management.Automation
internal static class NativeMethods
{
const string psLib = "libpsl-native";
private const string psLib = "libpsl-native";
// Ansi is a misnomer, it is hardcoded to UTF-8 on Linux and OS X
@@ -573,8 +570,6 @@ namespace System.Management.Automation
[DllImport(psLib, CharSet = CharSet.Ansi, SetLastError = true)]
[return: MarshalAs(UnmanagedType.I1)]
internal static extern bool IsDirectory([MarshalAs(UnmanagedType.LPStr)]string filePath);
}
}
} // namespace System.Management.Automation
@@ -24,7 +24,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
// We create some stub attribute types to make some attribute markers work in CoreCLR.
// The purpose of this is to avoid #if/def in powershell code as much as possible.
#region Attribute_Related
#region Attribute_Related
/// <summary>
/// Stub for SpecialNameAttribute
@@ -34,7 +34,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// <summary>
///
/// </summary>
public SpecialNameAttribute() {}
public SpecialNameAttribute() { }
}
/// <summary>
@@ -45,7 +45,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// <summary>
///
/// </summary>
public SerializableAttribute() {}
public SerializableAttribute() { }
}
/// <summary>
@@ -56,7 +56,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// <summary>
///
/// </summary>
public NonSerializedAttribute() {}
public NonSerializedAttribute() { }
}
/// <summary>
@@ -76,9 +76,9 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// </summary>
public sealed class SecurityPermissionAttribute : Attribute
{
public SecurityPermissionAttribute(SecurityAction action) {}
public SecurityPermissionAttribute(SecurityAction action) { }
public bool SerializationFormatter { get; set; }
public bool UnmanagedCode { get; set; }
}
@@ -91,7 +91,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
///
/// </summary>
/// <param name="flags"></param>
public TypeLibTypeAttribute(short flags) {}
public TypeLibTypeAttribute(short flags) { }
}
/// <summary>
@@ -105,23 +105,24 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// </summary>
public sealed class HostProtectionAttribute : Attribute
{
public HostProtectionAttribute(SecurityAction action) {}
public HostProtectionAttribute(SecurityAction action) { }
public bool MayLeakOnAbort { get; set; }
}
/// <summary>
/// Stub for ResourceExposureAttribute
/// </summary>
public sealed class ResourceExposureAttribute : Attribute
{
private ResourceScope _resourceExposureLevel;
public ResourceExposureAttribute(ResourceScope exposureLevel)
{
_resourceExposureLevel = exposureLevel;
}
public ResourceScope ResourceExposureLevel {
public ResourceScope ResourceExposureLevel
{
get { return _resourceExposureLevel; }
}
}
@@ -133,12 +134,12 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
{
None = 0,
// Resource type
Machine = 0x1,
Process = 0x2,
Machine = 0x1,
Process = 0x2,
AppDomain = 0x4,
Library = 0x8,
Library = 0x8,
// Visibility
Private = 0x10, // Private to this one class.
Private = 0x10, // Private to this one class.
Assembly = 0x20, // Assembly-level, like C#'s "internal"
}
@@ -202,9 +203,9 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
WillNotCorruptState
}
#endregion Attribute_Related
#endregion Attribute_Related
#region Serialization_Related
#region Serialization_Related
/// <summary>
/// Stub for SerializationInfo
@@ -214,7 +215,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// <summary>
///
/// </summary>
public SerializationInfo() {}
public SerializationInfo() { }
/// <summary>
///
@@ -242,7 +243,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="type"></param>
public void AddValue(string name, Object value, Type type)
public void AddValue(string name, Object value, Type type)
{
throw new NotImplementedException("AddValue(string name, Object value, Type type)");
}
@@ -318,9 +319,9 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
}
}
#endregion Serialization_Related
#endregion Serialization_Related
#region Interface_Related
#region Interface_Related
/// <summary>
/// Stub for ISerializable
@@ -378,9 +379,9 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
object this[int index] { get; set; }
}
#endregion Interface_Related
#endregion Interface_Related
#region Exception_Related
#region Exception_Related
/// <summary>
/// Stub for SystemException
@@ -391,33 +392,33 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// SystemException constructor
/// </summary>
public SystemException() : base() { }
/// <summary>
/// SystemException constructor
/// </summary>
/// <param name="message"></param>
public SystemException(string message) : base(message) { }
/// <summary>
/// SystemException constructor
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public SystemException(string message, Exception innerException) : base(message, innerException) {}
public SystemException(string message, Exception innerException) : base(message, innerException) { }
/// <summary>
/// SystemException constructor
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected SystemException(SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
/// <summary>
/// SystemException constructor
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
public virtual void GetObjectData(SerializationInfo info, System.Runtime.Serialization.StreamingContext context) {}
public virtual void GetObjectData(SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
/// <summary>
@@ -429,33 +430,33 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// AccessViolationException constructor
/// </summary>
public AccessViolationException() : base() { }
/// <summary>
/// AccessViolationException constructor
/// </summary>
/// <param name="message"></param>
public AccessViolationException(string message) : base(message) { }
/// <summary>
/// AccessViolationException constructor
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public AccessViolationException(string message, Exception innerException) : base(message, innerException) {}
public AccessViolationException(string message, Exception innerException) : base(message, innerException) { }
/// <summary>
/// AccessViolationException constructor
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected AccessViolationException(SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
/// <summary>
/// AccessViolationException constructor
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
public virtual void GetObjectData(SerializationInfo info, System.Runtime.Serialization.StreamingContext context) {}
public virtual void GetObjectData(SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
/// <summary>
@@ -472,9 +473,9 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
{
}
#endregion Exception_Related
#endregion Exception_Related
#region SafeHandle_Related
#region SafeHandle_Related
/// <summary>
/// Stub for SafeHandleZeroOrMinusOneIsInvalid
@@ -484,7 +485,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// <summary>
/// Constructor
/// </summary>
protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle)
protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle)
: base(IntPtr.Zero, ownsHandle)
{
}
@@ -501,9 +502,9 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
}
}
#endregion SafeHandle_Related
#endregion SafeHandle_Related
#region Misc_Types
#region Misc_Types
/// <summary>
/// Stub for SecurityZone
@@ -524,12 +525,12 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
/// </summary>
public class MailAddress
{
public MailAddress(string address) {}
public MailAddress(string address) { }
}
#endregion Misc_Types
#endregion Misc_Types
#region SystemManagementStubs
#region SystemManagementStubs
// Summary:
// Describes the authentication level to be used to connect to WMI. This is
@@ -602,7 +603,7 @@ namespace Microsoft.PowerShell.CoreClr.Stubs
Delegate = 4,
}
#endregion
#endregion
}
@@ -676,7 +677,7 @@ namespace System.Security
int strLen = str.Length;
int index; // Pointer into the string that indicates the location of the current '&' character
int newIndex = 0; // Pointer into the string that indicates the start index of the "remaining" string (that still needs to be processed).
do
{
index = str.IndexOfAny(s_escapeChars, newIndex);
@@ -731,7 +732,7 @@ namespace System.Security
namespace System.Management.Automation
{
#region PSTransaction
#region PSTransaction
/// <summary>
/// We don't need PSTransaction related types on CSS because System.Transactions
@@ -765,9 +766,9 @@ namespace System.Management.Automation
Never
}
#endregion PSTransaction
#endregion PSTransaction
#region CMS
#region CMS
internal static class CmsUtils
{
@@ -790,9 +791,9 @@ namespace System.Management.Automation
}
}
#endregion CMS
#endregion CMS
#region ApartmentState
#region ApartmentState
internal enum ApartmentState
{
@@ -810,7 +811,7 @@ namespace System.Management.Automation
Unknown = 2
}
#endregion ApartmentState
#endregion ApartmentState
}
namespace System.Management.Automation.Internal
@@ -829,7 +830,7 @@ namespace System.Management.Automation.Internal
/// </remarks>
internal bool HasTransaction
{
get
get
{
return false;
}
@@ -888,7 +889,7 @@ namespace System.Management.Automation.Internal
throw new NotImplementedException("Rollback");
}
public void Dispose() {}
public void Dispose() { }
}
}
@@ -1144,7 +1145,7 @@ namespace Microsoft.PowerShell.Commands.Internal
using System.Security.AccessControl;
using System.Security.Principal;
#region TransactedRegistryKey
#region TransactedRegistryKey
internal abstract class TransactedRegistryKey : IDisposable
{
@@ -1279,12 +1280,13 @@ namespace Microsoft.PowerShell.Commands.Internal
}
}
#endregion TransactedRegistryKey
#endregion TransactedRegistryKey
}
#endregion PS_STUBS
#region TEMPORARY -- Will port the actual PS component [update: Not necessarily porting all PS components listed here]
// -- Will port the actual PS component [update: Not necessarily porting all PS components listed here]
#region TEMPORARY
namespace System.Management.Automation.Internal
{
@@ -1308,7 +1310,7 @@ namespace System.Management.Automation
{
using Microsoft.Win32;
#region RegistryStringResourceIndirect
#region RegistryStringResourceIndirect
internal sealed class RegistryStringResourceIndirect : IDisposable
{
@@ -1343,10 +1345,10 @@ namespace System.Management.Automation
}
}
#endregion
#endregion
#region Environment
#region Environment
internal static partial class Environment
{
//TODO:CORECLR Need to be removed once we decide what will be the replacement
@@ -1354,8 +1356,8 @@ namespace System.Management.Automation
{
}
}
#endregion Environment
#endregion Environment
}
namespace System.Management.Automation.Security
@@ -1366,7 +1368,7 @@ namespace System.Management.Automation.Security
/// </summary>
internal sealed class SystemPolicy
{
private SystemPolicy() {}
private SystemPolicy() { }
/// <summary>
/// Gets the system lockdown policy
@@ -1381,7 +1383,7 @@ namespace System.Management.Automation.Security
/// Gets lockdown policy as applied to a file
/// </summary>
/// <remarks>Always return SystemEnforcementMode.None in CSS (trusted)</remarks>
public static SystemEnforcementMode GetLockdownPolicy(string path, System.Runtime.InteropServices.SafeHandle handle)
public static SystemEnforcementMode GetLockdownPolicy(string path, System.Runtime.InteropServices.SafeHandle handle)
{
return SystemEnforcementMode.None;
}
@@ -1465,13 +1467,13 @@ namespace System.Management.Automation.Tracing
{ }
static internal void LogAnalyticVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
static internal void SetActivityIdForCurrentThread(Guid newActivityId) { }
static internal void LogOperationalVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args){ }
static internal void LogOperationalWarning(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args){ }
static internal void LogOperationalVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
static internal void LogOperationalWarning(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
static internal void ReplaceActivityIdForCurrentThread(Guid newActivityId, PSEventId eventForOperationalChannel, PSEventId eventForAnalyticChannel, PSKeyword keyword, PSTask task) { }
static internal void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
static internal void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad) { }
static internal void LogAnalyticInformational(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args){ }
static internal void LogOperationalInformation(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args){ }
static internal void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad) { }
static internal void LogAnalyticInformational(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
static internal void LogOperationalInformation(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
}
public enum PowerShellTraceTask
@@ -1505,9 +1507,9 @@ namespace System.Management.Automation.Tracing
/// <summary>
/// Defines Keywords.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028")]
[Flags]
public enum PowerShellTraceKeywords : ulong
public enum PowerShellTraceKeywords : ulong
{
/// <summary>
/// None
@@ -1575,16 +1577,16 @@ namespace System.Management.Automation.Tracing
UseAlwaysAnalytic = 0x4000000000000000,
}
public sealed partial class Tracer : System.Management.Automation.Tracing.EtwActivity
public sealed partial class Tracer : System.Management.Automation.Tracing.EtwActivity
{
static Tracer() {}
static Tracer() { }
public void EndpointRegistered(string endpointName, string endpointType, string registeredBy)
{
}
public void EndpointUnregistered(string endpointName, string unregisteredBy)
{
{
}
public void EndpointDisabled(string endpointName, string disabledBy)
@@ -1600,35 +1602,35 @@ namespace System.Management.Automation.Tracing
}
public void BeginContainerParentJobExecution(Guid containerParentJobInstanceId)
{
{
}
public void BeginProxyJobExecution(Guid proxyJobInstanceId)
{
{
}
public void ProxyJobRemoteJobAssociation(Guid proxyJobInstanceId, Guid containerParentJobInstanceId)
{
{
}
public void EndProxyJobExecution(Guid proxyJobInstanceId)
{
{
}
public void BeginProxyJobEventHandler(Guid proxyJobInstanceId)
{
{
}
public void EndProxyJobEventHandler(Guid proxyJobInstanceId)
{
{
}
public void BeginProxyChildJobEventHandler(Guid proxyChildJobInstanceId)
{
{
}
public void EndContainerParentJobExecution(Guid containerParentJobInstanceId)
{
{
}
}
@@ -1655,7 +1657,7 @@ namespace System.Management.Automation.Tracing
/// <returns></returns>
public bool WriteMessage(string message1, string message2)
{
return false;
return false;
}
/// <summary>
@@ -1666,7 +1668,7 @@ namespace System.Management.Automation.Tracing
/// <returns></returns>
public bool WriteMessage(string message, Guid instanceId)
{
return false;
return false;
}
@@ -1681,7 +1683,7 @@ namespace System.Management.Automation.Tracing
/// <returns></returns>
public void WriteMessage(string className, string methodName, Guid workflowId, string message, params string[] parameters)
{
return ;
return;
}
/// <summary>
@@ -1696,16 +1698,16 @@ namespace System.Management.Automation.Tracing
/// <returns></returns>
public void WriteMessage(string className, string methodName, Guid workflowId, Job job, string message, params string[] parameters)
{
return;
return;
}
public bool TraceException(Exception exception)
public bool TraceException(Exception exception)
{
return false;
return false;
}
}
/// <summary>
/// <summary>
/// TraceSourceFactory will return an instance of TraceSource every time GetTraceSource method is called.
/// </summary>
public static class PowerShellTraceSourceFactory
@@ -1757,8 +1759,8 @@ namespace Microsoft.PowerShell
{
internal static class NativeCultureResolver
{
internal static void SetThreadUILanguage(Int16 langId) {}
internal static void SetThreadUILanguage(Int16 langId) { }
internal static CultureInfo UICulture
{
get
@@ -1779,7 +1781,7 @@ namespace Microsoft.PowerShell
#endregion TEMPORARY
#region Timer
namespace System
@@ -1801,29 +1803,29 @@ namespace System
//
// isTerminating:
// true if the runtime is terminating; otherwise, false.
public UnhandledExceptionEventArgs(object exception, bool isTerminating) {}
public UnhandledExceptionEventArgs(object exception, bool isTerminating) { }
// Summary:
// Gets the unhandled exception object.
//
// Returns:
// The unhandled exception object.
public object ExceptionObject
{
public object ExceptionObject
{
get
{
{
return null;
}
}
//
// Summary:
// Indicates whether the common language runtime is terminating.
//
// Returns:
// true if the runtime is terminating; otherwise, false.
public bool IsTerminating
{
public bool IsTerminating
{
get
{
return false;