public SqlPackage() { PackageId = "javascript_sql_factory"; ScriptUri = "JavaScript.Manager.Sql.Scripts.sql.js"; HostObjects.Add(new HostObject { Name = "xHost", Target = new ExtendedHostFunctions() }); }
public HttpPackage() { PackageId = "javascript_request_factory_http"; HostObjects.Add(new HostObject { Name = "javascript_request_factory_http", Target = new NodeHttp() }); //HostTypes.Add(new HostType{ Name="Buffer", Type = typeof(NodeBuffer)}); }
public TimerPackageExecutor() { PackageId = "javascript_timer_factory_timerExecutor"; HostObjects.Add(new HostObject { Name = "javascript_timer_factory_timerExecutor", Target = new TimerHelper() }); }
public HttpPackage() { PackageId = "http"; HostObjects.Add(new HostObject { Name = "http", Target = new NodeHttp() }); HostTypes.Add(new HostType { Name = "Buffer", Type = typeof(NodeBuffer) }); }
public LogExcutorPackage(object logExecutory = null) { PackageId = "javascript_log_factory_logExecutor"; if (logExecutory != null) { var type = logExecutory as Type; if (type != null) { var isTarget = typeof(ILogExecutor).IsAssignableFrom(type); if (!isTarget) { throw new NotSupportedException(type.Name + " is not implements ILogExecutor"); } HostObjects.Add(new HostObject { Name = "javascript_log_factory_logExecutor", Target = Activator.CreateInstance(type) }); } else { var isTarget = typeof(AbstractLogExcutor).IsAssignableFrom(logExecutory.GetType()); if (!isTarget) { throw new NotSupportedException(logExecutory.GetType().Name + " is not implements AbstractLogExcutor"); } HostObjects.Add(new HostObject { Name = "javascript_log_factory_logExecutor", Target = logExecutory }); } } else { HostObjects.Add(new HostObject { Name = "javascript_log_factory_logExecutor", Target = new ConsoleLogExecutor() }); } }
public WebViewExcutorPackage(object webViewExecutor) { PackageId = "javascript_webview_factory_webviewExecutor"; var type = webViewExecutor as Type; if (type != null) { HostObjects.Add(new HostObject { Name = "javascript_webview_factory_webviewExecutor", Target = Activator.CreateInstance(type) }); } else { HostObjects.Add(new HostObject { Name = "javascript_webview_factory_webviewExecutor", Target = webViewExecutor }); } }
public SqlExecutor(object sqlExecutory) { PackageId = "javascript_sql_factory_sqlExecutor"; if (sqlExecutory != null) { var type = sqlExecutory as Type; if (type != null) { var isTarget = typeof(IDbExecutor).IsAssignableFrom(type); if (!isTarget) { throw new NotSupportedException(type.Name + " is not implements IDbExecutor"); } HostObjects.Add(new HostObject { Name = "javascript_sql_factory_sqlExecutor", Target = Activator.CreateInstance(type) }); } else { var isTarget = typeof(AbstractDbDefaultExecutor).IsAssignableFrom(sqlExecutory.GetType()); if (!isTarget) { throw new NotSupportedException(sqlExecutory.GetType().Name + " is not implements AbstractDbDefaultExecutor"); } HostObjects.Add(new HostObject { Name = "javascript_sql_factory_sqlExecutor", Target = sqlExecutory }); } } else { throw new ArgumentException("sqlExecutory"); } }