Exemplo n.º 1
0
 public override string ToString()
 {
     if (ObjectName != null)
     {
         return(ObjectName.ToString());
     }
     return(base.ToString());
 }
Exemplo n.º 2
0
        public Table_SourceTreeNode(ITableSource conn, ITreeNode parent, NameWithSchema tblname)
            : base(conn, parent, tblname.ToString("F"))
        {
            m_conn    = conn;
            m_tblname = tblname;
            var appobj = new TableAppObject();

            appobj.FillFromTable(conn);
            SetAppObject(appobj);
        }
Exemplo n.º 3
0
        public override void FillTable(ITableStructure table, IDataQueue queue, TableCopyOptions opts)
        {
            var          name  = new NameWithSchema(table.FullName.Schema, table.FullName.Name, false);
            var          entry = m_zip.PutNextEntry(XmlTool.NormalizeIdentifier(name.ToString()) + ".drs");
            BedDataStats stats = new BedDataStats();

            BedTool.WriteQueueToStream(queue, m_zip, stats);
            ProgressInfo.LogMessage("s_export", LogLevel.Info, Texts.Get("s_exported$table$rows$bytes", "rows", stats.Rows, "bytes", stats.Bytes, "table", table.FullName));
            //ZipEntry entry = new ZipEntry(XmlTool.NormalizeIdentifier(table.FullName.ToString()) + ".xml");
            //m_zip.PutNextEntry(entry);
            //XmlTool.WriteQueueToXml(queue, m_zip, "DataSet", "DataRow");
        }
Exemplo n.º 4
0
        public string ToString(string format, IFormatProvider formatProvider)
        {
            switch (format)
            {
            case "L":
            case "M":
                if (SubNames.Count > 0)
                {
                    return(ObjectName.ToString(format, formatProvider) + "." + SubNames.CreateDelimitedText("."));
                }
                return(ObjectName.ToString(format, formatProvider));

            case "S":
            default:
                if (SubNames.Count > 0)
                {
                    return(SubNames[SubNames.Count - 1]);
                }
                return(ObjectName.ToString(format, formatProvider));
            }
        }
Exemplo n.º 5
0
 private void DoReadTable(NameWithSchema table, IDataQueue queue)
 {
     try
     {
         string   fnbase = XmlTool.NormalizeIdentifier(table.ToString());
         ZipEntry xmlEntry;
         try { xmlEntry = m_zip[fnbase + ".xml"]; }
         catch { xmlEntry = null; }
         ZipEntry drsEntry;
         try { drsEntry = m_zip[fnbase + ".drs"]; }
         catch { drsEntry = null; }
         if (drsEntry == null && xmlEntry == null)
         {
             var dbs = GetStructure();
             if (dbs.Tables.GetIndex(table) < 0)
             {
                 throw new InternalError("DAE-00019 Table not found in data archive:" + table.ToString());
             }
             // table is empty, only has no drs nor xml file
             queue.PutEof();
             return;
         }
         using (Stream fr = (drsEntry ?? xmlEntry).OpenReader())
         {
             if (drsEntry != null)
             {
                 BedTool.LoadQueue(fr, queue);
             }
             else if (xmlEntry != null)
             {
                 using (XmlReader reader = XmlReader.Create(fr, new XmlReaderSettings {
                     CheckCharacters = false
                 }))
                 {
                     XmlDataTool.ReadXmlToQueue(reader, queue, "DataRow");
                 }
             }
         }
     }
     finally
     {
         queue.CloseWriting();
     }
 }
Exemplo n.º 6
0
 public override string ToString()
 {
     return("RENAME " + OldObject.ToString() + "->" + NewName.ToString());
 }
Exemplo n.º 7
0
        public static void PutTableColumns(this DatabaseCache cache, string ns, NameWithSchema table, DataTable value)
        {
            string key = table != null?table.ToString() : "@#all";

            cache.Put(ns, key, value);
        }
Exemplo n.º 8
0
        public static DataTable GetTableColumns(this DatabaseCache cache, string ns, NameWithSchema table)
        {
            string key = table != null?table.ToString() : "@#all";

            return((DataTable)cache.Get(ns, key));
        }
Exemplo n.º 9
0
 public TableCache Table(NameWithSchema tablename)
 {
     return(GetChildCache <TableCache>(tablename.ToString()));
 }