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(); } } }
/// <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); }
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); }
private void PlayBtn_Click(object sender, EventArgs e) { RegisteredMusicalObjects.PlayMelody(); }
public NoteTranspControl(MusicalNote connectNote) : base() { ControlNote = connectNote; RegisteredMusicalObjects.RegisterObject(this); }