Hello.
The source code is below. And Then, what is the purpose of enum in the parameter in this case although it doesnt have any usage?
Here is the source code.
public enum SilentLoud
{
Silent = -1,
Loud = 0
}
public bool Close()
{
return Close(SilentLoud.Loud);
}
public bool Close(SilentLoud silent)
{
if(!_initialised)
return false;
if(!IsConnected)
return false;
_client.Close();
return true;
}
Then, I am just wondering why Close Function is split into 2 functions in this case. Can we not merge the two functions in to one like this?
public bool Close()
{
if(!_initialised)
return false;
if(!IsConnected)
return false;
_client.Close();
return true;
}
Loading
VulpesPosted Apr 5, 2011, 2:06 PM
You could merge it into a single method as long as you're sure that the enum parameter won't be used at a later date.