Exemplo n.º 1
0
        /// <summary>
        /// Creates a database server with the specified name and configuration.
        /// </summary>
        /// <param name="type">The SQL server type.</param>
        /// <param name="key">The registry configuration key.</param>
        /// <param name="id">The server ID.</param>
        /// <param name="logFile">The log file for this database server.</param>
        public DbServerSql(DbType type, RegistryKey key, Guid id, string logFile)
            : base(DbServerClass.Sql, key, id, logFile)
        {
            // Set the server type.
            this.type = type;

            // Create the database tables and relationships.
            this.tables = new DbTables(this.Key);
            this.relationships = new DbRelationships(this.Key, this.tables);

            // Set the event handlers.
            this.tables.TableAdded += this.OnTableAdded;
            this.tables.TableChanged += this.OnTableChanged;
            this.tables.TableRemoved += this.OnTableRemoved;

            this.relationships.RelationshipAdded += this.OnRelationshipAdded;
            this.relationships.RelationshipRemoved += this.OnRelationshipRemoved;

            // Load the current configuration.
            this.LoadInternalConfiguration();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a database server with the specified parameters.
        /// </summary>
        /// <param name="type">The SQL server type.</param>
        /// <param name="key">The registry configuration key.</param>
        /// <param name="id">The server ID.</param>
        /// <param name="name">The server name.</param>
        /// <param name="dataSource">The data source.</param>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        /// <param name="logFile">The log file for this database server.</param>
        /// <param name="dateCreated">The date when the server was created.</param>
        /// <param name="dateModified">The date when the server was last modified.</param>
        public DbServerSql(
			DbType type,
			RegistryKey key,
			Guid id,
			string name,
			string dataSource,
			string username,
			SecureString password,
			string logFile,
			DateTime dateCreated,
			DateTime dateModified
			)
            : base(DbServerClass.Sql, key, id, name, dataSource, username, password, logFile, dateCreated, dateModified)
        {
            // Set the server type.
            this.type = type;

            // Create the database tables and relationships.
            this.tables = new DbTables(this.Key);
            this.relationships = new DbRelationships(this.Key, this.tables);

            // Set the event handlers.
            this.tables.TableAdded += this.OnTableAdded;
            this.tables.TableChanged += this.OnTableChanged;
            this.tables.TableRemoved += this.OnTableRemoved;

            this.relationships.RelationshipAdded += this.OnRelationshipAdded;
            this.relationships.RelationshipRemoved += this.OnRelationshipRemoved;

            // Save the configuration.
            this.SaveInternalConfiguration();
        }