void Start() { #if UNITY_STANDALONE_WIN var margins = new MARGINS() { cxLeftWidth = -1 }; // Get a handle to the window var hwnd = GetActiveWindow(); // Set properties of the window // See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms633591%28v=vs.85%29.aspx SetWindowLong(hwnd, GWL_STYLE, WS_POPUP | WS_VISIBLE); // Extend the window into the client area See : https : //msdn.microsoft.com/en-us/library/windows/desktop/aa969512%28v=vs.85%29.aspx DwmExtendFrameIntoClientArea(hwnd, ref margins); #endif #if UNITY_STANDALONE_LINUX d = new LongTimeTask_Delegate(ShowWindow); R = d.BeginInvoke(null, null); blit_Texture = Camera.main.targetTexture; pBlitTexture = new Texture2D(blit_Texture.width, blit_Texture.height, TextureFormat.ARGB32, false); Camera.main.projectionMatrix = Camera.main.projectionMatrix * Matrix4x4.Scale(new Vector3(1.0f, -1.0f, 1.0f)); #endif }
private void DoPhoneGen() { // 我想 update 個 UI,用咗 Task + AsyncCallback 嚟分開 UI 同 server job LongTimeTask_Delegate d = new LongTimeTask_Delegate(LTT_MemberPhoneNumber); IAsyncResult R = d.BeginInvoke("GenPhoneNumbers", new AsyncCallback(TC_MemberPhoneNumber), null); //invoking the method progressBar1.Visible = true; _Timer.Start(); }
public static void SendEmail(string toEmails, string subject, String messageBody) { LongTimeTask_Delegate d = null; d = new LongTimeTask_Delegate(sendmail); IAsyncResult R = null; if (toEmails != null) { R = d.BeginInvoke(toEmails, subject, messageBody, null, null); } }
private void cmdGenRegionCode_Click(object sender, EventArgs e) { if (chkChina.Checked) { _IsAllItemsProcessed = false; LongTimeTask_Delegate d = new LongTimeTask_Delegate(LTT_RegionCode); IAsyncResult R = d.BeginInvoke("GenRegionCodes", new AsyncCallback(TC_RegionCode), null); //invoking the method progressBar1.Visible = true; _Timer.Start(); } if (chkHongKong.Checked) { _IsAllItemsProcessed = false; LongTimeTask_Delegate d = new LongTimeTask_Delegate(LTT_RegionCode); IAsyncResult R = d.BeginInvoke("GenRegionCodes", new AsyncCallback(TC_RegionCode), null); //invoking the method progressBar1.Visible = true; _Timer.Start(); } if (chkMacao.Checked) { _IsAllItemsProcessed = false; LongTimeTask_Delegate d = new LongTimeTask_Delegate(LTT_RegionCode); IAsyncResult R = d.BeginInvoke("GenRegionCodes", new AsyncCallback(TC_RegionCode), null); //invoking the method progressBar1.Visible = true; _Timer.Start(); } if (chkTaiwan.Checked) { _IsAllItemsProcessed = false; LongTimeTask_Delegate d = new LongTimeTask_Delegate(LTT_RegionCode); IAsyncResult R = d.BeginInvoke("GenRegionCodes", new AsyncCallback(TC_RegionCode), null); //invoking the method progressBar1.Visible = true; _Timer.Start(); } }
private void ok_bt_Click(object sender, RoutedEventArgs e) { model.Comname = (string)COMListbox.SelectedValue; if (model.Comname != null) { sendengrid.Visibility = Visibility.Hidden; Plot1.Visibility = Visibility.Visible; senden_delegate = new LongTimeTask_Delegate(senden_an_pic); ruckruf_delegate = senden_delegate.BeginInvoke(new AsyncCallback(TaskCompleted), null); senden_delegate.EndInvoke(ruckruf_delegate); //model.versenden(); } else { Info_txt_box.Text = "Das COM Port wurde nicht ausgewählt"; } }
public ActionResult UpdateAs() { //http://www.codeproject.com/Articles/426120/Calling-a-method-in-Csharp-asynchronously-using-de LongTimeTask_Delegate d = null; d = new LongTimeTask_Delegate(longJob); IAsyncResult R = null; MembershipUserCollection all = Membership.GetAllUsers(); foreach (MembershipUser item in all) { R = d.BeginInvoke(item.UserName, null, null); //invoking the method } R = d.BeginInvoke("db", null, null); return RedirectToAction("Index", "Home", new { area = "" }); // return Json(new { redirectUrl = Url.Action("Index", "Home", new { area = "" }) },JsonRequestBehavior.AllowGet); }