protected virtual void TriggerOnResolveHostName(OnResolveHostNameEventArgs e) { if (this.OnResolveHostName == null) { return; } this.OnResolveHostName(this, e); }
protected virtual void ResolveHostName() { OnResolveHostNameEventArgs lEventArgs = new OnResolveHostNameEventArgs(this.HostName); this.TriggerOnResolveHostName(lEventArgs); if (String.IsNullOrEmpty(lEventArgs.HostName)) { throw new Exception("No Hostname set"); } this.HostName = lEventArgs.HostName; this.HostAddress = DnsLookup.ResolveFirst(this.HostName); this.TriggerOnResolvedHostName(new OnResolvedHostNameEventArgs(this.HostName, this.HostAddress)); }