Why is MainWindow/this.ab
hidden and cannot be seen? I suppose private should be seen inside mainWindows
.
It seems like C# throws error Not all code return path value
if I put return
not at the end of the method.
Can c# return string and void at the same time? If I am wrong, what is the better code? In PHP,the code easily works. I need to know how it can get to work in C#.
public static string a(string type,string a)
{
return MainWindow.ab(type, a);
}
public static void a(string type)
{
MainWindow.ab(type);
}
private string ab(string type,string a=null)
{
if (type == "1")
{
return "1";
}
}