473,395 Members | 1,763 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.

How create an attribute in CodeDom

Hi,

I need to generate an Attribute [SetUp] and associate it with a
method in CodeDom.

// Code snippet
CodeMemberMethod setUp = new CodeMemberMethod();
setUp.CustomAttributes.Add(new CodeAttributeDeclaration("SetUp"));

But, this creates an Attribute [SetUp()]. Which doesn't go well with
NUnit testing. I want to get reed of the brackets and final generated
output should be [SetUp]. How do I do this?

Thanks in advance.

Regards
Tapas
Nov 16 '05 #1
1 1750
Hi Tapas,
"Tapas" <ta***********@gmail.com> wrote in message
news:1b*************************@posting.google.co m...
But, this creates an Attribute [SetUp()]. Which doesn't go well with
NUnit testing. I want to get reed of the brackets and final generated
output should be [SetUp]. How do I do this?

AFAIK [Setup()] is equivalent to [Setup] - as [SetupAttribute] is to
[Setup].

I.e. your code is just fine.

Regards,

Lars Wilhelmsen
Software Engineer
Teleplan A/S, Norway
Nov 16 '05 #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...
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...
1
by: Gürkan Demirci | last post by:
Hi, i am using the VisualStudio FormDesigner to create an asp:table. I want to populate an asp:tablecell with different controls at runtime. In the codebehind file, there is an attribute for the...
4
by: Raja | last post by:
Have both .Net framework 1.1 and Framework 2.0 installed in my machine But, am unable to find out system.codedom.dll in my machine, one which, my application needs. Am not finding this dll in...
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
6
by: moondaddy | last post by:
will CodeDom create XAML windows or just regular windows forms? If so, how to I tell it to create a xaml window instead of a windows form? thanks -- moondaddy@noemail.noemail
1
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...
0
by: jcarter | last post by:
How can I create a CodeDOM statement to accomplish the following this.pictureBox.Image = <Convert the binary value of the picture from the XML file and display> I have tried the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.