Files
RobustToolbox/Robust.Shared/Exceptions/TypeArgumentException.cs
T
SilverandGitHub 25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00

56 lines
1.7 KiB
C#

using System;
using System.Runtime.Serialization;
namespace Robust.Shared.Exceptions
{
/// <summary>
/// Thrown if a method is called with an invalid type argument.
/// For example <see cref="IoC.IoCManager.Register{TInterface, TImplementation}(bool)"/> with an abstract <code>TImplementation</code>.
/// </summary>
[Serializable]
public sealed class TypeArgumentException : Exception
{
/// <summary>
/// The name of the type argument that had invalid data.
/// </summary>
public readonly string TypeArgumentName;
public TypeArgumentException()
{
}
public TypeArgumentException(string message) : base(message)
{
}
public TypeArgumentException(string message, Exception inner) : base(message, inner)
{
}
public TypeArgumentException(string message, string name) : base(message)
{
TypeArgumentName = name;
}
public TypeArgumentException(string message, string name, Exception inner) : base(message, inner)
{
TypeArgumentName = name;
}
private TypeArgumentException(
SerializationInfo info,
StreamingContext context) : base(info, context)
{
TypeArgumentName = info.GetString("TypeArgumentName");
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException(nameof(info));
}
info.AddValue("TypeArgumentName", TypeArgumentName);
base.GetObjectData(info, context);
}
}
}