By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

Is there a shortcut for class properties?

P: n/a

Is there a simple way, shortcut, or macro to create a property
skeletons?

I would live to be able to type a name and a type and have the property
created based on that info.

Private mLastName as String
Public Property LastName() as String
Get
Return mLastName
End Get
Set (ByVal value as String)
mLastName = value
End Set
End Property
Is this possible?

Nov 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Try code snippets.

In the code editor, type ? and hit Tab.

This brings up a menu of code snippets that you can insert.

When you drill down to the one you want (Common Code Patterns /
Properties and Procedures / Define a property), when it
shows the final list, if you hover your mouse over one,
or use the keyboard to highlight one, the tooltip will
give you a shortcut. For "Define a Property", it's "Property".

If you know the shortcut, you can use these in the code
editor by typing the shortcut and hitting Tab, and it will
insert the code for you.

So type Property<Tabin the code editor, and it will insert
the structure for a property.

You can create your own Code Snippets, too. MS has a Code
Snippet Editor that lets you look at all of the ones already
there, as well as develop your own, that someone outside
of MS wrote, that works really well. Search MSDN for it
if you want it.

Good luck.
Robin S.

"Mike Edgewood" <it****@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
>
Is there a simple way, shortcut, or macro to create a property
skeletons?

I would live to be able to type a name and a type and have the property
created based on that info.

Private mLastName as String
Public Property LastName() as String
Get
Return mLastName
End Get
Set (ByVal value as String)
mLastName = value
End Set
End Property
Is this possible?

Nov 14 '06 #2

P: n/a
Thanks.

Too bad they don't offer a dialog box where you could just fill in
<privateVarName>, <PropName>, <Type>

Looking for ways to shortcut object creation for Object-Relational
mapping using CSLA.

On Nov 14, 12:28 pm, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Try code snippets.

In the code editor, type ? and hit Tab.

This brings up a menu of code snippets that you can insert.

When you drill down to the one you want (Common Code Patterns /
Properties and Procedures / Define a property), when it
shows the final list, if you hover your mouse over one,
or use the keyboard to highlight one, the tooltip will
give you a shortcut. For "Define a Property", it's "Property".

If you know the shortcut, you can use these in the code
editor by typing the shortcut and hitting Tab, and it will
insert the code for you.

So type Property<Tabin the code editor, and it will insert
the structure for a property.

You can create your own Code Snippets, too. MS has a Code
Snippet Editor that lets you look at all of the ones already
there, as well as develop your own, that someone outside
of MS wrote, that works really well. Search MSDN for it
if you want it.

Good luck.
Robin S.

"Mike Edgewood" <itm...@gmail.comwrote in messagenews:11**********************@h54g2000cwb.g ooglegroups.com...
Is there a simple way, shortcut, or macro to create a property
skeletons?
I would live to be able to type a name and a type and have the property
created based on that info.
Private mLastName as String
Public Property LastName() as String
Get
Return mLastName
End Get
Set (ByVal value as String)
mLastName = value
End Set
End Property
Is this possible?
Nov 14 '06 #3

P: n/a
Mike Edgewood wrote:
Too bad they don't offer a dialog box where you could just fill in
<privateVarName>, <PropName>, <Type>
In a sense, it does. When you type Property<tabyou get a skeleton
with "fields". You just fill in the fields for the type,
privatemembernamd and property name. The rest is updated automatically.

Nov 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.