Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
AnswerRe: search for nearby wifi networks Pin
Vasudevan Deepak Kumar10-Jul-09 2:26
Vasudevan Deepak Kumar10-Jul-09 2:26 
Questionlist all wi-fi network connections Pin
Vivek Vijayan9-Jul-09 6:40
Vivek Vijayan9-Jul-09 6:40 
AnswerRe: list all wi-fi network connections Pin
Blue_Boy9-Jul-09 6:55
Blue_Boy9-Jul-09 6:55 
GeneralRe: list all wi-fi network connections Pin
Mycroft Holmes9-Jul-09 11:52
professionalMycroft Holmes9-Jul-09 11:52 
GeneralRe: list all wi-fi network connections Pin
Blue_Boy9-Jul-09 13:16
Blue_Boy9-Jul-09 13:16 
GeneralRe: list all wi-fi network connections Pin
Vasudevan Deepak Kumar10-Jul-09 2:26
Vasudevan Deepak Kumar10-Jul-09 2:26 
Questionown == Operator and null Problem [solved] Pin
chrisx519-Jul-09 6:34
chrisx519-Jul-09 6:34 
AnswerRe: own == Operator and null Problem Pin
harold aptroot9-Jul-09 6:51
harold aptroot9-Jul-09 6:51 
GeneralRe: own == Operator and null Problem Pin
chrisx519-Jul-09 23:18
chrisx519-Jul-09 23:18 
GeneralRe: own == Operator and null Problem Pin
harold aptroot10-Jul-09 3:37
harold aptroot10-Jul-09 3:37 
AnswerRe: own == Operator and null Problem Pin
Blue_Boy9-Jul-09 6:53
Blue_Boy9-Jul-09 6:53 
GeneralRe: own == Operator and null Problem Pin
chrisx519-Jul-09 23:22
chrisx519-Jul-09 23:22 
AnswerRe: own == Operator and null Problem Pin
DaveyM699-Jul-09 7:37
professionalDaveyM699-Jul-09 7:37 
GeneralRe: own == Operator and null Problem Pin
chrisx519-Jul-09 23:24
chrisx519-Jul-09 23:24 
GeneralRe: own == Operator and null Problem Pin
DaveyM6910-Jul-09 4:26
professionalDaveyM6910-Jul-09 4:26 
I've just had another look at this. It seems that by converting your class instances to objects, you can do a null check. e.g.
public class Test
{
    private int internalValue;
    public Test(int value)
    {
        internalValue = value;
    }

    public static bool operator ==(Test test1, Test test2)
    {
        object o1 = test1;
        object o2 = test2;
        if (o1 == null || o2 == null)
            return (o1 == null && o2 == null);
        return test1.internalValue == test2.internalValue;
    }
    public static bool operator !=(Test test1, Test test2)
    {
        return !(test1 == test2);
    }
}


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: own == Operator and null Problem Pin
chrisx5112-Jul-09 23:32
chrisx5112-Jul-09 23:32 
AnswerRe: own == Operator and null Problem Pin
Dave Kreskowiak9-Jul-09 7:55
mveDave Kreskowiak9-Jul-09 7:55 
GeneralRe: own == Operator and null Problem [modified] Pin
chrisx519-Jul-09 23:27
chrisx519-Jul-09 23:27 
QuestionXML to ObservableCollection Pin
VickyC#9-Jul-09 6:08
VickyC#9-Jul-09 6:08 
AnswerRe: XML to ObservableCollection Pin
Jeremy Likness9-Jul-09 6:45
professionalJeremy Likness9-Jul-09 6:45 
GeneralRe: XML to ObservableCollection Pin
VickyC#9-Jul-09 6:50
VickyC#9-Jul-09 6:50 
GeneralRe: XML to ObservableCollection Pin
VickyC#9-Jul-09 7:06
VickyC#9-Jul-09 7:06 
GeneralRe: XML to ObservableCollection Pin
Jeremy Likness9-Jul-09 7:14
professionalJeremy Likness9-Jul-09 7:14 
GeneralRe: XML to ObservableCollection Pin
VickyC#9-Jul-09 7:35
VickyC#9-Jul-09 7:35 
GeneralRe: XML to ObservableCollection Pin
VickyC#9-Jul-09 7:43
VickyC#9-Jul-09 7:43 

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.