Property Syntax

0 views
Skip to first unread message

David Seruyange

unread,
Jan 11, 2007, 1:47:50 PM1/11/07
to World's Simplest Code Generator
So Scott Hanselman pointed me to the WSCG after I showed him a tool I
maded called "proper" at: http://www.t3rse.com/proper -

I was wondering what WSCG expects for property synax?

Thanks much!

David

Leon Bambrick

unread,
Jan 11, 2007, 6:12:31 PM1/11/07
to ws...@googlegroups.com
http://www.t3rse.com/proper is very nice.

to create some properties in WSCG you could do this:

in the first box, enter the name and type or property on each line:

age, int
name, string

then select "C# properties" from the drop down list.

it will create:


private int m_age;
private string m_name;

public int age
{
get { return m_age; }
set { m_age = value; }
}

public string name
{
get { return m_name; }
set { m_name = value; }
}


...okay actually at the moment it will format this slightly wrong in
terms of line breaks and space -- but the resulting code should be
valid and will compile.

There's also a 'VB.net properties' pattern.


--
.: http://TimeSnapper.com -- take the worry out of timesheets :.

Reply all
Reply to author
Forward
0 new messages