Click here to Skip to main content
15,923,226 members
Home / Discussions / C#
   

C#

 
AnswerRe: using c++ class dll in c# Pin
DaveyM6915-Jun-10 1:34
professionalDaveyM6915-Jun-10 1:34 
QuestionHow do I view a jpg without using Image.FromStream Pin
TimSWatson15-Jun-10 0:34
TimSWatson15-Jun-10 0:34 
AnswerRe: How do I view a jpg without using Image.FromStream Pin
Luc Pattyn15-Jun-10 0:44
sitebuilderLuc Pattyn15-Jun-10 0:44 
GeneralRe: How do I view a jpg without using Image.FromStream Pin
TimSWatson15-Jun-10 0:48
TimSWatson15-Jun-10 0:48 
GeneralRe: How do I view a jpg without using Image.FromStream Pin
Luc Pattyn15-Jun-10 1:04
sitebuilderLuc Pattyn15-Jun-10 1:04 
Questionconverting long value to datetime Pin
prasadbuddhika14-Jun-10 23:55
prasadbuddhika14-Jun-10 23:55 
AnswerRe: converting long value to datetime Pin
Peace ON15-Jun-10 0:34
Peace ON15-Jun-10 0:34 
AnswerRe: converting long value to datetime Pin
Eddy Vluggen15-Jun-10 0:41
professionalEddy Vluggen15-Jun-10 0:41 
AnswerRe: converting long value to datetime Pin
Pete O'Hanlon15-Jun-10 0:49
mvePete O'Hanlon15-Jun-10 0:49 
AnswerRe: converting long value to datetime Pin
Luc Pattyn15-Jun-10 0:50
sitebuilderLuc Pattyn15-Jun-10 0:50 
AnswerRe: converting long value to datetime Pin
prasadbuddhika15-Jun-10 1:05
prasadbuddhika15-Jun-10 1:05 
GeneralRe: converting long value to datetime Pin
DaveyM6915-Jun-10 1:15
professionalDaveyM6915-Jun-10 1:15 
GeneralRe: converting long value to datetime Pin
prasadbuddhika15-Jun-10 1:21
prasadbuddhika15-Jun-10 1:21 
GeneralRe: converting long value to datetime Pin
Luc Pattyn15-Jun-10 1:34
sitebuilderLuc Pattyn15-Jun-10 1:34 
GeneralRe: converting long value to datetime Pin
OriginalGriff15-Jun-10 1:50
mveOriginalGriff15-Jun-10 1:50 
QuestionI thought singletons were "Evil"? [modified] Pin
venomation14-Jun-10 23:21
venomation14-Jun-10 23:21 
AnswerRe: I thought singletons were "Evil"? Pin
Eddy Vluggen15-Jun-10 0:48
professionalEddy Vluggen15-Jun-10 0:48 
GeneralRe: I thought singletons were "Evil"? Pin
Luc Pattyn15-Jun-10 0:52
sitebuilderLuc Pattyn15-Jun-10 0:52 
GeneralRe: I thought singletons were "Evil"? Pin
Eddy Vluggen15-Jun-10 1:07
professionalEddy Vluggen15-Jun-10 1:07 
GeneralRe: I thought singletons were "Evil"? Pin
LimitedAtonement15-Jun-10 2:55
LimitedAtonement15-Jun-10 2:55 
AnswerRe: I thought singletons were "Evil"? PinPopular
David Skelly15-Jun-10 2:02
David Skelly15-Jun-10 2:02 
AnswerRe: I thought singletons were "Evil"? Pin
PIEBALDconsult15-Jun-10 3:07
mvePIEBALDconsult15-Jun-10 3:07 
QuestionObject Null/Empty Check Pin
jojoba201114-Jun-10 22:31
jojoba201114-Jun-10 22:31 
AnswerRe: Object Null/Empty Check Pin
Peace ON14-Jun-10 22:44
Peace ON14-Jun-10 22:44 
AnswerRe: Object Null/Empty Check Pin
DaveyM6914-Jun-10 22:47
professionalDaveyM6914-Jun-10 22:47 
If it's a string then use string.IsNullOrEmpty.

If it's for another class then it depends on how you define empty. If this is for your own classes you could define an IEmpty interface and implement that.
C#
public interface IEmpty
{
    bool IsEmpty { get; }
}

then you can use a generic method such as
public static bool IsNullOrEmpty<T>(T obj) where T : IEmpty
{
    if (obj == null)
        return true;
    return obj.IsEmpty;
}

Dave

If this helped, please vote & accept answer!


Binging is like googling, it just feels dirtier. (Pete O'Hanlon)

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

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.