public WrapperCreator() { mDelegate = new HandleDelegate(OnRequest); ExportGui_SetCreatorWrapps(mDelegate); InitialiseWidgetCreator(); }
private void Btn_Start_Click(object sender, EventArgs e) { HandleDelegate task1 = GetListBoxItems1; task1.BeginInvoke(null, null); HandleDelegate task2 = GetListBoxItems2; task2.BeginInvoke(null, null); }
/// <summary> /// 注册事件监听 /// </summary> /// <param name="key"></param> /// <param name="handle"></param> public void AddEventListener(X key, HandleDelegate handle) { if (HandleDelegateDic.ContainsKey(key)) { HandleDelegateDic[key] += handle; } else { HandleDelegateDic.Add(key, handle); } }
/// <summary> /// 取消事件监听 /// </summary> /// <param name="key"></param> /// <param name="handle"></param> public void RemoveEventListener(X key, HandleDelegate handle) { if (HandleDelegateDic.ContainsKey(key)) { HandleDelegateDic[key] -= handle; } else { Debug.Log("事件未注册"); } }
public void BindSource(string queueName, Delegate RoutingProcessor) { _routingProcessor = RoutingProcessor; HandleDelegate del = Handle; //Set this object up as the listener and start it if (SourceBus.MessageConverter == null) { SourceBus.CreateListener(queueName, queueName, true, del); } }
private void Btn_start_Click(object sender, EventArgs e) { b2.BackColor = Color.Yellow; b5_1.BackColor = Color.Yellow; b5_2.BackColor = Color.Yellow; b6.BackColor = Color.Yellow; b7.BackColor = Color.Yellow; b8.BackColor = Color.Yellow; //开始自检 HandleDelegate task = Start_Click; task.BeginInvoke(null, Btn_start); listBox1.Items.Clear(); }
private void Btn_Start_Click(object sender, EventArgs e) { //HandleDelegate task = Start_Click; //task.BeginInvoke(null, null); HandleDelegate task1 = GetListBoxItems1; task1.BeginInvoke(null, null); HandleDelegate task2 = GetListBoxItems2; task2.BeginInvoke(null, null); HandleDelegate task3 = GetListBoxItems3; task3.BeginInvoke(null, null); HandleDelegate task4 = GetListBoxItems4; task4.BeginInvoke(null, null); }
public static bool HandleAction(IntPtr handle, int processId, HandleDelegate handleDelegate, params object[] args) { Process currentProcess = Process.GetCurrentProcess(); bool remote = (processId != currentProcess.Id); SafeProcessHandle processHandle = null; SafeObjectHandle objectHandle = null; try { if (remote) { processHandle = NativeMethods.OpenProcess(ProcessAccessRights.DuplicateHandle, true, processId); if (NativeMethods.DuplicateHandle(processHandle.DangerousGetHandle(), handle, currentProcess.Handle, out objectHandle, 0, false, DuplicateHandleOptions.SameAccess)) { handle = objectHandle.DangerousGetHandle(); } } return(handleDelegate.Invoke(handle, args)); } finally { if (remote) { if (processHandle != null) { processHandle.Close(); } if (objectHandle != null) { objectHandle.Close(); } } } }
public static AppError HandleMessage(string _message) { Log.LogDebug("JSAPI", "cache a message {0}", _message); //messagePool.Enqueue(_message); string message = _message; // get method int pos = message.IndexOf('|'); if (pos < 0) { return(new AppError(1, "_message is invaliad")); } string method = message.Substring(0, pos); //get activity message = pos < message.Length - 1 ? message.Substring(pos + 1, message.Length - pos - 1) : ""; pos = message.IndexOf('|'); if (pos < 0) { return(new AppError(1, "_message is invaliad")); } string activity = message.Substring(0, pos); //get param string param = pos < message.Length - 1 ? message.Substring(pos + 1, message.Length - pos - 1) : ""; HandleDelegate handle = findHandle(method); if (null == handle) { return(new AppError(1, "handle is not exists")); } handle(activity, param); Resources.UnloadUnusedAssets(); System.GC.Collect(); return(new AppError(0, "")); }
public override void handlePOSTRequest(HttpProcessor p, StreamReader inputData) { Config config = new Config(); string priterNameConfig = config.ReadString("printer", "print", null); if (priterNameConfig == null || priterNameConfig.Length == 0) { p.writeSuccess("application/json"); Response res = new Response(); res.stauts = ResStatusCode.NO_Printer.ToString(); res.desc = "请先设置打印面单机器"; string json = JsonConvert.SerializeObject(res); p.outputStream.WriteLine(json); } else { HandleDelegate handleDelegate = asynHandle; string data = inputData.ReadToEnd(); try { Console.WriteLine("======data===========================" + data); JArray item = (JArray)JsonConvert.DeserializeObject(data); IAsyncResult result = handleDelegate.BeginInvoke(item, null, null); p.writeSuccess("application/json"); Response res = new Response(); res.stauts = ResStatusCode.Success.ToString(); string json = JsonConvert.SerializeObject(res); p.outputStream.WriteLine(json); } catch (Newtonsoft.Json.JsonReaderException e) { p.writeSuccess("application/json"); Response res = new Response(); res.stauts = ResStatusCode.Forma_Error.ToString(); res.desc = "数据格式错误"; string json = JsonConvert.SerializeObject(res); p.outputStream.WriteLine(json); } } }
private static extern void ExportGui_SetGetNativeByWrapper(HandleDelegate _delegate);
/// <summary> /// 循环播放 /// </summary> private void RunTxtThread() { MyDelegate = new HandleDelegate(SetControls); MyDelegate2 = new HandleDelegate2(SetRichTextBox); SizeFDelegate = new GeiSizeF(GetSize); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(Application.StartupPath + "\\tree.xml"); XmlNode nodePage = xmlDoc.SelectSingleNode("tree/" + ShowPage); while (true) { foreach (XmlNode cruNode in nodePage) { try { if (cruNode.HasChildNodes && cruNode.ChildNodes[0].Name.Contains("表")) { TableHandleDelegate(cruNode); } else if (cruNode.InnerText.Contains("word文档")) { WordHandleDelegate(cruNode); } else if (cruNode.InnerText.Contains(".txt")) { TxtHandleDelegate(cruNode); } } catch (Exception ee) { if (!ee.Message.Contains("正在中止线程")) ew.MonthErrorWriter(ee.Message + "||" + ee.StackTrace.ToString()); } } } }
public FTDIBoxRequestHandlerInfo(HandleDelegate handler, FTDIBoxCommandHandlerAttribute info) { Handler = handler ?? throw new ArgumentNullException(nameof(handler)); Info = info ?? throw new ArgumentNullException(nameof(info)); }
public DefaultContextEventListener(HandleDelegate aHandler) { handler = aHandler; }
public DefaultContextEventListener(T callerController, HandleDelegate aHandler) : base(callerController) { handler = aHandler; }
public GetNativeByWrapper() { mDelegate = new HandleDelegate(OnRequest); ExportGui_SetGetNativeByWrapper(mDelegate); }
public static void RegisterHandle(string _method, HandleDelegate _dalegate) { handles.Add(_method, _dalegate); }
private static extern void ExportGui_SetCreatorWrapps(HandleDelegate _delegate);
private void Start_Click() { b1_f1.BackColor = Color.Yellow; b1_f2.BackColor = Color.Yellow; b1_f3.BackColor = Color.Yellow; b1_f4.BackColor = Color.Yellow; HandleDelegate task1 = Start_FJ1; task1.BeginInvoke(null, null); HandleDelegate task2 = Start_FJ2; task2.BeginInvoke(null, null); HandleDelegate task3 = Start_FJ3; task3.BeginInvoke(null, null); HandleDelegate task4 = Start_FJ4; task4.BeginInvoke(null, null); b4_1.BackColor = Color.Yellow; b4_2.BackColor = Color.Yellow; b4_3.BackColor = Color.Yellow; b4_4.BackColor = Color.Yellow; HandleDelegate task5 = Start_Replenishment1; task5.BeginInvoke(null, null); HandleDelegate task6 = Start_Replenishment2; task6.BeginInvoke(null, null); HandleDelegate task7 = Start_Replenishment3; task7.BeginInvoke(null, null); HandleDelegate task8 = Start_Replenishment4; task8.BeginInvoke(null, null); b3_1.BackColor = Color.Yellow; b3_2.BackColor = Color.Yellow; b3_3.BackColor = Color.Yellow; b3_4.BackColor = Color.Yellow; HandleDelegate task9 = Start_InOut1; task9.BeginInvoke(null, null); HandleDelegate task10 = Start_InOut2; task10.BeginInvoke(null, null); HandleDelegate task11 = Start_InOut3; task11.BeginInvoke(null, null); HandleDelegate task12 = Start_InOut4; task12.BeginInvoke(null, null); HandleDelegate task13 = Start_HJStorage1; task13.BeginInvoke(null, null); HandleDelegate task14 = Start_HJStorage2; task14.BeginInvoke(null, null); }
public RequestHandlerInfo(Command address, HandleDelegate handler) { Address = address; Handler = handler ?? throw new ArgumentNullException(nameof(handler)); }