src/Microsoft/Windows/Registry/InMemory/_Library/InMemoryRegistryKey.cs
/// <summary>
/// Gets the RegistryValueKind for a given object based on its type
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
/// <remarks>
/// <a href="https://referencesource.microsoft.com/#mscorlib/microsoft/win32/registrykey.cs,c23479cd45b3f448"> CalculateValueKind(Object) - Microsoft .NET Framework Reference Source</a>
/// </remarks>
Gets the RegistryValueKind for a given object based on its type
Gets the RegistryValueKind for a given object based on its type
static RegistryValueKind GetValueKind( object value ) {
            if( value is int ) {
                return RegistryValueKind.DWord;
            }
            if( value is Array ) {
                if( value is byte[] ) {
                    return RegistryValueKind.Binary;
                }
                if( value is string[] ) {
                    return RegistryValueKind.MultiString;
                }
                throw new ArgumentException( "Bad array type" );
            }
            return RegistryValueKind.String;
        }
static RegistryValueKind GetValueKind ( object value ) { if ( value is int ) { return RegistryValueKind . DWord ; } if ( value is Array ) { if ( value is byte [ ] ) { return RegistryValueKind . Binary ; } if ( value is string [ ] ) { return RegistryValueKind . MultiString ; } throw new ArgumentException ( " " ) ; } return RegistryValueKind . String ; }
Gets the RegistryValueKind for a given object based on its type
Gets the RegistryValueKind for a given object based on its type
None
value
object
None
remarks
Microsoft .NET Framework Reference Source
Microsoft . NET Framework Reference Source