Ejemplo n.º 1
0
        public void AddNote(Note note, string staffId)
        {
            var iStaffId = Convert.ToInt32(staffId);

            if (iStaffId == 1) return;

            var backupIndex = -1;

            for (int i = 0; i < Items.Length; i++)
            {
                if (Items[i].GetType() != typeof (backup)) continue;

                backupIndex = i;
                break;
            }

            var measureItems = Items.ToList();

            for (int i = backupIndex + 1; i < Items.Length; i++)
                measureItems.Remove(Items[i]);

            measureItems.Add(note);
            Items = measureItems.ToArray();
        }
Ejemplo n.º 2
0
        public Note(Note note)
        {
            if (note.Items != null)
            {
                Items = new object[note.Items.Length];
                Array.Copy(note.Items, Items, note.Items.Length);
            }

            if (note.ItemsElementName != null)
            {
                ItemsElementName = new ItemsChoiceType1[note.ItemsElementName.Length];
                Array.Copy(note.ItemsElementName, ItemsElementName, note.ItemsElementName.Length);
            }

            if (note.Beam != null)
            {
                Beam = new Beam[note.Beam.Length];
                Array.Copy(note.Beam, Beam, note.Beam.Length);
            }

            if (note.Notations != null)
            {
                Notations = new Notations[note.Notations.Length];
                Array.Copy(note.Notations, Notations, note.Notations.Length);
            }

            if (note.Lyrics != null)
            {
                Lyrics = new lyric[note.Lyrics.Length];
                Array.Copy(note.Lyrics, Lyrics, note.Lyrics.Length); 
            }

            Instrument = note.Instrument;
            Footnote = note.Footnote;
            Level = note.Level;
            Voice = note.Voice;
            NoteType = note.NoteType;
            Dot = note.Dot;
            Accidental = note.Accidental;
            TimeModification = note.TimeModification;
            Stem = note.Stem;
            NoteHead = note.NoteHead;
            Staff = note.Staff;
            DefaultX = note.DefaultX;
            DefaultXSpecified = note.DefaultXSpecified;
            DefaultY = note.DefaultY;
            DefaultYSpecified = note.DefaultXSpecified;
            RelativeX = note.RelativeX;
            RelativeXSpecified = note.RelativeXSpecified;
            RelativeY = note.RelativeY;
            RelativeYSpecified = note.RelativeYSpecified;
            FontFamily = note.FontFamily;
            FontStyle = note.FontStyle;
            FontStyleSpecified = note.FontStyleSpecified;
            FontSize = note.FontSize;
            FontWeight = note.FontWeight;
            FontWeightSpecified = note.FontWeightSpecified;
            Color = note.Color;
            PrintDot = note.PrintDot;
            PrintDotSpecified = note.PrintDotSpecified;
            PrintLyric = note.PrintLyric;
            PrintLyricSpecified = note.PrintLyricSpecified;
            Dynamics = note.Dynamics;
            DynamicsSpecified = note.DynamicsSpecified;
            EndDynamics = note.EndDynamics;
            EndDynamicsSpecified = note.EndDynamicsSpecified;
            Attack = note.Attack;
            AttackSpecified = note.AttackSpecified;
            Release = note.Release;
            ReleaseSpecified = note.ReleaseSpecified;
            TimeOnly = note.TimeOnly;
            Pizzicato = note.Pizzicato;
            PizzicatoSpecified = note.PizzicatoSpecified;
        }