Click or drag to resize

NotImplementedByException Class

A version of NotImplementedException that takes the throwing type as argument. This is useful in class hierarchies where methods are meant to be overridden by derived types but cannot be made abstract (for example, because of Unity limitations). The exception, when thrown, indicates which class should have implemented the method, but hasn't.
Inheritance Hierarchy

Namespace:  Gamelogic.Extensions
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public class NotImplementedByException : NotImplementedException

The NotImplementedByException type exposes the following members.

Constructors
  NameDescription
Public methodNotImplementedByException
Initializes a new instance of the NotImplementedByException class.
Top
Properties
  NameDescription
Public propertyData (Inherited from Exception.)
Public propertyHelpLink (Inherited from Exception.)
Protected propertyHResult (Inherited from Exception.)
Public propertyInnerException (Inherited from Exception.)
Public propertyMessage (Inherited from Exception.)
Public propertySource (Inherited from Exception.)
Public propertyStackTrace (Inherited from Exception.)
Public propertyTargetSite (Inherited from Exception.)
Top
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetBaseException (Inherited from Exception.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetObjectData (Inherited from Exception.)
Public methodGetType (Inherited from Exception.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Exception.)
Top
Extension Methods
  NameDescription
Public Extension MethodThrowIfNull
Throws a NullReferenceException if the object is null.
(Defined by ObjectExtensions.)
Top
Remarks
This is a develop-time exception, and should generally not be caught.
Examples
In the following example, the derived class does not override the method Method. When Method is called on an instance of DerivedClass, a NotImplementedBy exception will be thrown with DerivedType as parameter, making it easy to see DerivedClass needs to implement Method.
[Abstract]
public class BaseClass
{
    [Abstract]
    public virtual void Method()
    {
        throw new NotImplementedBy(GetType());
    }
}

public class DerivedClass : BaseClass { }
See Also