Пример #1
0
        /// <summary>
        /// Creates a database server with the specified name and configuration.
        /// </summary>
        /// <param name="cls">The database server class.</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 DbServer(DbServerClass cls, RegistryKey key, Guid id, string logFile)
        {
            // Set the server class.
            this.cls = cls;

            // Set the server ID.
            this.id = id;

            // Set the root registry key for this server.
            this.key = key;

            // Create the logger for this server.
            this.log = new Logger(logFile);
            this.log.EventLogged += this.OnLog;
            this.logSource = @"Database\{0}".FormatWith(this.id.ToString());

            // Load the current configuration.
            this.LoadInternalConfiguration();
        }
Пример #2
0
        /// <summary>
        /// Creates a database server with the specified parameters.
        /// </summary>
        /// <param name="cls">The database server class.</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 DbServer(
			DbServerClass cls,
			RegistryKey key,
			Guid id,
			string name,
			string dataSource,
			string username,
			SecureString password,
			string logFile,
			DateTime dateCreated,
			DateTime dateModified
			)
        {
            // Save the parameters.
            this.cls = cls;
            this.key = key;
            this.id = id;
            this.name = name;
            this.dataSource = dataSource;
            this.username = username;
            this.password = password;
            this.dateCreated = dateCreated;
            this.dateModified = dateModified;

            // Create the logger for this server.
            this.log = new Logger(logFile);
            this.log.EventLogged += this.OnLog;
            this.logSource = @"Database\{0}".FormatWith(this.id.ToString());

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