Solved

Creating a 'run-time' class.

Posted on 2011-02-17
10
293 Views
Last Modified: 2012-05-11
Hi,

I'm vaguely familiar with the idea of design-time and run-time differences, particularly how the WinForms editor runs UserControls in real-time when they are on the form, such as layout managers etc...

What I'm wanting to know is, is there such a thing as a 'run-time' class? Where I have a class that perhaps through the use of reflection is capable of generating or altering code, while I am in the code viewer? When I say class I'd actually prefer a real C# class, but I don't know exactly how that would fit together, unless it has to be a custom component or something?

Thanks,
Uni
0
Comment
Question by:Unimatrix_001
10 Comments
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 34915327
check below link there is sample for Runtime Class

Nice example for Runtime Code.

http://olondono.blogspot.com/2008/02/creating-code-at-runtime.html
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 34915342
Hi kalpesh,

Thanks although that's not quite what I'm looking for...

Thanks,
Uni
0
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 34915421
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:Unimatrix_001
ID: 34915435
Hi Kalpesh,

Perhaps I haven't quite explained things very well... The short tale is, I want to create C# class that is 'live' while my actual program is still in design mode and let them interact; similar to how a usercontrol can run in realtime when placed on the form designer, even though the actual application is in design mode. Like that but with a class instead of a usercontrol.

Thanks,
Uni
0
 
LVL 11

Expert Comment

by:SAMIR BHOGAYTA
ID: 34915547
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 34915568
Samir - how does that fit my requirements?
0
 
LVL 10

Expert Comment

by:John Claes
ID: 34915573
Uni,

Short,
You want a C# Class that can be used/Called in Design Time (in designer view)
The best way herefor is the use of static Objects. This because they don't need to be initialised and can easly be used for desgner use.

If you can't use Static objects you should see to use Shared Objects
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 34915591
Poor beggar,

You want a C# Class that can be used/Called in Design Time (in designer view)
Yes, but I want the C# class that is called to be in runtime mode.

Could you give a short example or link me to something that does as I'm getting nothing useful.

Thanks,
Uni
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 34916258
Sounds more like you want a Visual Studio Add-In:
http://msdn.microsoft.com/en-us/vbasic/bb968855
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 34923909
@kalpesh2804 and @samirbhogayta

When you are posting, please do not simply post a link - all that shows is you are able to use Google to search and does nothing to suggest that you have any knowledge about the subject.  Links can also fail, so should your comment happen to answer the question and the link fails, then the solution is no longer valid.

If you can add a brief description in your own words about what can be found at the link, then add the link, then should the link fail, then all is not lost and your solution will still hold some value.

teylyn
Zone Advisor, Microsoft Office
teylyn -at- experts-exchange.com
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# Desktop Application 3 65
Problem to copy file 14 54
Return array 3 20
Visual Studio 2015 auto inserted code 12 71
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question