예제 #1
0
 private void deleteLastNote()
 {
     if (NotePosition.X == 43)
     {
         RegisteredMusicalObjects.UnregisterLastStaff();
         StaffPosition = Position.CalculateStaffPositionOnDeletion(StaffPosition);
     }
     RegisteredMusicalObjects.UnregisterLastNote();
     NotePosition = Position.CalculateNotePositionOnDeletion(NotePosition);
     foreach (var control in scoreSheetPanel.Controls)
     {
         if (control is NoteTranspControl)
         {
             (control as NoteTranspControl).Hide();
             (control as NoteTranspControl).Refresh();
             (control as NoteTranspControl).Show();
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Метод очистки среды.
        /// </summary>
        private void ClearWorkspace()
        {
            TranspControl        controlToDelete;
            List <TranspControl> controlsToDelete = new List <TranspControl>();

            foreach (var c in this.scoreSheetPanel.Controls)
            {
                controlToDelete = c as TranspControl;
                if (controlToDelete != null)
                {
                    controlsToDelete.Add(controlToDelete);
                }
            }
            foreach (TranspControl c in controlsToDelete)
            {
                c.Dispose();
            }
            RegisteredMusicalObjects.UnRegisterAll();
            NotePosition  = new Position(43, 32);
            StaffPosition = new Position(20, 19);
            drawObject(staff);
        }
예제 #3
0
        public override void Draw(Position position)
        {
            StaffTranspControl control = new StaffTranspControl();

            control.BackColor  = System.Drawing.Color.Transparent;
            control.BrushColor = System.Drawing.Color.Transparent;
            control.Size       = new System.Drawing.Size(23, 25);
            control.Location   = new System.Drawing.Point(position.X, position.Y);
            if (control.Location.X != 20)
            {
                image         = Resources.Staff;
                control.Image = image;
            }
            else
            {
                image         = Resources.key;
                control.Image = image;
            }
            control.Opacity = 100;
            control.Enabled = false;
            scoreSheetPanel.Controls.Add(control);
            RegisteredMusicalObjects.RegisterObject(control);
            form.ResumeLayout(false);
        }
예제 #4
0
 private void PlayBtn_Click(object sender, EventArgs e)
 {
     RegisteredMusicalObjects.PlayMelody();
 }
예제 #5
0
 public NoteTranspControl(MusicalNote connectNote)
     : base()
 {
     ControlNote = connectNote;
     RegisteredMusicalObjects.RegisterObject(this);
 }