public void ResolveParamTest2() { Configuration configuration = null; try { configuration = new Configuration("test"); } catch { } var session = new Session(configuration, Configuration.DefaultViewName); try { if (!configuration.Views.ContainsKey(Configuration.DefaultViewName)) { configuration.Views.Add(Configuration.DefaultViewName, new CommandNode()); } configuration.Views[Configuration.DefaultViewName].Add(new ViewCommand(session)); String param = CommandBuilder.ResolveParam("root-view", Configuration.PTypes["view_name_string"]); Assert.IsTrue(param == "root-view"); } catch { Assert.IsTrue(false); } }
/// <summary> /// Initializes a new instance of the <see cref="CommandBuilder"/> class. /// </summary> /// <param name="rawCommand">The raw command.</param> /// <param name="command">The command.</param> /// <param name="ptypes">The ptypes.</param> public CommandBuilder(String rawCommand, Command command, Dictionary<String, PType> ptypes, Session session) { RawCommand = rawCommand; Command = command; PTypes = ptypes; Session = session; }
/// <summary> /// Called when [application configuration loaded]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void OnApplicationConfigurationLoaded(object sender, EventArgs e) { // Create session with default prompt and view with default view name. CurrentSession = new Session(Configuration, Configuration.DefaultViewName) {LineEditor = LineEditor}; // Create internal commands. CreateInternalCommands(); // Show startup and run defined action in the startup if we have it. ShowStartup(); }