/// <summary> /// Releases unmanaged and - optionally - managed resources /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected void Dispose(bool disposing) { if (disposing) { try { if (this.timer != null) { this.timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed); this.timer.Close(); this.timer = null; } } catch { // suppress } } }
/// <summary> /// Initializes a new instance of the <see cref="SubscriptionConnector"/> class /// and allows the communication port to be set. /// </summary> /// <param name="subscriber">The <see cref="Subscriber"/> information/</param> /// <param name="password">The password used to authenticate requests</param> /// <param name="hostname">The hostname of the Growl instance to subscribe to.</param> /// <param name="port">The port of the Growl instance to subscribe to.</param> public SubscriptionConnector(Subscriber subscriber, string password, string hostname, int port) : base(password, hostname, port) { this.subscriber = subscriber; this.timer = new RenewalTimer(); this.timer.AutoReset = false; this.timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); }