The way I tend to do it is to overload the method with different parameters.

Consider:

bool HasPermission(string Scope, string Right, Category cat) {
 //    implementation
}
bool HasPermission(string Scope, Category cat) {
    return HasPermission(Scope, "*", cat);
}
bool HasPermission(Category cat) {
    return HasPermission("*", "*", cat);
}

Of course my app checks for the "*", but the parameters could be default to
whatever you like.

Just an idea.

Duncan
----- Original Message -----
From: "David Ferguson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 04, 2002 8:05 PM
Subject: [DOTNET] What is the correct way to test for Is Nothing in C#?


> In VB I would say...
>
>     if (Not xyz Is Nothing)
>
> In C# I am inclined to say...
>
>     if (xyz != null)
>
> but I am concerned that an object might override operator !=.  What is the
recommended way to do this test in C#?
>
> Thanks...David
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to