当前位置: 首页>>代码示例>>C#>>正文


C# SetTextCallback类代码示例

本文整理汇总了C#中SetTextCallback的典型用法代码示例。如果您正苦于以下问题:C# SetTextCallback类的具体用法?C# SetTextCallback怎么用?C# SetTextCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SetTextCallback类属于命名空间,在下文中一共展示了SetTextCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateMouse

        public void UpdateMouse()
        {
            if (this.m_Windows[0].InvokeRequired)
            {
                SetTextCallback d = new SetTextCallback(UpdateMouse);
                this.m_Windows[0].Invoke(d, new object[] { });
            }
            else
            {
                //Position.X = (float)m_Windows[0].Location.X;
                //Position.Y = (float)m_Windows[0].Location.Y;

                //Direction.X = (Cursor.Position.X + 10) - Position.X;
                //Direction.Y = (Cursor.Position.Y + 10) - Position.Y;

                //float length = (float)Math.Sqrt(Math.Pow(Direction.X, 2) + Math.Pow(Direction.Y, 2));

                //if (length != 0)
                //{
                //    Direction.X = Direction.X / length;
                //    Direction.Y = Direction.Y / length;
                //}

                //Position.X += Direction.X * Speed;
                //Position.Y += Direction.Y * Speed;

                //m_Windows[0].Location = new Point((int)Position.X, (int)Position.Y);

                m_Windows[0].Location = new Point(Cursor.Position.X + 10, Cursor.Position.Y + 10);
                m_Windows.Add(m_Windows[0]);
                m_Windows.RemoveAt(0);
            }
        }
开发者ID:drsoxen,项目名称:Glitter-Trail,代码行数:33,代码来源:Manager.cs

示例2: SetText

        private void SetText()
        {
            if (UpTxt.InvokeRequired)
            {
                updateDelegate = new SetTextCallback(SetText);
                try
                {
                    Invoke(updateDelegate);
                }
                catch (System.ObjectDisposedException e)
                {
                    Console.WriteLine("Caught exception: " + e.StackTrace);
                }

            }
            else
            {
                NET.Lock.WaitOne();
                float sumU = 0;
                float sumD = 0;
                foreach(NetworkAdapter adapter in NET.NetworkAdapters){
                    if (adapter.PhysicalAdapter)
                    {
                        sumU += adapter.KBSSentFloat;
                        sumD += adapter.KBSRecievedFloat;
                    }
                }
                UpTxt.Text = sumU.ToString("0.00 KB/s");
                DownTxt.Text = sumD.ToString("0.00 KB/s");
                NET.Lock.Release();
            }
        }
开发者ID:Kriogen777,项目名称:Otil,代码行数:32,代码来源:NETSummary.cs

示例3: plotData

        public void plotData(double data)
        {
            if (arduino.IsOpen)
            {
                if (this.chart1.InvokeRequired == true)
                {
                    SetTextCallback d = new SetTextCallback(plotData);
                    this.Invoke(d, new object[] { data });

                }
                else
                {
                    if (data < 100)
                    {
                        this.chart1.Series[0].Points.Add(data);
                        this.textBox1.Text = Math.Round(data, 2).ToString();
                        this.chart1.Update();
                    }
                    else
                    {
                        // Do nothing
                    }

                }

            }
        }
开发者ID:robojames,项目名称:Keithley-DMM,代码行数:27,代码来源:ArduinoCP.cs

示例4: Form_Display

        public Form_Display()
        {
            delegte1 = new SetTextCallback(SetText1);
            InitializeComponent();

            btn_port.Text = "&Connect";

            // add in the available  com ports

            foreach (string s in SerialPort.GetPortNames())
            {
                this.comboBox1.Items.Add(s);
            }

            if (comboBox1.Items.Count == 0)
            {
                comboBox1.Items.Add("NO PORT");
                this.comboBox1.SelectedIndex = 0;
                btn_port.Enabled = false;
                comboBox1.Enabled = false;
            }
            else
            {
                try
                {
                    this.comboBox1.SelectedIndex = Properties.Settings.Default.comport;
                }
                catch
                {
                    this.comboBox1.SelectedIndex = 0;
                }
            }
        }
开发者ID:garyStofer,项目名称:hygdisp,代码行数:33,代码来源:Form1.cs

示例5: SetText

        private void SetText()
        {
            if (TimeHMTxt.InvokeRequired)
            {
                updateDelegate = new SetTextCallback(SetText);
                try
                {
                    Invoke(updateDelegate);
                }
                catch (System.ObjectDisposedException e)
                {
                    Console.WriteLine("Caught exception: " + e.StackTrace);
                }

            }
            else
            {
                Sys.Lock.WaitOne();
                TimeHMTxt.Text = Sys.TimeHM;
                TimeSTxt.Text = Sys.TimeS;
                DateTxt.Text = Sys.Date;
                DayTxt.Text = Sys.Day;
                Sys.Lock.Release();
            }
        }
