public GameForm(ViewModel view) { View = view; InitializeComponent(); menuStrip1.Visible = false; //Game.Replay.OnActionAdded += game_OnActionAdded; if (View.Player != null) { PlayProgress.Maximum = (int)Math.Ceiling(View.Duration.TotalSeconds); } NavigateFirstMenuItem.ShortcutKeyDisplayString = KeyToString(Keys.Home); NavigateLeft1MenuItem.ShortcutKeyDisplayString = KeyToString(Keys.Left); NavigateLeft10MenuItem.ShortcutKeyDisplayString = KeyToString(Keys.Shift | Keys.Left); NavigateLeftForkMenuItem.ShortcutKeyDisplayString = KeyToString(Keys.Control | Keys.Left); NavigateLastMenuItem.ShortcutKeyDisplayString = KeyToString(Keys.End); NavigateRight1MenuItem.ShortcutKeyDisplayString = KeyToString(Keys.Right); NavigateRight10MenuItem.ShortcutKeyDisplayString = KeyToString(Keys.Shift | Keys.Right); NavigateRightForkMenuItem.ShortcutKeyDisplayString = KeyToString(Keys.Control | Keys.Right); //this.Paint += Form1_Paint; //this.FormChanged(); //view.Changed += view_Changed; }
public ModelPart(ViewModel model) { Model = model; }
private static ViewModel OpenReplayInternal(Replay replay) { ViewModel view = new ViewModel(); view.Editor = new Editor(view); view.Editor.ActiveTool = Tools.Move; view.Game = new Game(replay); view.Game.Seek(view.Game.Replay.Actions.Count - 1); return view; }
public static ViewModel PlayLesson(String filename) { string replay; Stream audio; AudioLessonFile.Load(filename, out replay, out audio); ViewModel view = new ViewModel(); view.Game = new Game(Replay.Parse(replay)); view.Game.Seek(0); view.Name = Path.GetFileName(filename); view.Media = new Player(audio); view.SetUnmodified(); return view; }
public Editor(ViewModel model) : base(model) { }