Example #1
0
        public static string ToYaml(MSBT msbt)
        {
            var header     = MessageHeader.FromMSBT(msbt);
            var serializer = new Serializer();

            return(serializer.Serialize(header));
        }
Example #2
0
            public static MessageHeader FromMSBT(MSBT msbt)
            {
                MessageHeader header = new MessageHeader();

                for (int i = 0; i < msbt.header.Label1.Labels.Count; i++)
                {
                    var entry = msbt.header.Label1.Labels[i];

                    var msgEntry = new MessageEntry();
                    msgEntry.Name = entry.Name;
                    msgEntry.contents.text.Add(entry.String.GetText(msbt.header.StringEncoding));
                    header.entries.Add(msgEntry);
                }
                return(header);
            }