Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
GeneralRe: Property Name Sementics - IsEmpty or Empty Pin
Luc Pattyn8-Mar-12 15:44
sitebuilderLuc Pattyn8-Mar-12 15:44 
GeneralRe: Property Name Sementics - IsEmpty or Empty Pin
Richard Andrew x648-Mar-12 15:47
professionalRichard Andrew x648-Mar-12 15:47 
AnswerRe: Property Name Sementics - IsEmpty or Empty Pin
Luc Pattyn8-Mar-12 16:05
sitebuilderLuc Pattyn8-Mar-12 16:05 
AnswerRe: Property Name Sementics - IsEmpty or Empty Pin
Roger Wright8-Mar-12 20:31
professionalRoger Wright8-Mar-12 20:31 
AnswerRe: Property Name Sementics - IsEmpty or Empty Pin
Pete O'Hanlon8-Mar-12 21:57
mvePete O'Hanlon8-Mar-12 21:57 
AnswerRe: Property Name Sementics - IsEmpty or Empty Pin
BobJanova8-Mar-12 22:39
BobJanova8-Mar-12 22:39 
AnswerRe: Property Name Sementics - IsEmpty or Empty Pin
Eddy Vluggen9-Mar-12 0:08
professionalEddy Vluggen9-Mar-12 0:08 
AnswerRe: Property Name Sementics - IsEmpty or Empty Pin
DaveyM699-Mar-12 5:29
professionalDaveyM699-Mar-12 5:29 
Thinking about the way structs such as Size, Point and Rectangle deal with this, I haven't checked, but I don't believe they don't provide a property for this. There is a static read only instance available called Empty that you can use for equality comparison to see if the one you have is empty. Overriding Equals(object), GetHashCode() and providing operator overloads for == and != (and possibly implementing IEquatable<T>) would be the way to do this.

I don't think I would use a property for this, I would use a method public bool IsEmpty() as you are asking for information about the object as a whole rather than a part of it which is IMO opinion the purpose of a property.
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



Questionerror creating window handle (in TabControl) Pin
Danzy838-Mar-12 5:50
Danzy838-Mar-12 5:50 
AnswerRe: error creating window handle (in TabControl) Pin
Ravi Bhavnani8-Mar-12 11:02
professionalRavi Bhavnani8-Mar-12 11:02 
AnswerRe: error creating window handle (in TabControl) Pin
BobJanova8-Mar-12 22:35
BobJanova8-Mar-12 22:35 
QuestionBitmap with alpha channel crashes Bitmap () constructor only under Windows 7 Pin
Alan Balkany8-Mar-12 5:31
Alan Balkany8-Mar-12 5:31 
AnswerRe: Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7 Pin
Pete O'Hanlon8-Mar-12 5:33
mvePete O'Hanlon8-Mar-12 5:33 
GeneralRe: Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7 Pin
Alan Balkany8-Mar-12 5:35
Alan Balkany8-Mar-12 5:35 
GeneralRe: Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7 Pin
Pete O'Hanlon8-Mar-12 5:43
mvePete O'Hanlon8-Mar-12 5:43 
GeneralRe: Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7 Pin
Alan Balkany8-Mar-12 5:53
Alan Balkany8-Mar-12 5:53 
GeneralRe: Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7 Pin
Pete O'Hanlon8-Mar-12 6:04
mvePete O'Hanlon8-Mar-12 6:04 
GeneralRe: Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7 Pin
Alan Balkany8-Mar-12 6:30
Alan Balkany8-Mar-12 6:30 
GeneralRe: Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7 Pin
Pete O'Hanlon8-Mar-12 8:00
mvePete O'Hanlon8-Mar-12 8:00 
QuestionLooking for a good (¿free? ¿opensource?) library to deal with DXF format Pin
vValkir8-Mar-12 5:24
vValkir8-Mar-12 5:24 
AnswerMessage Removed Pin
8-Mar-12 6:39
professionalN_tro_P8-Mar-12 6:39 
GeneralRe: Looking for a good (¿free? ¿opensource?) library to deal with DXF format Pin
vValkir8-Mar-12 21:57
vValkir8-Mar-12 21:57 
GeneralRe: Looking for a good (¿free? ¿opensource?) library to deal with DXF format Pin
vValkir9-Mar-12 0:22
vValkir9-Mar-12 0:22 
Questioncomopnent need Pin
MohsenSaleh8-Mar-12 4:47
MohsenSaleh8-Mar-12 4:47 
AnswerRe: comopnent need Pin
Eddy Vluggen8-Mar-12 5:00
professionalEddy Vluggen8-Mar-12 5:00 

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.