Exemplo n.º 1
0
 /// <summary>
 /// Возращает соответствующую ноте область нотного стана
 /// </summary>
 /// <param name="control"></param>
 /// <returns></returns>
 private StaffTranspControl getRespStaff(TranspControl control)
 {
     foreach (var staff in RegisteredMusicalObjects.StaffList)
     {
         if (staff.Location.X == control.Location.X && staff.Location.Y == control.Location.Y - 13)
         {
             return(staff);
         }
     }
     return(null);
 }
 /// <summary>
 /// Заорегистрировать объект в реестре объектов
 /// </summary>
 /// <param name="control">TranspControl(стан или нота)</param>
 public static void RegisterObject(TranspControl control)
 {
     if (control is NoteTranspControl)
     {
         NotesList.Add(control as NoteTranspControl);
     }
     if (control is StaffTranspControl)
     {
         StaffList.Add(control as StaffTranspControl);
     }
 }
Exemplo n.º 3
0
        public override void Draw(Position position)
        {
            TranspControl control = new TranspControl();

            control.BackColor  = System.Drawing.Color.Transparent;
            control.BrushColor = System.Drawing.Color.Transparent;
            control.Image      = Resources.WholeNoteSmall;
            control.Location   = new System.Drawing.Point(position.X, position.Y);
            control.Name       = "transpControl1";
            control.Opacity    = 100;
            control.Size       = new System.Drawing.Size(15, 15);
            form.Controls.Add(control);
            form.ResumeLayout(false);

            Play();
        }