コード例 #1
0
 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;
 }
コード例 #2
0
 public ModelPart(ViewModel model)
 {
     Model = model;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 public Editor(ViewModel model)
     : base(model)
 {
 }