public virtual void MoveWidgetDown(AppObject appobj, int index) { }
public bool CopyDragDropVisible(AppObject appobj) { return(appobj is FavoriteAppObject); }
//protected override void SetSelectedObject(AppObject obj) //{ // m_selectedObject = obj; // if (m_frame != null) m_frame.SetSelectedObject(obj); //} public override bool SuitableFor(AppObject appobj) { var props = appobj.GetAppObjectProperties(); return(Filter.Accept(props)); }
public bool DragDrop_CopyDatabaseVisible(AppObject draggingObject) { return(draggingObject is DatabaseAppObject); }
public abstract string CreateText(AppObject appobj, ConnectionPack connpack);
public void CopyAfter(AppObject appobj) { CopyCommand(appobj, 1, false); }
public bool DragDrop_CopyDatabaseVisible(AppObject appobj) { var dbconn = this.FindDatabaseConnection(ConnPack); return(dbconn != null && !dbconn.DatabaseCaps.ReadOnly && appobj is DatabaseAppObject); }
public static IDatabaseSource FindDatabaseConnection(this AppObject appobj) { return(appobj.FindDatabaseConnection(appobj.ConnPack)); }
public static IDatabaseSource CreateDatabaseConnection(this AppObject appobj) { var connpack = new ConnectionPack(typeof(AppObjectExtension)); return(FindDatabaseConnection(appobj, connpack).CloneSource()); }
public abstract void GetData(AppObject appobj, ConnectionPack connpack, out DataTable data, out DatAdmin.Scripting.ObjectGrid grid);
public static DatabaseCache FindDatabaseCache(this AppObject appobj) { var cache = appobj.FindDatabaseConnection().GetCache(); return(cache); }
protected virtual void LoadFromObject(AppObject appobj) { }
public override void CreateNew(AppObject appobj, ConnectionPack connpack) { ((TableAppObject)appobj).DoEdit(AlterTableEditorPars.Tab.IndexesKeys); }
public virtual bool CanDeleteObject(AppObject appobj, int index) { return(appobj.AllowDelete()); }
public void MoveAfter(AppObject appobj) { CopyCommand(appobj, 1, true); }
public static IPhysicalConnection FindPhysicalConnection(this AppObject appobj) { return(appobj.FindPhysicalConnection(appobj.ConnPack)); }
public void CopyBefore(AppObject appobj) { CopyCommand(appobj, 0, false); }
public static IPhysicalConnection CreatePhysicalConnection(this AppObject appobj) { var connpack = new ConnectionPack(typeof(AppObjectExtension)); return(FindPhysicalConnection(appobj, connpack).Clone()); }
public bool CopyDragDropVisible(AppObject appobj) { return(appobj is JobCommandAppObject); }
public virtual void GetAdditionalWidgets(List <IWidget> res, AppObject appobj) { m_dialect.GetAdditionalWidgets(res, appobj); }
public bool DragDropVisible_CopyTable(AppObject appobj) { return(appobj is TableAppObject); }
public abstract string CreateHtml(AppObject appobj, ConnectionPack connpack, IDictionary <string, object> outnames);
public override bool CanDeleteObject(AppObject appobj, int index) { return(index > 0); }
public abstract bool SuitableFor(AppObject appobj);
protected override void LoadFromObject(AppObject appobj) { codeEditor1.Language = Widget.ViewLanguage; codeEditor1.Dialect = Widget.GetDialect(appobj, ConnPack); }
public override bool SuitableFor(AppObject appobj) { return(true); }
public override string CreateHtml(AppObject appobj, ConnectionPack connpack, IDictionary <string, object> outnames) { ObjectPath objpath = appobj.GetObjectPath(); IPhysicalConnection conn = appobj.FindPhysicalConnection(connpack); if (conn != null && conn.IsOpened) { return(conn.InvokeR <string>((Func <string>) delegate() { string rowcount = "???", colcount = "???"; if (conn.SystemConnection != null) { var dbcache = conn.Cache.Database(appobj.GetObjectPath().DbName); var dialect = conn.GetAnyDialect(); bool dbset = false; rowcount = (string)dbcache.Get("htmlinfowidget_rows", objpath.ObjectName.ToString()); if (rowcount == null) { if (!dbset) { conn.SystemConnection.SafeChangeDatabase(objpath); dbset = true; } rowcount = conn.SystemConnection.ExecuteScalar("SELECT COUNT(*) FROM " + dialect.QuoteFullName(objpath.ObjectName)).ToString(); try { int ival = Int32.Parse(rowcount); rowcount = ival.FormatInt(); } catch { } dbcache.Put("htmlinfowidget_rows", objpath.ObjectName.ToString(), rowcount); } colcount = (string)dbcache.Get("htmlinfowidget_cols", objpath.ObjectName.ToString()); if (colcount == null) { if (!dbset) { conn.SystemConnection.SafeChangeDatabase(objpath); dbset = true; } using (var cmd = conn.SystemConnection.CreateCommand()) { cmd.CommandText = "SELECT * FROM " + dialect.QuoteFullName(objpath.ObjectName); using (var reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly)) { colcount = reader.GetSchemaTable().Rows.Count.ToString(); } dbcache.Put("htmlinfowidget_cols", objpath.ObjectName.ToString(), colcount); } } } else { var db = appobj.FindDatabaseConnection(connpack); if (db != null) { var ts = db.InvokeLoadTableStructure(objpath.ObjectName, TableStructureMembers.ColumnNames); colcount = ts.Columns.Count.ToString(); } //var tbl = appobj.FindTableConnection(connpack); //if (tbl != null) //{ // var tabdata = tbl.GetTabularData(); // if (tabdata != null) // { // int? rcnt = tabdata.LoadRowCount(new TableDataSetProperties()); // if (rcnt != null) rowcount = rcnt.ToString(); // } //} } HtmlGenerator gen = new HtmlGenerator(); gen.BeginHtml(objpath.ObjectName.ToString(), HtmlGenerator.HtmlObjectViewStyle); if (ShowTableName) { gen.Heading(objpath.ObjectName.ToString(), 2); } gen.PropsTableBegin(); gen.PropTableRow("s_row_count", rowcount); gen.PropTableRow("s_column_count", colcount); gen.PropsTableEnd(); return gen.HtmlText; })); } return(""); }
public void MoveBefore(AppObject appobj) { CopyCommand(appobj, 0, true); }
public Action OpenAsNewWindowDelegate(AppObject appobj) { return(() => OpenAsNewWindow(appobj)); }
public virtual void DeleteAppObject(AppObject obj, int index) { obj.DoDelete(); }