Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -61,11 +61,9 @@ namespace Microsoft.Win32 {
void SetValue (RegistryKey rkey, string name, object value, RegistryValueKind valueKind);
#if NET_4_0
RegistryKey CreateSubKey (RegistryKey rkey, string keyname, RegistryOptions options);
RegistryKey FromHandle (SafeRegistryHandle handle);
IntPtr GetHandle (RegistryKey key);
#endif
}
}

View File

@@ -46,9 +46,7 @@ namespace Microsoft.Win32
public static readonly RegistryKey CurrentUser = new RegistryKey (
RegistryHive.CurrentUser);
#if NET_4_0
[Obsolete ("Use PerformanceData instead")]
#endif
public static readonly RegistryKey DynData = new RegistryKey (
RegistryHive.DynData);
public static readonly RegistryKey LocalMachine = new RegistryKey (
@@ -93,7 +91,7 @@ namespace Microsoft.Win32
}
for (int i = 1; i < keys.Length; i++){
RegistryKey nkey = key.OpenSubKey (keys [i], true);
RegistryKey nkey = key.OpenSubKey (keys [i], setting);
if (nkey == null){
if (!setting)
return null;

View File

@@ -55,9 +55,7 @@ namespace Microsoft.Win32
// RegistryKey object
//
object handle;
#if NET_4_0
SafeRegistryHandle safe_handle;
#endif
object hive; // the RegistryHive if the key represents a base key
readonly string qname; // the fully qualified registry key name
@@ -110,11 +108,7 @@ namespace Microsoft.Win32
/// Dispose of registry key object. Close the
/// key if it's still open.
/// </summary>
#if NET_4_0
public void Dispose ()
#else
void IDisposable.Dispose ()
#endif
{
GC.SuppressFinalize (this);
Close ();
@@ -163,9 +157,7 @@ namespace Microsoft.Win32
RegistryApi.Close (this);
handle = null;
#if NET_4_0
safe_handle = null;
#endif
}
@@ -192,7 +184,6 @@ namespace Microsoft.Win32
}
}
#if NET_4_0
[ComVisible (false)]
[MonoTODO ("Not implemented in Unix")]
public SafeRegistryHandle Handle {
@@ -215,7 +206,6 @@ namespace Microsoft.Win32
return RegistryView.Default;
}
}
#endif
/// <summary>
@@ -341,7 +331,6 @@ namespace Microsoft.Win32
return CreateSubKey (subkey);
}
#if NET_4_0
[ComVisible (false)]
[MonoLimitation ("permissionCheck is ignored in Mono")]
public RegistryKey CreateSubKey (string subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions options)
@@ -363,7 +352,6 @@ namespace Microsoft.Win32
{
return CreateSubKey (subkey, permissionCheck, registryOptions);
}
#endif
/// <summary>
@@ -415,9 +403,7 @@ namespace Microsoft.Win32
DeleteSubKeyTree (subkey, true);
}
#if NET_4_0
public
#endif
void DeleteSubKeyTree (string subkey, bool throwOnMissingSubKey)
{
// Note: this is done by deleting sub-nodes recursively.
@@ -501,7 +487,6 @@ namespace Microsoft.Win32
return RegistryApi.GetValueNames (this);
}
#if NET_4_0
[ComVisible (false)]
[SecurityPermission (SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
[MonoTODO ("Not implemented on unix")]
@@ -520,7 +505,6 @@ namespace Microsoft.Win32
{
return FromHandle (handle);
}
#endif
[MonoTODO ("Not implemented on unix")]
@@ -531,7 +515,6 @@ namespace Microsoft.Win32
return RegistryApi.OpenRemoteBaseKey (hKey, machineName);
}
#if NET_4_0
[ComVisible (false)]
[MonoTODO ("Not implemented on unix")]
public static RegistryKey OpenRemoteBaseKey (RegistryHive hKey, string machineName, RegistryView view)
@@ -564,7 +547,6 @@ namespace Microsoft.Win32
throw new ArgumentException ("hKey");
}
#endif
[ComVisible (false)]
public RegistryKey OpenSubKey (string name, RegistryKeyPermissionCheck permissionCheck)

View File

@@ -23,7 +23,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
using System;
namespace Microsoft.Win32 {
@@ -35,5 +34,4 @@ namespace Microsoft.Win32 {
}
}
#endif

View File

@@ -40,9 +40,7 @@ namespace Microsoft.Win32
DWord,
MultiString = 7,
QWord = 11,
#if NET_4_0
None = -1
#endif
}
}

View File

@@ -23,7 +23,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
using System;
namespace Microsoft.Win32 {
@@ -35,5 +34,4 @@ namespace Microsoft.Win32 {
}
}
#endif

View File

@@ -819,12 +819,10 @@ namespace Microsoft.Win32 {
return CreateSubKey (rkey, keyname, true);
}
#if NET_4_0
public RegistryKey CreateSubKey (RegistryKey rkey, string keyname, RegistryOptions options)
{
return CreateSubKey (rkey, keyname, true, options == RegistryOptions.Volatile);
}
#endif
public RegistryKey OpenRemoteBaseKey (RegistryHive hKey, string machineName)
{
@@ -848,12 +846,10 @@ namespace Microsoft.Win32 {
return result;
}
#if NET_4_0
public RegistryKey FromHandle (SafeRegistryHandle handle)
{
throw new NotImplementedException ();
}
#endif
public void Flush (RegistryKey rkey)
{
@@ -991,12 +987,10 @@ namespace Microsoft.Win32 {
return RegistryValueKind.Unknown;
}
#if NET_4_0
public IntPtr GetHandle (RegistryKey key)
{
throw new NotImplementedException ();
}
#endif
}
}

View File

@@ -443,19 +443,16 @@ namespace Microsoft.Win32
{
if (!IsHandleValid (rkey))
return;
#if NET_4_0
SafeRegistryHandle safe_handle = rkey.Handle;
if (safe_handle != null) {
// closes the unmanaged pointer for us.
safe_handle.Close ();
return;
}
#endif
IntPtr handle = GetHandle (rkey);
RegCloseKey (handle);
}
#if NET_4_0
public RegistryKey FromHandle (SafeRegistryHandle handle)
{
// At this point we can't tell whether the key is writable
@@ -463,7 +460,6 @@ namespace Microsoft.Win32
// .Net seems to do.
return new RegistryKey (handle.DangerousGetHandle (), String.Empty, true);
}
#endif
public RegistryKey CreateSubKey (RegistryKey rkey, string keyName)
{
@@ -485,7 +481,6 @@ namespace Microsoft.Win32
true);
}
#if NET_4_0
public RegistryKey CreateSubKey (RegistryKey rkey, string keyName, RegistryOptions options)
{
IntPtr handle = GetHandle (rkey);
@@ -504,7 +499,6 @@ namespace Microsoft.Win32
return new RegistryKey (subKeyHandle, CombineName (rkey, keyName),
true);
}
#endif
public void DeleteKey (RegistryKey rkey, string keyName, bool shouldThrowWhenKeyMissing)
{