private void UpdateVolume(string secondCommand) { if (secondCommand == "UP") { InternalFuncions.VolumeControl("change", 10); Console.WriteLine("VOL UP"); } else if (secondCommand == "DOWN") { InternalFuncions.VolumeControl("change", -10); } }
// upload file box private void btnOpenFile_Click(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == true) { pptx_location = openFileDialog.FileName; FileContent = Saver.GetContentFromPPTX(pptx_location); pptx_size = FileContent.Count; pptx_current_index = 0; pptx_current_block = 0; InternalFuncions.OpenProgram(pptx_location); ControlTemplate ct = powerpoint_button.Template; Image btnImage = (Image)ct.FindName("powerpoint_status", powerpoint_button); btnImage.Source = new BitmapImage(new Uri(@"im_icons\powerpoint_green.png", UriKind.Relative)); } }
// execute actions private void ExecuteAction(string action) { switch (action) { case "READ_SLIDE": Read_Slide(false); break; case "READ_NEXT": Read_Slide(true); break; case "NEXT_SLIDE": if (pptx_location == null) { sm.Speak("Não foi especificado ficheiro de apresentação"); return; } if (pptx_current_index + 1 >= pptx_size) { sm.Speak("Não há mais diapositivos"); } else { pptx_current_index++; pptx_current_block = 0; InternalFuncions.PowerPointControl("next", 0); } break; case "PREV_SLIDE": if (pptx_location == null) { sm.Speak("Não foi especificado ficheiro de apresentação"); return; } if (pptx_current_index <= 0) { sm.Speak("Não há mais diapositivos"); } else { pptx_current_index--; pptx_current_block = 0; InternalFuncions.PowerPointControl("previous", 0); } break; case "OPEN_HELP": Open_HelpWindow(); break; case "CLOSE_HELP": Close_HelpWindow(); break; case "LASER_POINTER": InternalFuncions.PowerPointControl("pointer", 0); break; case "LASER_PEN": InternalFuncions.PowerPointControl("pen", 0); break; case "SUSPEND": System.Threading.Thread.Sleep(1500); sm.Speak("A suspender em 3"); System.Threading.Thread.Sleep(1500); sm.Speak("2"); System.Threading.Thread.Sleep(1000); sm.Speak("1"); System.Threading.Thread.Sleep(1000); InternalFuncions.PowerControl("sleep"); break; } }