开发者ID:Kriogen777,项目名称:Otil,代码行数:25,代码来源:SystemSummary.cs

示例6: received

 public void received(String data)
 {
     if (this.txtReceived.InvokeRequired) {// ���̲߳�������ʱ��Ҫ���ûص���ʽ
         SetTextCallback d = new SetTextCallback(received);
         this.Invoke(d, new object[] { data });
     } else {
         txtReceived.Text += "\r\n���� " + data;
     }
 }
开发者ID:washheart,项目名称:fastipc,代码行数:9,代码来源:Form1.cs

示例7: Proxy_Client_0x06DoubleClick

 void Proxy_Client_0x06DoubleClick(UOProxy.Packets.FromClient._0x06DoubleClick e)
 {
     if (this.textBox1.InvokeRequired)
     {
         string text = e.Serial + "EUO: " + UOProxy.Helpers.Serial.IntToEUO(e.Serial);
         SetTextCallback d = new SetTextCallback(SetText);
         this.Invoke(d, new object[] { text });
     }
 }
开发者ID:Crwth,项目名称:UOnet,代码行数:9,代码来源:Form1.cs

示例8: SetText

 /// <summary>
 /// Threadsave Text Property setter
 /// </summary>
 /// <param name="control"></param>
 /// <param name="text"></param>
 public static void SetText(Control control, string text)
 {
     if(control.InvokeRequired) {
         SetTextCallback d = new SetTextCallback(SetText);
         control.Invoke(d, new object[] { control, text });
     } else {
         control.Text = text;
     }
 }
开发者ID:RaptorOne,项目名称:IronAHK,代码行数:14,代码来源:GUIInvokeHelper.cs

示例9: SetText

 private void SetText(string text) {
     if (textBox1.InvokeRequired) {
         var d = new SetTextCallback(SetText);
         Invoke(d, new object[] { text });
     }
     else {
         textBox1.AppendText(text);
     }
 }
开发者ID:satr,项目名称:rvslite,代码行数:9,代码来源:MessengerEmulatorControl.cs

示例10: SetDebugText

 public void SetDebugText( string text)
 {
     if (laDebug.InvokeRequired)
     {
         SetTextCallback d = new SetTextCallback(SetDebugText);
         this.Invoke(d, new object[] { text });
     }
     else
         laDebug.Text = text;
 }
开发者ID:ashgeo,项目名称:moovingearth,代码行数:10,代码来源:Form1.cs

示例11: changeButtons

 protected virtual void changeButtons()
 {
     if (button_search.InvokeRequired) {
         SetTextCallback d = new SetTextCallback(changeButtons);
         button_search.Invoke(d, new object[] { });
     } else {
         button_search.Visible = true;
         button_cancelSearch.Visible = false;
     }
 }
开发者ID:TheDizzler,项目名称:DJMixer,代码行数:10,代码来源:SongSearchForm.cs

示例12: Output

 public void Output(string message)
 {
     if (this.messageLog.InvokeRequired) {
         SetTextCallback d = new SetTextCallback(Output);
         this.Invoke(d, new object[] { message });
     }
     else {
         messageLog.Items.Add(message);
     }
 }
开发者ID:westre,项目名称:Rootstamp-Server-Daemon,代码行数:10,代码来源:MainForm.cs

示例13: MIDIMessageReceived

        private void MIDIMessageReceived(object sender, MidiInMessageEventArgs e)
        {
            if (e.MidiEvent is NoteEvent)
            {
                this.Note = new NoteID(((NoteEvent)e.MidiEvent).NoteNumber+1);

                SetTextCallback d = new SetTextCallback(SetPitchBoxText);
                this.Invoke(d, new object[] { ((NoteEvent)e.MidiEvent).NoteName });
            }
        }
开发者ID:Samaed,项目名称:RockTheSound,代码行数:10,代码来源:ShortcutPopup.cs

示例14: SetStatus

 private void SetStatus(string status)
 {
     if (lblStatus.InvokeRequired)
     {
         SetTextCallback d = new SetTextCallback(SetStatus);
         Invoke(d, new object[] { status });
     }
     else
         lblStatus.Text = status;
 }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:10,代码来源:PleaseWait.cs

示例15: Form1

 public Form1()
 {
     InitializeComponent();
     setTextCallback = new SetTextCallback(mavLinkTextBoxSetText);
     //setTextCallback = new SetTextCallback(SetText);
     string[] theSerialPortNames = System.IO.Ports.SerialPort.GetPortNames();
     comPortComboBox.Items.AddRange(theSerialPortNames);
     comPortComboBox.Items.Add("TCP");
     comPortComboBox.Items.Add("UDP");
     baudRateComboBox.Items.AddRange(baudRates);
 }
开发者ID:ExcaliburVT,项目名称:OculusFPV,代码行数:11,代码来源:Form1.cs


注:本文中的SetTextCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。