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

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

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

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

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