Esempio n. 1
0
 public LongNoteEditCMenu(ScorePanel scorePanel, LongNote longNote, int tick)
 {
     System.Diagnostics.Debug.Assert(longNote != null, "ヤバイわよ");
     #region Slide切断操作が有効か判断
     var notesBeforeTick = longNote.Where(x => x.Position.Tick <= tick).OrderBy(x => x.Position.Tick);
     var notesAfterTick  = longNote.Where(x => x.Position.Tick > tick).OrderBy(x => x.Position.Tick);
     var slideEditable   = longNote is Slide;
     if (!notesBeforeTick.Any() || !notesAfterTick.Any())
     {
         slideEditable = false;
     }
     else if (notesBeforeTick.Last() is SlideBegin || notesAfterTick.First() is SlideEnd)
     {
         slideEditable = false;
     }
     #endregion
     stripItems = new ToolStripItem[]
     {
         new ToolStripMenuItem(
             "選択したSlideノーツを最前面に移動",
             null,
             (s, e) => scorePanel.LongNoteToFront(longNote)),
         new ToolStripMenuItem(
             "選択したSlideノーツを最背面に移動",
             null,
             (s, e) => scorePanel.LongNoteToBack(longNote)),
         new ToolStripSeparator(),
         new ToolStripMenuItem(
             "選択箇所でSlideノーツを切断",
             null,
             (s, e) => scorePanel.CutSlide(longNote as Slide, tick))
         {
             Enabled = slideEditable
         }
     };
     Items.AddRange(stripItems);
 }