Example #1
0
 public virtual void MoveWidgetDown(AppObject appobj, int index)
 {
 }
Example #2
0
 public bool CopyDragDropVisible(AppObject appobj)
 {
     return(appobj is FavoriteAppObject);
 }
Example #3
0
        //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));
        }
Example #4
0
 public bool DragDrop_CopyDatabaseVisible(AppObject draggingObject)
 {
     return(draggingObject is DatabaseAppObject);
 }
 public abstract string CreateText(AppObject appobj, ConnectionPack connpack);
Example #6
0
 public void CopyAfter(AppObject appobj)
 {
     CopyCommand(appobj, 1, false);
 }
Example #7
0
        public bool DragDrop_CopyDatabaseVisible(AppObject appobj)
        {
            var dbconn = this.FindDatabaseConnection(ConnPack);

            return(dbconn != null && !dbconn.DatabaseCaps.ReadOnly && appobj is DatabaseAppObject);
        }
Example #8
0
 public static IDatabaseSource FindDatabaseConnection(this AppObject appobj)
 {
     return(appobj.FindDatabaseConnection(appobj.ConnPack));
 }
Example #9
0
        public static IDatabaseSource CreateDatabaseConnection(this AppObject appobj)
        {
            var connpack = new ConnectionPack(typeof(AppObjectExtension));

            return(FindDatabaseConnection(appobj, connpack).CloneSource());
        }
Example #10
0
 public abstract void GetData(AppObject appobj, ConnectionPack connpack, out DataTable data, out DatAdmin.Scripting.ObjectGrid grid);
Example #11
0
        public static DatabaseCache FindDatabaseCache(this AppObject appobj)
        {
            var cache = appobj.FindDatabaseConnection().GetCache();

            return(cache);
        }
Example #12
0
 protected virtual void LoadFromObject(AppObject appobj)
 {
 }
Example #13
0
 public override void CreateNew(AppObject appobj, ConnectionPack connpack)
 {
     ((TableAppObject)appobj).DoEdit(AlterTableEditorPars.Tab.IndexesKeys);
 }
Example #14
0
 public virtual bool CanDeleteObject(AppObject appobj, int index)
 {
     return(appobj.AllowDelete());
 }
Example #15
0
 public void MoveAfter(AppObject appobj)
 {
     CopyCommand(appobj, 1, true);
 }
Example #16
0
 public static IPhysicalConnection FindPhysicalConnection(this AppObject appobj)
 {
     return(appobj.FindPhysicalConnection(appobj.ConnPack));
 }
Example #17
0
 public void CopyBefore(AppObject appobj)
 {
     CopyCommand(appobj, 0, false);
 }
Example #18
0
        public static IPhysicalConnection CreatePhysicalConnection(this AppObject appobj)
        {
            var connpack = new ConnectionPack(typeof(AppObjectExtension));

            return(FindPhysicalConnection(appobj, connpack).Clone());
        }
Example #19
0
 public bool CopyDragDropVisible(AppObject appobj)
 {
     return(appobj is JobCommandAppObject);
 }
Example #20
0
 public virtual void GetAdditionalWidgets(List <IWidget> res, AppObject appobj)
 {
     m_dialect.GetAdditionalWidgets(res, appobj);
 }
Example #21
0
 public bool DragDropVisible_CopyTable(AppObject appobj)
 {
     return(appobj is TableAppObject);
 }
Example #22
0
 public abstract string CreateHtml(AppObject appobj, ConnectionPack connpack, IDictionary <string, object> outnames);
Example #23
0
 public override bool CanDeleteObject(AppObject appobj, int index)
 {
     return(index > 0);
 }
Example #24
0
 public abstract bool SuitableFor(AppObject appobj);
Example #25
0
 protected override void LoadFromObject(AppObject appobj)
 {
     codeEditor1.Language = Widget.ViewLanguage;
     codeEditor1.Dialect  = Widget.GetDialect(appobj, ConnPack);
 }
Example #26
0
 public override bool SuitableFor(AppObject appobj)
 {
     return(true);
 }
Example #27
0
        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("");
        }
Example #28
0
 public void MoveBefore(AppObject appobj)
 {
     CopyCommand(appobj, 0, true);
 }
Example #29
0
 public Action OpenAsNewWindowDelegate(AppObject appobj)
 {
     return(() => OpenAsNewWindow(appobj));
 }
Example #30
0
 public virtual void DeleteAppObject(AppObject obj, int index)
 {
     obj.DoDelete();
 }