Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
AnswerRe: System.Text.RegularExpressions.Regex Pin
Michael Sync20-Aug-07 21:53
Michael Sync20-Aug-07 21:53 
GeneralRe: System.Text.RegularExpressions.Regex Pin
Le centriste21-Aug-07 1:31
Le centriste21-Aug-07 1:31 
GeneralRe: System.Text.RegularExpressions.Regex Pin
Michael Sync21-Aug-07 16:34
Michael Sync21-Aug-07 16:34 
AnswerRe: System.Text.RegularExpressions.Regex Pin
Scott Dorman21-Aug-07 2:20
professionalScott Dorman21-Aug-07 2:20 
QuestionUsing CodeDOM in .NET to generate an assignment statement inside a property of a class Pin
rameshbhojan20-Aug-07 21:06
rameshbhojan20-Aug-07 21:06 
AnswerRe: Using CodeDOM in .NET to generate an assignment statement inside a property of a class Pin
Lutosław21-Aug-07 1:07
Lutosław21-Aug-07 1:07 
GeneralRe: Using CodeDOM in .NET to generate an assignment statement inside a property of a class Pin
rameshbhojan21-Aug-07 1:56
rameshbhojan21-Aug-07 1:56 
AnswerRe: Using CodeDOM in .NET to generate an assignment statement inside a property of a class Pin
Insincere Dave21-Aug-07 15:36
Insincere Dave21-Aug-07 15:36 
The class your looking for is CodeVariableDeclarationStatement.
CodeMemberProperty prop = new CodeMemberProperty();
prop.Name = "RollNumber";
prop.HasGet = true;
prop.Attributes = MemberAttributes.Public;
prop.Type = new CodeTypeReference("System.Int64");

prop.GetStatements.Add(new CodeVariableDeclarationStatement("System.Int64", "rollNo",
                                                            new CodeCastExpression("System.Int64",
                                                                                   new CodeIndexerExpression(
                                                                                   	new CodeThisReferenceExpression(),
                                                                                   	new CodePrimitiveExpression(
                                                                                   		"@roll_number")))));
prop.GetStatements.Add(new CodeMethodReturnStatement(new CodeVariableReferenceExpression("rollNo")));


But why bother with the variable when you could just return (System.Int64 )this["@roll_number"];
QuestionUsing CodeDOM in .NET to AutoGenereate a constant member field Pin
rameshbhojan20-Aug-07 21:05
rameshbhojan20-Aug-07 21:05 
AnswerRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
Giorgi Dalakishvili20-Aug-07 21:38
mentorGiorgi Dalakishvili20-Aug-07 21:38 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
rameshbhojan20-Aug-07 23:34
rameshbhojan20-Aug-07 23:34 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
Giorgi Dalakishvili20-Aug-07 23:38
mentorGiorgi Dalakishvili20-Aug-07 23:38 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
rameshbhojan20-Aug-07 23:49
rameshbhojan20-Aug-07 23:49 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
Giorgi Dalakishvili20-Aug-07 23:51
mentorGiorgi Dalakishvili20-Aug-07 23:51 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field [modified] Pin
rameshbhojan21-Aug-07 1:43
rameshbhojan21-Aug-07 1:43 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
Giorgi Dalakishvili21-Aug-07 5:27
mentorGiorgi Dalakishvili21-Aug-07 5:27 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
rameshbhojan21-Aug-07 18:25
rameshbhojan21-Aug-07 18:25 
AnswerRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
Insincere Dave21-Aug-07 15:44
Insincere Dave21-Aug-07 15:44 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
rameshbhojan21-Aug-07 18:19
rameshbhojan21-Aug-07 18:19 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
rameshbhojan21-Aug-07 18:23
rameshbhojan21-Aug-07 18:23 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
Insincere Dave22-Aug-07 6:07
Insincere Dave22-Aug-07 6:07 
GeneralRe: Using CodeDOM in .NET to AutoGenereate a constant member field Pin
rameshbhojan22-Aug-07 19:11
rameshbhojan22-Aug-07 19:11 
QuestionHow to convert string length to pixel? Pin
bug_aonz20-Aug-07 18:54
bug_aonz20-Aug-07 18:54 
AnswerRe: How to convert string length to pixel? Pin
Eduard Keilholz20-Aug-07 19:07
Eduard Keilholz20-Aug-07 19:07 
GeneralRe: How to convert string length to pixel? Pin
Lutosław21-Aug-07 1:23
Lutosław21-Aug-07 1:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.