Link to home
Create AccountLog in
Avatar of CipherIS
CipherISFlag for United States of America

asked on

C# Replace InvokeRequired

I am converting a form to a DLL.  Below is a snippet of an example of code that I am dealing with.  Is there a way to replace the InvokeRequired and Invoke in a class?
protected void MyMethod()
        {
            if (InvokeRequired)
            {
                Invoke(new DelegateVoid(MyMethod));
                return;
            }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of CipherIS

ASKER

I'm taking the guts of the form and putting it into the DLL.  Then returning the object back to the form.
First time I hear of guts in a form :-)    It's a very opened description of what you are trying to achieve.

What are those "guts"?

And what is that "object" that you are returning to the form?
What I meant by guts is taking the code from the win forms and putting it into the DLL.  I commented the code in the winforms and ran it with modifications and see that I probably don't need it.  It seems to be used for events that get fired.  I just put methods in one place and it provided the same solution in winforms which is what I'm trying to achieve in my DLL.  Now I'm working on solving another issue with it.  Thanks.