示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpEvent" /> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="target">The target.</param>
 /// <param name="request">The request.</param>
 public HttpEvent(string type, object target = null, UrlRequest request = null)
     : base(type, target)
 {
     mUrl            = request.url;
     mData           = request.data;
     mRequestHeaders = request.requestHeaders;
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UrlLoader"/> class.
 /// </summary>
 /// <param name="request">The request.</param>
 public UrlLoader(UrlRequest request = null)
 {
     if (request != null)
     {
         Load(request);
     }
 }
示例#3
0
        /// <summary>
        /// Loads the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Load(UrlRequest request)
        {
            mRequest = request;

            if (mRequest == null || string.IsNullOrEmpty(mRequest.url))
            {
                return;
            }

            mRequestTask = new Task(Request());
            string taskName = string.Format("{0}?timestap={1}", request.url, DateTime.Now.Millisecond.ToString());

            TaskManager.instance.AddTask(taskName, mRequestTask);
            mRequestTask.Start();
        }