コード例 #1
0
        protected virtual void TriggerOnResolveHostName(OnResolveHostNameEventArgs e)
        {
            if (this.OnResolveHostName == null)
            {
                return;
            }

            this.OnResolveHostName(this, e);
        }
コード例 #2
0
        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));
        }