public bool SetState(string line) { MainPackageStates newState; if (line == "?") _state = MainPackageStates.Help; else if (Enum.TryParse(line, true, out newState)) _state = newState; return false; }
public static bool SetState(string line) { var lline = line.ToLower(); if (lline.Contains("help") || lline.Contains("?")) { validCommand = true; _state = MainPackageStates.Help; } if (lline.Contains("login") || lline.Contains("autologin")) { validCommand = true; _state = MainPackageStates.Login; } if (lline.Contains("migrate")) { validCommand = true; _state = MainPackageStates.Migrate; } if (lline.Contains("setstores")) { _state = MainPackageStates.SetStores; } if (lline.Contains("logout")) { validCommand = true; _state = MainPackageStates.Logout; } if (lline.Contains("exit")) { _state = MainPackageStates.Exit; } return(false); }
public static void SetState(MainPackageStates state) { _state = state; }