Exemplo n.º 1
0
 private void DownloadModuleInfo(AfterDownloadModuleInfoEvent moduleInfoEvent, IRequestParam requestParam)
 {
     var obj = moduleInfoEvent.GetModuleCatalog();
     foreach (var moduleInfo in obj.Modules)
     {
         ModuleCatalog.AddModule(moduleInfo);
     }
     ModuleManager.Run();
 }
        /// <summary>
        /// Begins the specified @event.
        /// </summary>
        /// <param name="param">The @event.</param>
        public void OnSentRequest(IRequestParam param)
        {
            Logger.Log("��ʼ���������, �����ַΪ: " + param.Uri, Category.Debug, Priority.Medium);
            var request = (HttpWebRequest)WebRequest.Create(new Uri(Globals.ServerRoot, param.Uri));

            request.CookieContainer = Cookies;
            request.Method = "POST";
            var ar = request.BeginGetRequestStream(RequestCallback, new RequestState(request, param)
                                                                        {
                                                                            Synchronization = SynchronizationContext.Current
                                                                        });
            //ar.AsyncWaitHandle.WaitOne(new TimeSpan(0, 1, 0));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestState"/> class.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <param name="jsonRequest">The json request.</param>
 public RequestState(HttpWebRequest request, IRequestParam jsonRequest)
 {
     Request = request;
     RequestParam = jsonRequest;
 }
Exemplo n.º 4
0
 private void Completed(bool result, IRequestParam param)
 {
 }