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

C#.NET Programming

Avatar of undefined
Last Comment
CipherIS
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of CipherIS
CipherIS
Flag of United States of America image

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?
Avatar of CipherIS
CipherIS
Flag of United States of America image

ASKER

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.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo