コード例 #1
0
        public WebSocketServerBootstrap(
            IOptions <WebSocketOptions> webSocketOptions,
            IHostEnvironment hostEnvironment,
            ILogger <WebSocketServerBootstrap> logger)
        {
            _hostEnvironment  = hostEnvironment;
            _logger           = logger;
            _webSocketOptions = webSocketOptions.Value;
            wsAddressModel    = NetUtil.GetAddressModel(_webSocketOptions.WsPort, ServiceProtocol.Ws);
            if (_webSocketOptions.IsSsl)
            {
                _socketServer = new WebSocketServer(IPAddress.Parse(wsAddressModel.Address), wsAddressModel.Port, true);
                _socketServer.SslConfiguration.ServerCertificate = new X509Certificate2(
                    Path.Combine(_hostEnvironment.ContentRootPath, _webSocketOptions.SslCertificateName),
                    _webSocketOptions.SslCertificatePassword);
            }
            else
            {
                _socketServer = new WebSocketServer(IPAddress.Parse(wsAddressModel.Address), wsAddressModel.Port);
            }

            _socketServer.KeepClean = _webSocketOptions.KeepClean;
            _socketServer.WaitTime  = TimeSpan.FromSeconds(_webSocketOptions.WaitTime);
            //_socketServer.AllowForwardedRequest = true;
        }
コード例 #2
0
 public ActionResult GetByAddressID(int AddressID, string Type)
 {
     try
     {
         IAddressModel objAdd  = null;
         int           LoginID = GetLogin();
         if (LoginID > 0)
         {
             if (Type == "billing")
             {
                 objAdd = objUDSvc.GetBillingAddressByID(AddressID);
             }
             else
             if (Type == "shipping")
             {
                 objAdd = objUDSvc.GetShippingAddressByID(AddressID);
             }
             return(Json(new Response {
                 IsSuccess = true, Message = "200", Result = objAdd
             }, JsonRequestBehavior.AllowGet));
         }
         return(Json(new Response {
             Code = 200, IsSuccess = false, Message = string.Format(StringResource.Invalid, "Session")
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         ErrorLog.Log("HomeController", "GetByAddressID", ex);
         return(Json(new Response {
             IsSuccess = false, Message = ex.Message
         }, JsonRequestBehavior.AllowGet));
     }
 }
コード例 #3
0
        public IResponse <IAddressModel, AddressResponse> CreateAddress(IAddressModel request)
        {
            Logger.Here().Information("BGN");

            Logger.Here().Information("END");
            return(null);
        }
コード例 #4
0
 public void SetModel(IAddressModel model)
 {
     this.AddressModel = (IAddressModel)model;
     if (!string.IsNullOrEmpty(this.AddressModel.Notes))
     {
         ShipComments.Text = AddressModel.Notes;
     }
 }
コード例 #5
0
        private Uri CreateDestinationUri(IAddressModel address, string path)
        {
            var scheme = "ws";

            if (_webSocketOptions.IsSsl)
            {
                scheme = "wss";
            }

            var wsAddress = $"{scheme}://{address.Address}:{address.Port}{path}";

            return(new Uri(wsAddress));
        }
コード例 #6
0
ファイル: AddressBook.ascx.cs プロジェクト: lulzzz/BrandStore
    protected void DataListAddressBook_OnItemDataBound(object source, DataListItemEventArgs args)
    {
        if ((args.Item.ItemType == ListItemType.Item) ||
            (args.Item.ItemType == ListItemType.AlternatingItem))
        {
            IAddressModel model       = (IAddressModel)args.Item.DataItem;
            var           addressView = (OPCUserControl <IAddressModel>)args.Item.FindControl("AddressStaticItem");

            addressView.SetModel(model, StringResourceProvider);
            addressView.Enable();
            addressView.Show();
            addressView.BindView();
        }
    }
コード例 #7
0
 private void MarkAddressFail(GovernanceOptions governanceOptions, IAddressModel selectedAddress,
                              bool isTimeoutEx = false)
 {
     if (governanceOptions.FuseProtection)
     {
         selectedAddress.MakeFusing(governanceOptions.FuseSleepDuration);
         if (selectedAddress.FuseTimes > governanceOptions.FuseTimes && !isTimeoutEx)
         {
             _healthCheck.ChangeHealthStatus(selectedAddress, false, governanceOptions.FuseTimes);
         }
     }
     else if (!isTimeoutEx)
     {
         _healthCheck.ChangeHealthStatus(selectedAddress, false);
     }
 }
コード例 #8
0
        private void ConfigurePrimaryBillingAddress()
        {
            IAddressModel address = this.AccountModel.AddressBook
                                    .FirstOrDefault(abm => abm.AddressId != this.AccountModel.PrimaryShippingAddressId);

            if (address != null)
            {
                // set the billing address id to the first non-shipping address found.
                this.AccountModel.PrimaryBillingAddressId = address.AddressId;
            }
            else
            {
                // set to zero, which will force the creation of an address
                this.AccountModel.PrimaryBillingAddressId = "0";
            }
        }
コード例 #9
0
        public DotNettyTcpServerMessageListener(IOptions <RpcOptions> rpcOptions,
                                                IHostEnvironment hostEnvironment,
                                                ITransportMessageDecoder transportMessageDecoder,
                                                IHealthCheck healthCheck)
        {
            _hostEnvironment         = hostEnvironment;
            _transportMessageDecoder = transportMessageDecoder;
            _healthCheck             = healthCheck;
            _rpcOptions  = rpcOptions.Value;
            _hostAddress = NetUtil.GetRpcAddressModel();
            if (_rpcOptions.IsSsl)
            {
                Check.NotNullOrEmpty(_rpcOptions.SslCertificateName, nameof(_rpcOptions.SslCertificateName));
            }

            Logger = NullLogger <DotNettyTcpServerMessageListener> .Instance;
        }
コード例 #10
0
 public void SetModel(IAddressModel model)
 {
     this.AddressModel = (IAddressModel)model;
 }
コード例 #11
0
 public void SetModel(IAddressModel model)
 {
     this.AddressModel = (Vortx.OnePageCheckout.Models.IAddressModel)model;
 }