コード例 #1
0
        /// <summary>
        ///		Constructor for the <see cref="SubscriptionManager"/> class.
        /// </summary>
        /// <param name="refDatabase">
        ///		Database that will contain the actual subscriptions and data retrieved by these
        ///		subscriptions. Can be the same database as the <paramref name="infoDatabase"/> parameter.
        /// </param>
        /// <param name="infoDatabase">
        ///		Database that will be used by <see cref="SubscriptionManager"/> to store data about
        ///		registered subscriptions.
        /// </param>
        /// <param name="subCredentials">
        ///		The object that can provide credentials for subscriptions.
        /// </param>
        public SqlSubscriptionManager(IDatabase referenceDatabase, IDatabase infoDatabase, ISubscriptionCredentialService subscriptionCredentials)
        {
            Guard.ArgumentNotNull(referenceDatabase, "referenceDatabase");
            Guard.ArgumentNotNull(infoDatabase, "infoDatabase");
            Guard.ArgumentNotNull(subscriptionCredentials, "subscriptionCredentials");

            this.infoDatabase            = infoDatabase;
            this.refDatabase             = referenceDatabase;
            this.subscriptionCredentials = subscriptionCredentials;

            if (!infoDatabase.TableExists("SubscriptionInfo"))
            {
                CreateDatabaseTables();
            }
        }
コード例 #2
0
 /// <summary>
 ///		Creates a new instance of this class and provides it with the required services.
 /// </summary>
 /// <param name="databaseService">
 ///		Provides the connection to the local database where subscriptions will be managed
 ///		by this class.
 /// </param>
 /// <param name="subCredentials">
 ///		Provides the credentials needed for a subscription to connect to the server
 ///		that has the publication used by the subscription.
 /// </param>
 public SqlSubscriptionManager(IDatabase databaseService, ISubscriptionCredentialService subCredentials)
     : this(databaseService, databaseService, subCredentials)
 {
 }