// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Globalization; using System.Runtime.Serialization; using Microsoft.Build.BuildEngine.Shared; namespace Microsoft.Build.BuildEngine { /// /// Generic exception used to wrap exceptions thrown during Registry access. /// [Serializable] internal class RegistryException : Exception { /// /// Basic constructor. /// public RegistryException() : base() { } /// /// Basic constructor. /// /// public RegistryException(string message) : base(message) { } /// /// Basic constructor. /// /// /// public RegistryException(string message, Exception innerException) : base(message, innerException) { } /// /// Constructor that takes a string description of the registry /// key or value causing the error. /// /// /// public RegistryException(string message, string source) : base(message) { base.Source = source; } /// /// Since this class implements Iserializable this constructor is required to be implemented. /// protected RegistryException(SerializationInfo info, StreamingContext context) : base(info, context) { // We don't have any reason at the moment to do any custom serizlization or deserialization, this methods was added // to conform to the implementation of the standard constructors for ISerializable classes } /// /// Constructor that takes a string description of the registry /// key or value causing the error. /// /// /// /// public RegistryException(string message, string source, Exception innerException) : base(message, innerException) { base.Source = source; } } }