private void btn_Parser_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(txt_url.Text)) { MessageBox.Show("Pleasr input the url to parser."); return; } listPagePatterns = new List <ListPagePattern>(); selectedPattern = null; lastTitleXPath = null; channelUrl = txt_url.Text; if (checkUseBrowser.IsChecked ?? false) { httpResult = SeleniumHelper.HttpRequest(channelUrl); } else { httpResult = HttpHelper.HttpRequest(channelUrl); } if (httpResult != null && httpResult.HttpCode == 200) { listPagePatterns = SmartParser.Extract_Patterns(channelUrl, httpResult.Content, MediaType.WebNews, Enums.Language.CHINESE); RefreshUI(); } }
public string[] GetSuggestions(string text, int index) { //Base command hints if (string.IsNullOrWhiteSpace(text)) { return(Program.CommandTable.Keys.ToArray()); } string[] arguments = SmartParser.ParseAsArguments(text).ToArray(); string lastArg = arguments.Last(); bool newArgument = text.Last() == ' '; if (arguments.Count() == 1 && !newArgument && CommandKeys.Any(x => x.StartsWith(lastArg))) { return(QueryCommands(lastArg)); } //Profile hints if (arguments[0] == "profiles" || arguments[0] == "delete") { if (newArgument) { return(QueryProfiles()); } string query = arguments[1]; return(QueryProfiles(query)); } return(null); }
static void Profiles(string[] args = null) { if (args.Length < 1) { PrettyPrinter.PrintGameProfiles(ProfileManager.GetAllProfiles()); } else { SmartParser.PrintProfile(args); } }
static void Options(string[] args) { SmartParser.Configuration(args); }
static void Launch(string[] args) { SmartParser.LaunchGame(args); }
static void Delete(string[] args) { SmartParser.DeleteGameProfile(args); }
//Create game profile static void Create(string[] args) { SmartParser.CreateGameProfile(args); }