private void CopyFiles(string sourceDir) { string[] files = sdStorageDevice.ListFiles(sourceDir); foreach (string filepath in files) { if (!filepath.Substring(0, 1).Equals(".")) { BufferedFileCopy(filepath); } } }
public void PopulateList() { ArrayList options = new ArrayList(); if (VerifySDCard()) { try { sdCard.StorageDevice.CreateDirectory(@"Code"); } catch { } GT.StorageDevice storage = sdCard.StorageDevice; foreach (string s in storage.ListRootDirectorySubdirectories()) { Debug.Print(s); if (s == "Code") { foreach (string f in storage.ListFiles("\\SD\\Code\\")) { //var x = f.Substring(f.LastIndexOf("\\")+1); var namafile = Path.GetFileNameWithoutExtension(f); options.Add(new object[2] { namafile, f }); } } } if (options.Count <= 0) { options.Add(new object[2] { "--kosong--", null }); } listFile = new GHI.Glide.UI.List(options, 300); } }
void ProgramStarted() { Font fontTitle = Resources.GetFont(Resources.FontResources.NinaB); Font fontBody = Resources.GetFont(Resources.FontResources.MirB64); Font fontStatus = Resources.GetFont(Resources.FontResources.small); _oledDriver = new OledDisplayDriver(oledDisplay, fontTitle, fontBody, fontStatus); _oledDriver.SetTitle("Hello"); _oledDriver.SetBody("Foo"); _joystickDriver = new JoystickDriver(joystick); _joystickDriver.JoystickMotion += new JoystickDriver.JoystickMotionHandler(_joystickDriver_JoystickMotion); _emic2 = new Emic2(Serial.COM1); _emic2.ReadLine += new ThreadedSerialDevice.ReadHandler(_emic2_ReadLine); _emic2.Version(); _mp3Trigger = new Mp3Trigger(Serial.COM2); _mp3Trigger.ReadLine += new ThreadedSerialDevice.ReadHandler(_mp3Trigger_ReadLine); _mp3Trigger.SetVolume(40); _mp3Trigger.StatusVersion(); button1.ButtonPressed += new Button.ButtonEventHandler(button1_ButtonPressed); button1.ButtonReleased += new Button.ButtonEventHandler(button1_ButtonReleased); button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed); button.ButtonReleased += new Button.ButtonEventHandler(button_ButtonReleased); music.SetVolume(250); music.musicFinished += new Music.MusicFinishedPlayingEventHandler(music_musicFinished); GT.StorageDevice sd = sdCard.GetStorageDevice(); _soundFiles = sd.ListFiles("NoAgenda"); _wiflyThread = new Thread(WiFlyDriver); _wiflyThread.Start(); }
private void InitialiseModel(GT.StorageDevice SDCard) { _sdCardDevice = SDCard; OnFileListReady(_sdCardDevice.ListFiles("Thumbs")); OnNavigationRequested(NavigationDirection.Forward); }