Beispiel #1
0
        /// <summary>
        /// Copies a table to a new directory
        /// </summary>
        /// <param name="Element"></param>
        /// <param name="NewDir"></param>
        /// <param name="NewName"></param>
        public void CopyTable(Table Element, string NewDir, string NewName)
        {
            // Need to save the current copy to disk //
            this.FlushTable(Element.Key);

            // Save the key //
            string OldPath = Element.Header.Path;
            string NewPath = TableHeader.DeriveV1Path(NewDir, NewName);

            // Copy the file //
            File.Copy(OldPath, NewPath);

            // Buffer the header //
            TableHeader h = Buffer(NewPath);

            // Change the dir and name //
            h.Directory = NewDir;
            h.Name      = NewName;

            // Save the header //
            Flush(NewPath, h);
        }
Beispiel #2
0
 // Clones //
 public static Table Clone(Table Element, string NewDirectory, string NewName)
 {
     Element.Host.TableStore.DropTable(TableHeader.DeriveV1Path(NewDirectory, NewName));
     return(new HeapTable(Element.Host, NewName, NewDirectory, Element.Columns, Element.PageSize));
 }