473,394 Members | 1,813 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,394 software developers and data experts.

Automatic Public Member Variables

Jon
Hello all,

I recently posted a question about a tool that would create the public
member variables for a selected set of private member variables - when
there's 10 - 15 privates, it can be very tedious!. I found a number of
options, but all a little costly, so I developed my own.

For example,

if your code has the below private members:

private int _id;
private string name;
private DateTime _date;

simply highlight them all, click the AddIn and it would write the
below public members automatically:

public int Id
{
get { return _id; }
set { _id = value; }
}

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

public DateTime Date
{
get { return _date; }
set { _date = value; }
}

The AddIn is very lightweight and relatively simple. If you would like
a copy of the dll, please feel free to mail me, jonmyates [then the at
sign] gmail.com.

Yours,

Jon

Oct 1 '07 #1
0 1166

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

Similar topics

5
by: cedric buerfent | last post by:
Hello NG, I ve a question concerning automatic generated source code. When I program the declarations of a class (and save it in a file called myclass.hh for example), its a boring work to...
7
by: bartek | last post by:
Please consider the following scenario below (sketch of). There are two templates defined: A and B, both with mutual conversion operators defined. Also, there's a free function template...
10
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this...
2
by: Eric Lilja | last post by:
Hello, I have class that acts as a lookup table. The class has two static member variables of type std::map and two public static member functions that allows the user to query the maps (return...
4
by: Brian | last post by:
This has most likely been asked before, but Google still won't allow certain search strings such as "public:". In CPP, you can declare a class such as... class Foo { public: Foo() {
18
by: Janaka | last post by:
I'm having a discussion with my colleagues here on good programming standards. One thing we haven't agreed on is the use of properties in classes vs using member variables. Now everyone knows...
10
by: darrel | last post by:
I'm still trying to sort out in my head the differences between public and shared when referring to declaring properties or variables. This is my understanding: shared - akin to a 'global'...
58
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is...
25
by: sidd | last post by:
In the following code: int i = 5; ---it goes to .data segment int j; ---it goes to bss segment int main() { int c; int i = 5; ---stack
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.