Exemple #1
0
        public void Compos()
        {
            ContainerConfiguration config = new ContainerConfiguration();

            config.WithAssembly(Assembly.GetExecutingAssembly()); // 将DLL的所有的类型导入容器中

            CompositionHost container = config.CreateContainer();

            var car = container.GetExport <IMotol>("QiChe");

            var motol = container.GetExport <IMotol>("MoTuo");

            car.Name = motol.Name;


            //使用数组导入
            Accepter accepter = new Accepter();

            container.SatisfyImports(accepter);
            foreach (var motolTarget in accepter.Accept)
            {
                var s = motolTarget.Name;
            }

            //使用Lazy
            container.SatisfyImports(accepter);
            Car c      = accepter.Compose.Value;
            var kvpair = accepter.Compose.Metadata;
        }
Exemple #2
0
 internal void PaySuccess(string payAccount, string payTradeNo, PayInterface payInterface, PayAccountType payAccountType, DateTime payTime, string channelTradeNo)
 {
     Tradement.PaySuccess(payAccount, payTradeNo, payInterface, payAccountType, channelTradeNo);
     Applier.TradeSuccess(payTime);
     Applier.Owner.Account = payAccount;
     Accepter.TradeSuccess(payTime);
 }
Exemple #3
0
        public ActionResult addRequest(Accepter a)
        {
            finalDataBaseEntities2 f = new finalDataBaseEntities2();

            f.Accepters.AddObject(a);
            f.SaveChanges();
            return(RedirectToAction("bloodRequest"));
        }
Exemple #4
0
 private void Start()
 {
     progressBar.fillAmount = 0;
     particleSystem.SetActive(false);
     timer         = 2f;
     statusChecked = false;
     paramentrs    = GameObject.FindGameObjectWithTag("Level Manager").GetComponent <Paramentrs>();
     accepter      = gameObject.GetComponentInParent <Accepter>();
     paramentrs.NeedCountInit(amount);
 }
Exemple #5
0
        internal HttpServer(WebApplication application, NetworkConfiguration networkConfiguration, MemoryConfiguration memoryConfiguration)
        {
            BufferProvider = new BufferProvider(memoryConfiguration.ClientBufferSize, memoryConfiguration.MaximalClientMemoryUsage);

            _accepter        = new Accepter(networkConfiguration, memoryConfiguration, BufferProvider, _acceptClient);
            _downloader      = new Downloader(_onHeadCompleted, _onContentCompleted);
            _responseManager = application.CreateResponseManager();
            _inputManager    = application.CreateInputManager();

            Unit = new ProcessingUnit();

            foreach (var table in application.CreateTables())
            {
                Unit.Database.AddTable(table);
            }
        }
Exemple #6
0
        /// <summary>
        /// Creates a listener for incoming connections
        /// </summary>
        /// <param name="ipAddress"></param>
        /// <param name="portNumber"></param>
        public void Listen(IPAddress ipAddress, int portNumber)
        {
            // Create DnsEndPoint. The hostName and port are passed in to this method.
            IPEndPoint hostEntry = new IPEndPoint(ipAddress, portNumber);

            // Create a stream-based, TCP socket using the InterNetwork Address Family.
            if (_socket != null)
            {
                Close();
            }
            _socket = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            // set the send and receive buffer sizes to some unreasonably large number (32k)
            _socket.SendBufferSize    = 32768;
            _socket.ReceiveBufferSize = 32768;

            // Bind the socket to the local endpoint, and listen for incoming connections.
            _socket.Bind(hostEntry);
            _socket.Listen(100);

            // get the object ready to continue to receive connections
            ListenAccepter = new Accepter(_socket, ConnectedEvent);
            ListenAccepter.AcceptNextAsync();
        }
Exemple #7
0
 internal void RefundSuccess(DateTime refundTime)
 {
     Applier.TradeSuccess(refundTime);
     Accepter.TradeSuccess(refundTime);
 }
Exemple #8
0
 private static int Score(Proposer proposer, Accepter accepter) => proposer.PreferenceOrder.ToList().IndexOf(accepter);