public static void Initialize(Stream configuration) { Lock(); try { LoadConfiguration(configuration); if (Binder == null) { Binder = new DefaultBinder(); } if (Activator == null) { Activator = new DefaultActivator(); } InitializeSettingItems(); RegisterOperators(); if (ScopeFactory == null) { ScopeFactory = Activator.CreateInstance(GetNativeType(GetSettingsItem <string>(ConfigSchema.ScopeFactoryAttribute))) as IScopeFactory; } RegisterScopes(); if (AssemblyManager == null) { AssemblyManager = new DefaultAssemblyManager(); } OnInitializingTypes(AssemblyManager); AssemblyManager.Initialize(Configuration); if (!string.IsNullOrEmpty(Configuration.Initialization)) { InitializationScript = Script.Compile(Configuration.Initialization); } RegisterOperatorHandler("+=", new EventOperatorHandler(true)); RegisterOperatorHandler("-=", new EventOperatorHandler(false)); ScriptNET.Ast.ScriptExpr.HandleOperator += HandleOperator; } finally { UnLock(); } }
public static object CreateInstance(this IObjectActivator activator, Type type) { return(activator.CreateInstance(type, null)); }
public static T CreateInstance <T>(this IObjectActivator activator, object[] args) { return((T)activator.CreateInstance(typeof(T), args)); }
public static object CreateInstance(this IObjectActivator activator, IScriptContext context, IObjectBind bind) { return(activator.CreateInstance(null, bind)); }