我有这样一种情况,即我用手提的方式来发挥职能。 见以下例子说明和问题。 我希望我对这一局势了解一些技术性话。 人们更容易理解我所说的话。
public static class test
{
private void button1_Click(object sender, RoutedEventArgs e)
{
if (Login("johndoe","password"))
{
if(checkForSomething("johndoe"))
{
DoOpenDashboard();
// Now it opens dashboard, it has several buttons.
// Each button does several different things
// On this example I am just giving you two level of hierarchy
// but in my actual program, there are 7 levels.
}
}
}
public static bool Login(string userid, string password)
{
//valid user
return true;
}
public static bool checkForSomething(string userid)
{
return true;
}
如果儿童方法被拖延,我如何避免重新采用以前的电话方法/功能?
For example login method is calling checkForSomething("johndoe")
. If checkForSomething("johndoe")
is passed then it will open Dashboard window by calling DoOpenDashboard. At this point my process should should not go back to checkforsoemthing, and then login. I hope it makes sense.