Solved

Creating a 'run-time' class.

Posted on 2011-02-17
10
265 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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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 85

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:teylyn
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
dispose of a DataTable created in another class 4 23
Pass through dll 2 38
Expando 4 36
How can I use this extension method? 8 36
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now