Ejemplo n.º 1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="GridionClientConfiguration" /> class.
        /// </summary>
        /// <param name="host">
        ///     The IP address.
        /// </param>
        /// <param name="port">
        ///     The port on the address.
        /// </param>
        internal GridionClientConfiguration(string host, int port)
        {
            HostValidator.Validate(host, port);

            this.Host = host;
            this.Port = port;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="GridionServerConfiguration" /> class.
        /// </summary>
        /// <param name="host">
        ///     The IP address.
        /// </param>
        /// <param name="port">
        ///     The port.
        /// </param>
        internal GridionServerConfiguration(string host, int port)
        {
            HostValidator.Validate(host, port);

            this.Logger = new ConsoleLogger();
            this.Host   = host;
            this.Port   = port;
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="GridionServerConfiguration" /> class.
        /// </summary>
        /// <param name="logger">
        ///     The logger to log internal operations.
        /// </param>
        /// <param name="host">
        ///     The IP address.
        /// </param>
        /// <param name="port">
        ///     The port.
        /// </param>
        /// <inheritdoc cref="GridionServerConfiguration" />
        internal GridionServerConfiguration(ILogger logger, string host, int port)
            : this(host, port)
        {
            Should.NotBeNull(logger, nameof(logger));
            HostValidator.Validate(host, port);

            this.Logger = logger;
        }
Ejemplo n.º 4
0
        /// <inheritdoc cref="IPEndPoint" />
        private GridionEndpoint(string host, int port)
            : base(IPAddress.Parse(host), port)
        {
            HostValidator.Validate(host, port);

            this.Host = host;
            this.Port = port;
        }
        private CustomerServices GetService()
        {
            CustomerServices services       = new CustomerServices();
            Uri               uri           = new Uri(services.Url);
            string            dnsName       = uri.DnsSafeHost;
            HostValidator     hostValidator = new HostValidator();
            ValidationResults r             = hostValidator.Validate(dnsName);

            if (r.IsValid)
            {
                return(services);
            }
            else
            {
                throw new Exception("Unable to save at this time");
            }
        }
Ejemplo n.º 6
0
 public void SetUp()
 {
     _validator = new HostValidator();
 }
Ejemplo n.º 7
0
 /// <inheritdoc />
 void IGridionClient.Connect(string host, int port)
 {
     HostValidator.Validate(host, port);
     this.IsConnected = true;
 }
Ejemplo n.º 8
0
 internal void Validate()
 {
     HostValidator.Validate(this.Host, this.Port);
 }