Exemplo n.º 1
0
 public override void JoystickPressed(Gadgeteer.Modules.GHIElectronics.Joystick sender, Gadgeteer.Modules.GHIElectronics.Joystick.JoystickState state)
 {
     _Data = new ExampleData();
     _Data.LastDate = DateTime.Now;
     SaveData();
     PrintLastDate();
 }
Exemplo n.º 2
0
 public static void XmlSerialize(
      string filename, ExampleData data)
 {
     var x = new XmlSerializer(typeof(ExampleData));
     using (var Writer = new StreamWriter(filename, false))
     {
         x.Serialize(Writer.BaseStream,data);
     }
 }
Exemplo n.º 3
0
        public override void Exit()
        {
            //To do at the end (desubscribe events...)
            if (MainHandle.SdCard.IsCardMounted)
            {
                //save date
                _Data          = new ExampleData();
                _Data.LastDate = DateTime.Now;
                SaveData();
            }
            else
            {
                ConsoleDisplayN18.Clear();
                ConsoleDisplayN18.WriteLine("Sorry I cannot save the date.");
                Thread.Sleep(1000);
            }

            StopListen();//Stop timer and interface
        }
Exemplo n.º 4
0
        public override void Exit()
        {
            //To do at the end (desubscribe events...)
            if (MainHandle.SdCard.IsCardMounted)
            {
                //save date
                _Data = new ExampleData();
                _Data.LastDate = DateTime.Now;
                SaveData();
            }
            else
            {
                ConsoleDisplayN18.Clear();
                ConsoleDisplayN18.WriteLine("Sorry I cannot save the date.");
                Thread.Sleep(1000);
            }

            StopListen();//Stop timer and interface
        }
Exemplo n.º 5
0
 private void ReadData()
 {
     if (IsMountSdCard()) //ask to mountSD
     {
         string rootDirectory = MainHandle.SdCard.GetStorageDevice().RootDirectory;
         _Data = ExampleData.XmlDeSerialize(rootDirectory + @"\" + _Filename);
         Debug.Print("Last record : " + _Data.LastDate.ToString());
     }
 }