public static SerializedChord Deserialize(string str)
        {
            SerializedChord ret = null;
            var             ser = new XmlSerializer(typeof(SerializedChord));

            using (var tr = new StringReader(str))
            {
                ret = (SerializedChord)ser.Deserialize(tr);
            }
            return(ret);
        }
Exemplo n.º 2
0
        public SerializedChord Serialize()
        {
            var ret = new SerializedChord();

            ret.TickLength = TickLength;
            ret.TimeLength = TimeLength;

            ret.Notes.AddRange(Notes.Select(x => new SerializedChordNote()
            {
                Fret = x.NoteFretDown, String = x.NoteString, Channel = x.Channel
            }));
            ret.Modifiers.AddRange(Modifiers.Select(x => new SerializedChordModifier()
            {
                Type = (int)x.ModifierType
            }));
            ret.RootNoteConfig = RootNoteConfig.GetIfNotNull(x => x.Clone());
            GetTunedChordNames(null).ForEach(x =>
                                             ret.Names.Add(x));
            return(ret);
        }