Home All Groups Group Topic Archive Search About

Is there a shortcut for class properties?

Author
14 Nov 2006 5:19 PM
Mike Edgewood
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?

Author
14 Nov 2006 6:28 PM
RobinS
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<Tab> in 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.



Show quoteHide quote
"Mike Edgewood" <itm***@gmail.com> wrote in message
news:1163524756.494872.320910@h54g2000cwb.googlegroups.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?
>
Author
14 Nov 2006 8:49 PM
Mike Edgewood
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.





Show quoteHide quote
On Nov 14, 12:28 pm, "RobinS" <Rob...@NoSpam.yah.none> wrote:
> 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<Tab> in 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.com> wrote in messagenews:1163524756.494872.320***@h54g2000cwb.googlegroups.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?
Author
15 Nov 2006 2:37 PM
Chris Dunaway
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<tab> you get a skeleton
with "fields".  You just fill in the fields for the type,
privatemembernamd and property name.  The rest is updated automatically.