473,545 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CodeDom - I only want method/property/member code

First, I apologize if this isn't the right group to post this question, but
I didn't see a newsgroup specific to CodeDom so here I am.

On to my question:
I am trying to use CodeDom to generate Method, Property, and Member code,
but ONLY that code.
It appears as though the only way to generate code is through the
CodeGenerator/CodeProvider, which you have to attach a namespace then a
class to the namespace then your members to that class. This results in an
entire class being generated, which I don't want. I should also mention
that I don't want to write the code verbatim, because then I have to manage
the spacing carriage returns etc.

My project involves Templates which has base code with Replacement Strings
not unlike the default AddNewItem Wizards available in VS.NET however I want
to place a group of methods generated from the CodeDom into some of those
Replacement Strings, hence not wanting to get back an entire Class
Generation.

Any leads on this would be greatly appreciated!

Shawn Hall
Vreo, Inc
Nov 15 '05 #1
0 1063

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9241
by: Tapas | last post by:
Hi, Generating a .cs file using CodeDom. It generates the class fine. But i have few queries about class generation. 1. How to create a protected member? By default it generates a private method. To make it static say, I do something like this - CodeMemberMethod method = new CodeMemberMethod(); method.Name = "TestMethod";
0
1124
by: Saradhi | last post by:
Hi All , I am using the Code model for Generating the VB code on the Fly. I am able to generate a new class with the Variables, Fields and Methods I want. Now What I want is the facility to modify a Member's Details inside my already generated Class. For Ex: Protected m_OilProd As TimeSeriesDoublePublic Overridable Property OilProd()...
4
3532
by: Chuck Bowling | last post by:
I am using CodeDOM to generate source files. The classes being generated have a const string member. This member is referenced in an abstract base class but declared in the inheriting class. I can't declare the string in the abstract class because it would require initialization. Is there a way to require that any class inheriting from the...
4
1995
by: Vagmi Mudumbai | last post by:
Hi, I am working on CodeDOM to generate a more usable class to serialize and deserialize WXS files. I have hit the wall at a pretty early stage. :-( I am attempting to change the member public fields into properties. I have written a generic field to property code for that. It is almost straight out of the link that you gave me. :-) But...
1
304
by: Kai Huener | last post by:
ello, I try to make a function, adding automatically all functions to a new class which are necessary because of implemented Interfaces or inherited, abstract classes. In the last case, it is necessary to have two attributes in front of the function, like protected override void Foo(){}. And now my question: 1.: I can't find the Attribute...
5
2483
by: Mark | last post by:
I'm using the CodeDom namespace to generate code. How do you specify that the method of a class should be static? I'm assuming I use the CodeMemberMethod class to define the method, but I'm not seeing the property of the class that would allow me to specify that the method should be static. Thanks in advance. Mark
0
997
by: Ashish | last post by:
hi All, I am a trying to use the CodeDOM namespace to generate some startup code for my project, there are couple of things i have questions on :) 1. Use of MemberAttribute enum in CodeMemberProperty.Attributes Property. I am setting the value to MemberAttributes.Public, and the generated code looks like
7
2660
by: Ashish | last post by:
I am using the CodeDom namespace for generating classes, and would really like to be able to use the CodeRegionDirective class to generate regions around code blocks. The only problem is that is looks like i can generate regions around a single method or a single statement (using StartDirective) property, is there any way to out a code...
1
4864
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
I may have painted myself into a corner with GenerateInMemory=true. My app need a custom user step. Users want to code (sort of - they are not programmers) some refinements to a search procedure. They can concoct a moderately complex boolean expression, and that suffices. I will take their statements, add top and bottom text, and now I...
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5984
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.