< Dice‎ | MacroRegistry
Revision as of 21:49, 15 September 2017 by Skizzerz (talk | contribs) (Created page with "{{APIdoc|MacroRegistry.RegisterType<T> Method (T)}} Registers all public static and instance methods marked with the {{l|DiceMacroAttribute}} on the type, using the passed-in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MacroRegistry.RegisterType<T> Method (T)

From DiceRoller Documentation

Registers all public static and instance methods marked with the DiceMacroAttribute on the type, using the passed-in object when calling instance methods.

  • Namespace: Dice
  • Assembly: DiceRoller (in DiceRoller.dll)

Syntax

public void RegisterType<T>(
    T obj
)

Parameters

obj
Type: T
Object to use when invoking instance methods.

Type Parameters

T
Type whose methods will be registered.

Exceptions

Exception Condition
InvalidOperationException A DiceMacroAttribute was applied to a public method that is not a valid MacroCallback.

- or -

A macro with the same name has already been registered.

Remarks

Non-public methods are not registered, and therefore not examined. Nothing will happen if you apply this attribute to a non-public method, and no exceptions will be thrown.

See Also