public void Init(CallBackArg <T> dispatchCall, T dispatchArgumentParameter, bool waitForExecution, bool safeMode) { this.safeMode = safeMode; this.dispatchCallArg = dispatchCall; this.dispatchArgParam = dispatchArgumentParameter; this.ValidateExecutionOnInit(waitForExecution); }
public static THttpDown DoGet(string url, CallBackArg <THttpDown> callback, string contentType) { THttpDown hNHttpDwon = THttpDown.DoGet(url, callback); hNHttpDwon.SetContentType(contentType); return(hNHttpDwon); }
public static THttpDown DoPost(string url, CallBackArg <THttpDown> callback, string contentType) { THttpDown hNHttpDwon = THttpDown.DoGet(url, callback); hNHttpDwon.SetContentType(contentType); hNHttpDwon.isGet = false; hNHttpDwon.postParameters = new Dictionary <string, string>(); return(hNHttpDwon); }
public void DestroySelf() { this.url = null; this.contentType = null; this.tag = null; this.callback = null; this.data = null; bool flag = this.postParameters != null; if (flag) { this.postParameters.Clear(); } this.postParameters = null; }
public static void DispatchToMainThread <T>(CallBackArg <T> dispatchCall, T dispatchArgument, bool waitForExecution = false, bool safeMode = true) { if (MainThreadWatchdog.CheckIfMainThread()) { if (dispatchCall != null) { dispatchCall(dispatchArgument); } } else { ThreadDispatchAction <T> t = new ThreadDispatchAction <T>(); dispatchActions.Enqueue(t); t.Init(dispatchCall, dispatchArgument, waitForExecution, safeMode); } }
public static THttpDown DoGet(string url, CallBackArg <THttpDown> callback) { bool flag = THttpDown.IsDown(url, ""); THttpDown result; if (flag) { Debug.Log(url + "正在下载中,请不 要重复下载!"); result = null; } else { THttpDown hNHttpDwon = new THttpDown(url, callback); THttpDown.AddDown(hNHttpDwon); result = hNHttpDwon; } return(result); }
public static void DispatchToMainThread <T>(CallBackArg <T> dispatchCall, T dispatchArgument, bool waitForExecution = false, bool safeMode = true) { bool flag = MainThreadWatchdog.CheckIfMainThread(); if (flag) { bool flag2 = dispatchCall != null; if (flag2) { dispatchCall(dispatchArgument); } } else { ThreadDispatchAction <T> threadDispatchAction = new ThreadDispatchAction <T>(); MainThreadDispatcher.dispatchActions.Enqueue(threadDispatchAction); threadDispatchAction.Init(dispatchCall, dispatchArgument, waitForExecution, safeMode); } }
public THttpDown(string url, CallBackArg <THttpDown> callback) { this.url = url; this.callback = callback; }
static void SumPrime(object _sender, CallBackArg _arg) { mSum += (_arg as PrimeCallBackArg).Prime; }
static void PrintPrime(object _sender, CallBackArg _arg) { Console.Write((_arg as PrimeCallBackArg).Prime + ", "); }