Ejemplo n.º 1
0
 private void UpdateImage_tab4_end_set(bool a)
 {
     if (InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(UpdateImage_tab4_end_set);
         Invoke(d, new object[] { a });
     }
     else
     {
         loadingCircle_tab4.Visible = false;
         loadingCircle_tab4.Active  = false;
         button_back_tab4.Enabled   = true;
         button_next_tab4.Enabled   = true;
         button_savepr.Enabled      = true;
         button_pr.Enabled          = true;
         button_show.Enabled        = true;
         button_print.Enabled       = true;
         numericUpDown1.Enabled     = true;
         button_peview.Enabled      = true;
         label_percentage.Text      = TB.L.Phrase["VectorMaster.Word.Complete"];
         progressBar1.Value         = 0;
         timer1.Stop();
         process_status = 7;
         CheckStatus();
     }
 }
Ejemplo n.º 2
0
 public static void SetVisible(Control control, bool visible)
 {
     if (control.InvokeRequired)
     {
         SetVisibleCallback callback = new SetVisibleCallback(SetVisible);
         control.BeginInvoke(callback, new object[] { control, visible });
     }
     else
     {
         control.Visible = visible;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Visibleスイッチのスレッドセーフ
 /// </summary>
 /// <param name="tar"></param>
 /// <param name="sw"></param>
 public void SetVisible(Control tar, bool sw)
 {
     if (tar.InvokeRequired)
     {
         var d = new SetVisibleCallback(SetVisible);
         tar.Invoke(d, new object[] { tar, sw });
     }
     else
     {
         tar.Visible = sw;
     }
 }
Ejemplo n.º 4
0
 //컨트롤의 Visible값을 변경하기 위함
 private void SetVisible(Control control, bool flag)
 {
     if (control.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         this.Invoke(d, new object[] { control, flag });
     }
     else
     {
         control.Visible = flag;
     }
 }
Ejemplo n.º 5
0
 public static void SetVisible(Form form, Control ctrl, bool visible)
 {
     if (ctrl.InvokeRequired)
     {
         var d = new SetVisibleCallback(SetVisible);
         form.Invoke(d, form, ctrl, visible);
     }
     else
     {
         ctrl.Visible = visible;
     }
 }
Ejemplo n.º 6
0
 private void SetVisible(Control ctl, bool vis)
 {
     if (ctl.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         Invoke(d, new object[] { ctl, vis });
     }
     else
     {
         ctl.Visible = vis;
     }
 }
Ejemplo n.º 7
0
 private void setVisible(Control control, bool visible)
 {
     if (control.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(setVisible);
         control.Invoke(d, new object[] { control, visible });
     }
     else
     {
         control.Visible = visible;
     }
 }
Ejemplo n.º 8
0
 private void SetVisible(bool visible)
 {
     if (this.btnPassTurn.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         this.Invoke(d, new object[] { visible });
     }
     else
     {
         this.btnPassTurn.Visible = visible;
     }
 }
Ejemplo n.º 9
0
 public static void ShowUI(bool isShown)
 {
     if (Program.mw.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(ShowUI);
         Program.mw.loadingImage.Invoke(d, new object[] { isShown });
     }
     else
     {
         Program.mw.loadingImage.Visible = isShown;
     }
 }
Ejemplo n.º 10
0
 private void SetVisible(bool value)
 {
     if (this.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         this.Invoke(d, new object[] { value });
     }
     else
     {
         this.Visible = value;
     }
     Control.CheckForIllegalCrossThreadCalls = false;
 }
Ejemplo n.º 11
0
 private void OnError(bool a)
 {
     if (InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(OnError);
         Invoke(d, new object[] { a });
     }
     else
     {
         MessageBox.Show("???????????? ???????????????? ?? ?????????? ????????????:\" " + errorarg + "\"", "????????????", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         tabControl1.SelectedIndex = 1;
     }
 }
Ejemplo n.º 12
0
 private void SetVisible(Label fs, bool obj)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (fs.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         this.Invoke(d, new object[] { fs, obj });
     }
     else
     {
         fs.Visible = obj;
     }
 }
Ejemplo n.º 13
0
 private void SetVisible(bool value)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.groupBoxCargando.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         this.Invoke(d, new object[] { value });
     }
     else
     {
         this.groupBoxCargando.Visible = value;
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Set enabled property of various controls
 /// </summary>
 /// <param name="form">The calling form</param>
 /// <param name="ctrl"></param>
 /// <param name="visible"></param>
 public static void SetVisible(Form form, Control ctrl, bool visible)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (ctrl.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         form.Invoke(d, new object[] { form, ctrl, visible });
     }
     else
     {
         ctrl.Visible = visible;
     }
 }
Ejemplo n.º 15
0
 public static void SetVisible <TObject>(TObject objCtrl, bool isVisible, Form winf) where TObject : System.Windows.Forms.Control
 {
     if (objCtrl.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         if (winf.IsDisposed)
         {
             return;
         }
         winf.Invoke(d, new object[] { objCtrl, isVisible, winf });
     }
     else
     {
         objCtrl.Visible = isVisible;
     }
 }
Ejemplo n.º 16
0
 private void UpdateImage_tab2_end_set(bool a)
 {
     if (InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(UpdateImage_tab2_end_set);
         Invoke(d, new object[] { a });
     }
     else
     {
         button_peview.Enabled      = true;
         loadingCircle_tab2.Active  = false;
         loadingCircle_tab2.Visible = false;
         button_next_tab2.Enabled   = true;
         button_back_tab2.Enabled   = true;
     }
 }
 public void SetVisible(bool value)
 {
     if (this.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         try {
             this.Invoke(d, new object[] { value });
         }
         catch (Exception e) {
         }
     }
     else
     {
         this.Visible = value;
     }
 }
Ejemplo n.º 18
0
 private void ImgPr_end_set(bool a)
 {
     if (InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(ImgPr_end_set);
         Invoke(d, new object[] { a });
     }
     else
     {
         loadingCircle_tab1.Visible = false;
         loadingCircle_tab1.Active  = false;
         button_next_tab1.Enabled   = true;
         button_refreshlist.Enabled = true;
         button_removepr.Enabled    = true;
         button_preview.Enabled     = true;
     }
 }
Ejemplo n.º 19
0
 private void UpdateImage_tab3_end_set(bool a)
 {
     if (InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(UpdateImage_tab3_end_set);
         Invoke(d, new object[] { a });
     }
     else
     {
         button_peview.Enabled      = true;
         loadingCircle_tab3.Active  = false;
         loadingCircle_tab3.Visible = false;
         button_next_tab3.Enabled   = true;
         button_back_tab3.Enabled   = true;
         button_update_tab3.Text    = TB.L.Phrase["VectorMaster.Word.Update"];
     }
 }
Ejemplo n.º 20
0
 private void End(bool a)
 {
     if (InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(End);
         Invoke(d, new object[] { a });
     }
     else
     {
         print.Abort();
         Thread.Sleep(1000);
         label2.Text = string.Format("???? {0:0.##} ??????. ?????? {1:0.##} ??????.", time, time / 60);
         state       = 5;
         CheckState();
         tabControl1.SelectedIndex = 5;
     }
 }
Ejemplo n.º 21
0
 private void showPatching()
 {
     if (this.pictureBoxProgressBar.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(showPatching);
         this.Invoke(d, new object[] { });
     }
     else
     {
         pictureBoxProgressBar.Width   = 0;
         pictureBoxProgressBar.Visible = true;
         pictureBoxTotalBar.Visible    = true;
         pictureBoxPatching.Visible    = true;
         pictureBoxChecking.Visible    = false;
         label1.Visible = true;
         this.Refresh();
     }
 }
Ejemplo n.º 22
0
 internal void SetVisible(Form form, dynamic ctrl, dynamic val)
 {
     try
     {
         if (ctrl.InvokeRequired)
         {
             SetVisibleCallback d = new SetVisibleCallback(SetVisible);
             form.Invoke(d, new object[] { form, ctrl, val });
         }
         else
         {
             ctrl.Visible = val;
         }
     }
     catch (Exception e)
     {
         MessageBox.Show("# Error setValue \n\n" + e);
     }
 }
Ejemplo n.º 23
0
 private void hidePatching()
 {
     if (this.pictureBoxProgressBar.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(hidePatching);
         this.Invoke(d, new object[] { });
     }
     else
     {
         pictureBoxProgressBar.Visible        = false;
         pictureBoxTotalBar.Visible           = false;
         pictureBoxPublicServersIndex.Visible = true;
         pictureBoxNoServersFound.Visible     = false;
         buttonPlay.Visible         = true;
         ServerIndexListBox.Visible = true;
         pictureBoxPatching.Visible = false;
         pictureBoxChecking.Visible = false;
         label1.Visible             = false;
         this.Refresh();
     }
 }
Ejemplo n.º 24
0
 private void button_next_tab1_Click_set(bool a)
 {
     if (InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(button_next_tab1_Click_set);
         Invoke(d, new object[] { a });
     }
     else
     {
         radioButton_xsize.Checked = true;
         comboBox_com.Items.AddRange(SerialPort.GetPortNames());
         comboBox_bdrate.SelectedItem = GlobalOptions.Mainbd.ToString();
         comboBox_com.SelectedItem    = GlobalOptions.Mainport;
         main_header = pr.Header;
         bmp         = new Bitmap(297, 210);
         long gdc = Helper.Helper.GCD((int)main_header.Width, (int)main_header.Height);
         label_ratio.Text       = "??????????. ????????????: " + main_header.Height / gdc + '/' + main_header.Width / gdc;
         textBox_xsize.Text     = "50";
         loadingCircle1.Visible = false;
         loadingCircle1.Active  = false;
         bmp = new Bitmap(210, 297);
         using (Graphics gr = Graphics.FromImage(bmp))
         {
             gr.SmoothingMode = SmoothingMode.AntiAlias;
             Rectangle rect = new Rectangle(0, 0, (int)ysize, (int)xsize);
             gr.FillRectangle(Brushes.White, rect);
             using (Pen thick_pen = new Pen(Color.Red, 0.2f))
             {
                 Bitmap tm = new Bitmap(pictureBox_prpreview.Image);
                 //tm.RotateFlip(RotateFlipType.Rotate90FlipNone);
                 gr.DrawRectangle(thick_pen, rect);
                 gr.DrawImage(tm, rect);
             }
         }
         pictureBox1.Image = bmp;
         pr = null;
         tabControl1.SelectedIndex = 1;
         button2.Enabled           = true;
     }
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 这里就是小师姐要求的心理贴士模块
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStrip_psyTip_Click(object sender, EventArgs e)
 {
     if (this.m_AutoSuggestion.Visible == false)
     {
         if (this.m_AutoSuggestion.InvokeRequired)
         {
             SetVisibleCallback d = new SetVisibleCallback(SetVisible);
             this.Invoke(d);
         }
         else
         {
             SetVisible();
         }
     }
     this.m_AutoSuggestion.UpdateEmotionSuggestionContent();//更新数据
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 定时弹出建议窗口
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 private void AutoRecommendSuggestion(object source, System.Timers.ElapsedEventArgs e)
 {
     if (this.m_AutoSuggestion.Visible == false)
     {
         if (this.m_AutoSuggestion.InvokeRequired)
         {
             SetVisibleCallback d = new SetVisibleCallback(SetVisible);
             this.Invoke(d);
         }
         else
         {
             SetVisible();
         }
     }
     this.m_AutoSuggestion.UpdateEmotionSuggestionContent();//更新数据
 }
Ejemplo n.º 27
0
 private void SetVisible(Control guiitem, bool visible)
 {
     if (guiitem.InvokeRequired)
     {
         SetVisibleCallback d = new SetVisibleCallback(SetVisible);
         this.Invoke(d, new object[] { guiitem, visible });
     }
     else
     {
         guiitem.Visible = visible;
     }
 }