コード例 #1
0
ファイル: PiTest.cs プロジェクト: amithsaddi/rpibot
        public static void GenerateSampleXml()
        {
            var actions = new List <PiAction>();

            actions.Add(new Model.PiAction()
            {
                Direction = "forward", Length = "24", Name = "Motor2"
            });
            actions.Add(new Model.PiAction()
            {
                Direction = "backward", Length = "24", Name = "Motor2"
            });

            DataModel dataModel = new DataModel();

            dataModel.Data = new Data()
            {
                PiActions = actions, Enable = false
            };
            XmlSerialiser xmlSerialiser = new XmlSerialiser();
            string        data          = xmlSerialiser.Serialize(dataModel);

            Console.WriteLine(data);
        }