/// <summary>
            /// Creates a new collection for database objects
            /// </summary>
            /// <param name="dataset"></param>
            public DatabaseObjectCollection(DatasetBase dataset)
                : base(SchemaManager.Comparer)
            {
                InitializeMembers();

                this.dataset = dataset;
            }
Example #2
0
        /// <summary>
        /// Creates a new database object with its full name initialized
        /// </summary>
        /// <param name="dataset"></param>
        /// <param name="databaseName"></param>
        /// <param name="schemaName"></param>
        /// <param name="objectName"></param>
        protected DatabaseObject(DatasetBase dataset, string databaseName, string schemaName, string objectName)
        {
            InitializeMembers(new StreamingContext());

            this.dataset      = dataset;
            this.databaseName = databaseName;
            this.schemaName   = schemaName;
            this.objectName   = objectName;
        }
Example #3
0
 protected override void OnDatasetAdded(string datasetName, DatasetBase ds)
 {
     // If a Graywulf dataset is added, it has to be updated and registry
     // objects loaded
     if (ds is GraywulfDataset)
     {
         var gwds = (GraywulfDataset)ds;
         gwds.Context = Context;
     }
 }
Example #4
0
        /// <summary>
        /// Copies member variable from an existing object
        /// </summary>
        /// <param name="old"></param>
        private void CopyMembers(DatabaseObject old)
        {
            this.cachedVersion = DateTime.Now.Ticks;
            this.objectType    = old.objectType;
            this.dataset       = old.dataset;
            this.databaseName  = old.databaseName;
            this.schemaName    = old.schemaName;
            this.objectName    = old.objectName;

            this.metadata = new LazyProperty <DatabaseObjectMetadata>(LoadMetadata);
        }
Example #5
0
        private void InitializeMembers(StreamingContext context)
        {
            this.cachedVersion = DateTime.Now.Ticks;
            this.objectType    = DatabaseObjectType.Unknown;
            this.dataset       = null;
            this.databaseName  = null;
            this.schemaName    = null;
            this.objectName    = null;

            this.metadata = new LazyProperty <DatabaseObjectMetadata>(LoadMetadata);
        }
Example #6
0
        /// <summary>
        /// Copies member variables
        /// </summary>
        /// <param name="old"></param>
        private void CopyMembers(DatasetBase old)
        {
            this.cachedVersion = DateTime.Now.Ticks;

            this.isCacheable       = old.isCacheable;
            this.name              = old.name;
            this.defaultSchemaName = old.defaultSchemaName;

            this.connectionString = old.connectionString;

            // No deep copy here
            this.tables = new DatabaseObjectCollection <Table>(this);
            this.views  = new DatabaseObjectCollection <View>(this);
            this.tableValuedFunctions = new DatabaseObjectCollection <TableValuedFunction>(this);
            this.scalarFunctions      = new DatabaseObjectCollection <ScalarFunction>(this);
            this.storedProcedures     = new DatabaseObjectCollection <StoredProcedure>(this);

            this.statistics = new LazyProperty <DatasetStatistics>(LoadDatasetStatistics);
            this.metadata   = new LazyProperty <DatasetMetadata>(LoadDatasetMetadata);

            InitializeEventHandlers();
        }
Example #7
0
 public GraywulfDataset(DatasetBase old)
     : base(old)
 {
     InitializeMembers(new StreamingContext());
 }
Example #8
0
 /// <summary>
 /// Creates a view and initializes its dataset
 /// </summary>
 /// <param name="dataset"></param>
 public View(DatasetBase dataset)
     : base(dataset)
 {
     InitializeMembers();
 }
Example #9
0
 /// <summary>
 /// Creates a table or view and initializes its dataset
 /// </summary>
 /// <param name="dataset"></param>
 public TableOrView(DatasetBase dataset)
     : base(dataset)
 {
     InitializeMembers(new StreamingContext());
 }
Example #10
0
 protected virtual void OnDatasetAdded(string datasetName, DatasetBase ds)
 {
 }
Example #11
0
        /// <summary>
        /// Creates a new database object with dataset set.
        /// </summary>
        /// <param name="dataset"></param>
        public DatabaseObject(DatasetBase dataset)
        {
            InitializeMembers(new StreamingContext());

            this.dataset = dataset;
        }
Example #12
0
 /// <summary>
 /// Creates a stored procedure function and initializes its dataset
 /// </summary>
 /// <param name="dataset"></param>
 public StoredProcedure(DatasetBase dataset)
     : base(dataset)
 {
     InitializeMembers(new StreamingContext());
 }
 /// <summary>
 /// Initializes member variable to their default values.
 /// </summary>
 private void InitializeMembers()
 {
     this.dataset     = null;
     this.isAllLoaded = false;
 }
Example #14
0
 /// <summary>
 /// Creates a table-valued function and initializes its dataset
 /// </summary>
 /// <param name="dataset"></param>
 public TableValuedFunction(DatasetBase dataset)
     : base(dataset)
 {
     InitializeMembers(new StreamingContext());
 }
Example #15
0
 /// <summary>
 /// Creates a scalar function and initializes its
 /// dataset
 /// </summary>
 /// <param name="dataset"></param>
 public ScalarFunction(DatasetBase dataset)
     : base(dataset)
 {
     InitializeMembers(new StreamingContext());
 }
Example #16
0
 /// <summary>
 /// Creates a table and initializes its dataset
 /// </summary>
 /// <param name="dataset"></param>
 public Table(DatasetBase dataset)
     : base(dataset)
 {
     InitializeMembers();
 }
Example #17
0
 /// <summary>
 /// Creates a copy of the dataset object
 /// </summary>
 /// <param name="old"></param>
 protected DatasetBase(DatasetBase old)
 {
     CopyMembers(old);
 }