public static void Main(string[] args) { string rootPath; if (args.Length == 0) { string env = Environment.GetEnvironmentVariable("DI_PROJECT"); if (string.IsNullOrEmpty(env)) { rootPath = Environment.CurrentDirectory; } else { rootPath = env; } } else { rootPath = args[0]; } Application.Init(); var model = new Model.Main(Karl.Fs.Directory.Get(rootPath)); var ctl = new Controller.Main(model); var view = new View.Main(ctl); Session.Main.Load(model.SessionFile, ctl, view); view.ShowAll(); ctl.Ready.Handler(); Application.Run(); }
public Window(Main _controller, Model.Buffer _model) { Controller = _controller; Model = new Bind<Model.Buffer>(_model); CurrentMode = new BindList<WindowMode>(); CurrentMode.Event.Changed += (list) => { CurrentKeyMap = list.FoldLeft(EmptyKeyMap, (a, b) => a + b.KeyMap); }; CurrentMode.Add(Controller.WindowModes[0]); CurrentMode.Add(Controller.WindowModes[2]); CurrentMode.Add(Controller.WindowModes[3]); Parser = new CommandParser(); }
public Window(Main _controller, Model.Buffer _model) { Controller = _controller; Model = new Bind<Model.Buffer>(_model); CurrentMode = new BindSet<WindowMode>(); CurrentMode.Changed.Add(() => { CurrentKeyMap = CurrentMode.ToList().FoldLeft(EmptyKeyMap, (a, b) => a + b.KeyMap); }); DefaultMode.ForEach(CurrentMode.Add); Parser = new CommandParser(); }
public IdleHandler(Main _ctl) { ctl = _ctl; LastSave = DateTime.Now; GLib.Idle.Add(AutoSave); }