473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MemberAttributes for CodeConstructor

hi
I am trying to dynamically generate a static constructor using
CodeDOM. However even though i set the MemberAttributes to static, it
generates a constructor with no attributes. not sure how to do. Any
help please.

Here is my code
CodeConstructor staticConstructor = new
CodeConstructor();
staticConstructor.Attributes |=
MemberAttributes.Static;
newClass.Members.Add(staticConstructor);
This is generating a constructor as below:

MyClass()
{

}

Its not appending the "static" keyword with the constructor. What am i
missing?

Thanks

Feb 16 '07 #1
1 1921
The static ctor is CodeTypeConstructor

Marc
Feb 16 '07 #2

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

Similar topics

0
by: Ron Bullman | last post by:
Hi, I havent been able to find any documentation about @ in the CodeDom context. The problem is when generating C# code from CodeDom it will associate a @-tag with all C# specific types. Why?...
3
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...
8
by: Wayne | last post by:
I have an instance of a System.CodeDom.CodeNamespace. I am currently spinning through the types, and the members of each type. I am trying to find the Codememberfields that require creation before...
1
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...
5
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...
2
by: Lev | last post by:
Hi, I have some code that does reflection on an assembly I load. When I try to get the attributes on one of the methods implemented in the assembly, the MC++ version does not return anything....
8
by: Bill Rust | last post by:
I've created an "Add Item" wizard for VB.NET 2003 that allows a user to add a specialized class that works with my application framework. In the wizard, the user can select the interfaces they...
8
by: Gregory A Greenman | last post by:
I have a minor, but somewhat frustrating, problem. In a program I'm working on, I've got a tabcontrol that contains several other controls, a few of which are comboboxes. In the IDE, one of the...
2
by: Microsoft Newsgroups | last post by:
Hi All, I'm looking for some simple examples of using the CodeDom. While the ones that I have found have been very helpful, I can't seem to find the following: How to add a control to a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...

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.