473,320 Members | 2,054 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,320 software developers and data experts.

CodeMemberProperty

2G
Hi,

Following code always generates a property with the virtual modifier (see
below) , is there a way to remove this modifier ?

private static CodeMemberProperty CreateTablePropertie(string table){

CodeMemberProperty cmp = new CodeMemberProperty();

cmp.Name = table;

cmp.Type = new CodeTypeReference(table + "DataTable");

cmp.Attributes = MemberAttributes.Public;

cmp.HasGet = true;

cmp.HasSet = false;

CodeFieldReferenceExpression cfr = new CodeFieldReferenceExpression(new
CodeThisReferenceExpression(), "table" + table);

cmp.GetStatements.Add(new CodeMethodReturnStatement(cfr));

return cmp;

}

generated code:

public virtual AanbiedingenDataTable AccountHolder

{

get

{

return this.tableAanbiedingen;

}

}
Nov 16 '05 #1
1 3772
Hello

CodeFieldReferenceExpression cfr = new CodeFieldReferenceExpression(null,
"table" + table);

Best regards,
Sherif

"2G" <2G@pandora.be> wrote in message
news:eZ**************@tk2msftngp13.phx.gbl...
Hi,

Following code always generates a property with the virtual modifier (see
below) , is there a way to remove this modifier ?

private static CodeMemberProperty CreateTablePropertie(string table){

CodeMemberProperty cmp = new CodeMemberProperty();

cmp.Name = table;

cmp.Type = new CodeTypeReference(table + "DataTable");

cmp.Attributes = MemberAttributes.Public;

cmp.HasGet = true;

cmp.HasSet = false;

CodeFieldReferenceExpression cfr = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "table" + table);

cmp.GetStatements.Add(new CodeMethodReturnStatement(cfr));

return cmp;

}

generated code:

public virtual AanbiedingenDataTable AccountHolder

{

get

{

return this.tableAanbiedingen;

}

}

Nov 16 '05 #2

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

Similar topics

8
by: 2G | last post by:
Hi, Could anyone give me a hint how to generate this using codedom, I know how to generate properties and methods .... but this I can't seem to find :s. public int this { get { }
4
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...
0
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...
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...
9
by: Ryan | last post by:
Hi all, I'm playing with Lutz Roeders Reflector and have found several areas where I think there are issues in the framework libraries. I can't see how the following should work as expected and...
0
by: Dan Holmes | last post by:
I have code that generates a class. public sealed partial class ProductInfo { private string _ProductID; .... public virtual string ProductID { get { return _ProductID;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.