Stores records to files
Inheritance: IRecordStore
コード例 #1
0
ファイル: ExamplesMenu.cs プロジェクト: nerai/CMenu
        public ExamplesMenu()
        {
            Selector = "examples";
            PromptCharacter = "examples>";

            Add (new MI_Add ());

            Add (new MI_Echo ());
            Add (new MI_If ());
            Add (new MI_Pause ());
            Add (new MI_Stopwatch ());

            var frs = new FileRecordStore ();
            Add (new MI_Record (frs));
            Add (new MI_Replay (this, frs));

            var procmgr = new ProcManager ();
            Add (new MI_Proc (procmgr));
            Add (new MI_Call (this, procmgr));
            Add (new MI_Return (this, procmgr));
            Add (new MI_Goto (procmgr));

            OnRun += m => {
                Console.Write ("Example menu - ");
                m.CQ.ImmediateInput ("help");
            };
        }
コード例 #2
0
ファイル: ControlledRun.cs プロジェクト: nerai/nibbler
		public ControlledRun (bool passive)
		{
			menu.CQ.PassiveMode = passive;

			menu.Add (new Menu_Print (this));
			menu.Add (new Menu_Lib (this));
			menu.Add (new Menu_Def (this));
			menu.Add (new Menu_Create (this));
			menu.Add (new Menu_Step (this));
			menu.Add (new Menu_Run (this));
			menu.Add (new Menu_Break (this));
			menu.Add (new Menu_Stopwatch ());
			//menu.Add ("log-break", s => Log.AddBreakpoint (s));

			menu.Add (new MI_Echo ());
			menu.Add (new MI_Pause ());

			var store = new FileRecordStore ();
			menu.Add (new MI_Record (store) {
				Selector = "{",
				EndRecordCommand = "}",
			});
			menu.Add (new MI_Replay (menu, store) {
				Selector = "!",
			});

			var mi_if = menu.Add (new MI_If ());
			mi_if.Conditions.Add ("hist-has", Condition_HistHas);

			_Def = DefinitionLibrary.Load ("BusyBeaver2");
		}