Пример #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();
 }