Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check the Control.InvokeRequired Property ? #1

Open
yuessir opened this issue Jan 5, 2021 · 0 comments
Open

How to check the Control.InvokeRequired Property ? #1

yuessir opened this issue Jan 5, 2021 · 0 comments

Comments

@yuessir
Copy link

yuessir commented Jan 5, 2021

My project has some snippet like:

if (InvokeRequired)
            {
                BeginInvoke(action);//action is Action type
            }
            else
            {
//Invoke
                action();
            }

I wanna refactor to following:

if (InvokeRequired)
            {
              InvokeAsync<Foo>();//action is Action type
            }
            else
            {
//Invoke
               Invoke<Foo>();
            }

How can I get the bool value,InvokeRequired?

@yuessir yuessir changed the title How to check 'InvokeRequired'? How to check the Control.InvokeRequired Property ? Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant