Skip to content

BizArk.Core.ClassFactory

Brian Brewder edited this page Mar 31, 2017 · 1 revision

Back to BizArk.Core API Reference

A simple but extensible class factory. Used by BizArk to create some internal objects.

The class factory, by default, can only instantiate non-abstract classes. To provide a more extensive class factory that can handle instantiating interfaces, abstract classes, using Singleton instances, or other possibilities, set the Factory property and provide your own implementation.

Static Properties

  • public static Func<Type, object[], object> Factory { get; set; } - Get or set the factory to use. Only a single factory can be used at a time. To use the default bahavior, the Factory should return null.

Static Methods

  • public static object CreateObject(Type type, params object[] args) - Creates an object of the specified type.
  • public static T CreateObject<T>(params object[] args) - Creates an object of the specified type.

Clone this wiki locally