using System;
using System.Runtime.Serialization;
namespace Samples
{
// Violates this rule
[Serializable]
internal class FirstCustomException : Exception
{
internal FirstCustomException()
{
}
internal FirstCustomException(string message)
: base(message)
{
}
internal FirstCustomException(string message, Exception innerException)
: base(message, innerException)
{
}
protected FirstCustomException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
// Violates this rule
[Serializable]
public class SecondCustomException : Exception
{
public SecondCustomException()
{
}
public SecondCustomException(string message)
: base(message)
{
}
public SecondCustomException(string message, Exception innerException)
: base(message, innerException)
{
}
protected SecondCustomException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
// Violates this rule
[Serializable]
internal class ThirdCustomException : SecondCustomException
{
internal ThirdCustomException()
{
}
internal ThirdCustomException(string message)
: base(message)
{
}
internal ThirdCustomException(string message, Exception innerException)
: base(message, innerException)
{
}
protected ThirdCustomException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}