/// <summary>
 /// Raise an event indicating that a subscription has been activated successfully
 /// </summary>
 protected virtual void OnActivated()
 {
     if (this.Activated != null)
     {
         if (this.eventArgs == null)
         {
             this.eventArgs         = new SubscriptionEventArgs();
             this.eventArgs.Service = this.Service;
         }
         this.Activated(this, this.eventArgs);
     }
 }
        /// <summary>
        /// Raise an to allow consumer to check for an existing subscription. Set <c>e.Success = false</c> if an existing subscription is found.
        /// </summary>
        protected virtual void OnCheckingExistingSubscription()
        {
            // Get the form email address either as the newly submitted one (via TextBox control) or as the read-only version (via Label control).
            string emailAddress = null;

            try { emailAddress = this.email.Text; }
            catch { }
            if (string.IsNullOrEmpty(emailAddress) && this.emailReadOnly != null)
            {
                emailAddress = this.emailReadOnly.Text;
            }

            if (this.CheckingExistingSubscription != null)
            {
                this.eventArgs              = new SubscriptionEventArgs();
                this.eventArgs.Service      = this.Service;
                this.eventArgs.EmailAddress = new ContactEmail(emailAddress);
                this.CheckingExistingSubscription(this, this.eventArgs);
            }
        }
        /// <summary>
        /// Raise an event indicating that a change to the subscription options has been submitted
        /// </summary>
        protected virtual void OnSubscriptionOptionsUpdated()
        {
            // Get the form email address either as the newly submitted one (via TextBox control) or as the read-only version (via Label control).
            string emailAddress = null;

            try { emailAddress = this.email.Text; }
            catch { }
            if (string.IsNullOrEmpty(emailAddress) && this.emailReadOnly != null)
            {
                emailAddress = this.emailReadOnly.Text;
            }

            if (this.SubscriptionOptionsUpdated != null)
            {
                this.eventArgs                  = new SubscriptionEventArgs();
                this.eventArgs.Service          = this.Service;
                this.eventArgs.EmailAddress     = new ContactEmail(emailAddress);
                this.eventArgs.SubscriptionCode = this.Context.Request.QueryString[this.CodeParameter];
                this.SubscriptionOptionsUpdated(this, this.eventArgs);
            }
        }
 /// <summary>
 /// Raise an event indicating that a subscription has been activated successfully
 /// </summary>
 protected virtual void OnActivated()
 {
     if (this.Activated != null)
     {
         if (this.eventArgs == null)
         {
             this.eventArgs = new SubscriptionEventArgs();
             this.eventArgs.Service = this.Service;
         }
         this.Activated(this, this.eventArgs);
     }
 }
 /// <summary>
 /// Raise an event indicating that a subscription code has been submitted
 /// </summary>
 protected virtual void OnActivationCodeSubmitted()
 {
     if (this.ActivationCodeSubmitted != null)
     {
         this.eventArgs = new SubscriptionEventArgs();
         this.eventArgs.Service = this.Service;
         this.eventArgs.SubscriptionCode = this.Context.Request.QueryString[this.CodeParameter];
         this.ActivationCodeSubmitted(this, this.eventArgs);
     }
 }
        /// <summary>
        /// Raise an event indicating that a change to the subscription options has been submitted
        /// </summary>
        protected virtual void OnSubscriptionOptionsUpdated()
        {
            // Get the form email address either as the newly submitted one (via TextBox control) or as the read-only version (via Label control).
            string emailAddress = null;
            try { emailAddress = this.email.Text; }
            catch { }
            if (string.IsNullOrEmpty(emailAddress) && this.emailReadOnly != null) emailAddress = this.emailReadOnly.Text;

            if (this.SubscriptionOptionsUpdated != null)
            {
                this.eventArgs = new SubscriptionEventArgs();
                this.eventArgs.Service = this.Service;
                this.eventArgs.EmailAddress = new ContactEmail(emailAddress);
                this.eventArgs.SubscriptionCode = this.Context.Request.QueryString[this.CodeParameter];
                this.SubscriptionOptionsUpdated(this, this.eventArgs);
            }
        }
        /// <summary>
        /// Raise an to allow consumer to check for an existing subscription. Set <c>e.Success = false</c> if an existing subscription is found.
        /// </summary>
        protected virtual void OnCheckingExistingSubscription()
        {
            // Get the form email address either as the newly submitted one (via TextBox control) or as the read-only version (via Label control).
            string emailAddress = null;
            try { emailAddress = this.email.Text; }
            catch { }
            if (string.IsNullOrEmpty(emailAddress) && this.emailReadOnly != null) emailAddress = this.emailReadOnly.Text;

            if (this.CheckingExistingSubscription != null)
            {
                this.eventArgs = new SubscriptionEventArgs();
                this.eventArgs.Service = this.Service;
                this.eventArgs.EmailAddress = new ContactEmail(emailAddress);
                this.CheckingExistingSubscription(this, this.eventArgs);
            }
        }