[WinForm] 익명변수

2012. 4. 6. 13:53C#/WinForm


public string CurrentActivity

        {

            get { return textBox1.Text; }

            set

            {

                if (InvokeRequired)

                {

                    MethodInvoker invoker = new MethodInvoker(delegate()

                    {

                        textBox1.Text = value;

                    });

                    Invoke(invoker);

                }

                else

                {

                    textBox1.Text = value;

                }

            }

        }