void keyboardIcona_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { timer.Stop(); button.TurnLedOn(); button.ButtonPressed += button_ButtonPressed; HideButtons(); displayTE35.SimpleGraphics.DisplayImage(istrKey, 0, 0); Thread.Sleep(2000); canvas.Children.Clear(); canvas.Children.Add(numericKey); canvas.Children.Add(username); Canvas.SetBottom(username, 15); Canvas.SetLeft(username, 0); canvas.Children.Add(usernameValue); Canvas.SetBottom(usernameValue, 15); Canvas.SetLeft(usernameValue, 80); canvas.Children.Add(pin); Canvas.SetBottom(pin, 15); Canvas.SetLeft(pin, 200); canvas.Children.Add(pinValue); Canvas.SetBottom(pinValue, 15); Canvas.SetLeft(pinValue, 235); numericKey.TouchDown += numericKey_TouchDown; }
/** * Define el evento touch de la pantalla */ void TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { //proceso(); Debug.Print("TouchDown!!"); /* * POSTContent post_content; * String twitter_url; * String post_string; * * twitter_url = "http://www.google.cl"; * post_string = ""; * //post_content = POSTContent.CreateTextBasedContent(post_string); * post_content = new POSTContent(); * * //HttpRequest request = HttpHelper.CreateHttpPostRequest(twitter_url, post_content, null); * HttpRequest request = HttpHelper.CreateHttpGetRequest(twitter_url); * * request.ResponseReceived += new HttpRequest.ResponseHandler(ResponseReceived); * //request.AddHeaderField("", ""); * request.SendRequest(); */ }
void sdcard_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { timer.Stop(); button.TurnLedOn(); button.ButtonPressed += button_ButtonPressed; HideButtons(); displayTE35.SimpleGraphics.DisplayImage(istruzioniSD, 0, 0); Thread.Sleep(5000); if (sdCard.IsCardInserted && sdCard.IsCardMounted) { button.ButtonPressed -= button_ButtonPressed; button.TurnLedOff(); HideButtons(); displayTE35.SimpleGraphics.DisplayImage(authTry, 0, 0); string rootdirectory = sdCard.StorageDevice.RootDirectory; rootdirectory += @"\accessDoor"; FileStream fileStream = new FileStream(rootdirectory + @"\authDoor.txt", FileMode.Open); byte[] data = new byte[fileStream.Length]; Debug.Print(fileStream.Length + ""); fileStream.Read(data, 0, data.Length); fileStream.Close(); Debug.Print("data: " + data); string text = new string(Encoding.UTF8.GetChars(data)); Debug.Print("text: " + text); userStr = text.Substring(0, 6); Debug.Print(userStr); pinStr = text.Substring(8, 4); Debug.Print(pinStr); button.ButtonPressed -= button_ButtonPressed; Debug.Print("Contatta server"); utenteCorrente.id = userStr.ToString(); utenteCorrente.user = userStr.ToString(); utenteCorrente.pin = pinStr.ToString(); //Debug.Print("Net AVAIL: " + netif.NetworkIsAvailable); //Debug.Print("IP ADD: "+netif.IPAddress); //Debug.Print("DHCP EN: " + netif.IsDhcpEnabled); //Debug.Print("SUBNET MASK:" + netif.SubnetMask); //Debug.Print("GATEWAY" + netif.GatewayAddress); //Debug.Print("PIN "+ pinStr.ToString()); Hashtable ht = new Hashtable(); ht.Add("Id", utenteCorrente.id); ht.Add("User", utenteCorrente.user); ht.Add("Pwd", utenteCorrente.pin); POSTContent content = Gadgeteer.Networking.POSTContent.CreateWebFormData(ht); var request = HttpHelper.CreateHttpPostRequest(@"http://169.254.202.73/api/Utente/", content, "application/x-www-form-urlencoded"); request.ResponseReceived += request_ResponseReceived_USER_PIN; request.SendRequest(); HideButtons(); } SetupDisplay(); }
void mainWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { intervalPosition++; if (intervalPosition == intervals.Length) { intervalPosition = 0; } setTimerInterval(intervalPosition); }
void display_Standby_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { if (displayTE35.BacklightEnabled == false) { mainWindow.TouchDown -= display_Standby_TouchDown; displayTE35.BacklightEnabled = true; SetupDisplay(); } }
void touchScreen_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { timer.Stop(); String str = "touch detected at: " + e.Touches[0].X + "x" + e.Touches[0].Y; Debug.Print(str); console.TextContent = str; timer.Start(); }
private void MainWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { //lepas handler mainWindow.TouchDown -= MainWindow_TouchDown; //show info stackPanel.Children.Add(new Text(CurrentFont, "update is starting...")); stackPanel.Invalidate(); //flash app FlashFirmware(); }
void increase_touch_hour_end(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { Int32 hour = Int32.Parse(initHourEnd.TextContent) + 1; if (hour % 24 >= 10) { initHourEnd.TextContent = hour % 24 + ""; } else { initHourEnd.TextContent = "0" + hour % 24; } }
void increase_touch_minute_end(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { Int32 minute = Int32.Parse(initMinuteEnd.TextContent) + 1; if (minute % 60 >= 10) { initMinuteEnd.TextContent = minute % 60 + ""; } else { initMinuteEnd.TextContent = "0" + minute % 60; } }
void decrease_touch_hour_end(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { if (Int32.Parse(initHourEnd.TextContent) == 0) { initHourEnd.TextContent = 23 + ""; } else { Int32 hour = Int32.Parse(initHourEnd.TextContent) - 1; if (hour >= 10) { initHourEnd.TextContent = hour + ""; } } }
public void TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { pollingRatePosition++; if (pollingRatePosition >= pollingRates.Length) { pollingRatePosition = 0; } pollingTimer.Stop(); pollingTimer.Interval = new TimeSpan(0, 0, 0, 0, pollingRates[pollingRatePosition]); if (!delayTimer.IsRunning) { delayTimer.Start(); } }
void mainWindow_TouchMove(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { TouchInput[] touches = e.Touches; int oldX = -1; int oldY = -1; foreach (TouchInput touch in touches) { int x = touch.X - sideBarWidth; int y = touch.Y; if (oldX != -1) { background.Bitmap.DrawLine(drawingColor, 3, oldX, oldY, x, y); } oldX = x; oldY = y; } background.Invalidate(); }
void decrease_touch_minute_end(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { if (Int32.Parse(initMinuteEnd.TextContent) == 0) { initMinuteEnd.TextContent = 59 + ""; } else { Int32 hour = Int32.Parse(initMinuteEnd.TextContent) - 1; if (hour >= 10) { initMinuteEnd.TextContent = hour + ""; } else { initMinuteEnd.TextContent = "0" + hour; } } }
void b_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { Border border = sender as Border; if (border == null) { return; } Text t = border.Child as Text; string content = t.TextContent; if (keyPressedHandler != null) { KeyPressedEventArgs args = new KeyPressedEventArgs(content); keyPressedHandler(sender, args); } }
void getImage_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { timer.Stop(); button.TurnLedOn(); button.ButtonPressed += button_ButtonPressed; HideButtons(); displayTE35.SimpleGraphics.DisplayImage(istruzioniFoto1, 0, 0); Thread.Sleep(3000); camera.CurrentPictureResolution = Camera.PictureResolution.Resolution320x240; if (camera.CameraReady) { camera.StartStreaming(); } else if (!camera.CameraReady) { SetupDisplay(); } }
private void saveSettings(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { //Tipo di salvataggio ---> 11-00/23-50 time_sett = inithour.TextContent + "-" + initminute.TextContent + "/" + initHourEnd.TextContent + "-" + initMinuteEnd.TextContent; setupWindow(); }
private void goBack(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { setupWindow(); }
void settings_navigator(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { setSetupWindow(); }
void yellowButton_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { drawingColor = GT.Color.Yellow; }
void redButton_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { drawingColor = GT.Color.Red; }
void greenButton_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { drawingColor = GT.Color.Green; }
void whiteButton_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { drawingColor = GT.Color.White; }
void numericKey_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { // cancella tutto con delete e con invio contatta il server int y, x; e.GetPosition(mainWindow, 0, out x, out y); char carattere = riconosci_tocco_tastiera(x, y); if (carattere == 'v') { return; } if (ntoccou == 10 && carattere != 'e') { return; } if (carattere == 'e' && ntoccou == 10) { button.ButtonPressed -= button_ButtonPressed; Debug.Print("Contatta server"); utenteCorrente.id = userStr.ToString(); utenteCorrente.user = userStr.ToString(); utenteCorrente.pin = pinStr.ToString(); //Debug.Print("Net AVAIL: " + netif.NetworkIsAvailable); //Debug.Print("IP ADD: "+netif.IPAddress); //Debug.Print("DHCP EN: " + netif.IsDhcpEnabled); //Debug.Print("SUBNET MASK:" + netif.SubnetMask); //Debug.Print("GATEWAY" + netif.GatewayAddress); //Debug.Print("PIN "+ pinStr.ToString()); Hashtable ht = new Hashtable(); ht.Add("Id", utenteCorrente.id); ht.Add("User", utenteCorrente.user); ht.Add("Pwd", utenteCorrente.pin); POSTContent content = Gadgeteer.Networking.POSTContent.CreateWebFormData(ht); var request = HttpHelper.CreateHttpPostRequest(@"http://169.254.202.73/api/Utente/", content, "application/x-www-form-urlencoded"); request.ResponseReceived += request_ResponseReceived_USER_PIN; request.SendRequest(); HideButtons(); return; } else if (carattere == 'e') { return; } if (ntoccou == 0 && carattere == 'c') { SetupDisplay(); } if (ntoccou >= 0 && ntoccou <= 6) { if (carattere == 'c' && ntoccou != 0) { if (ntoccou == 1) { userStr = ""; ntoccou = 0; usernameValue.TextContent = ""; return; } else { userStr = userStr.Substring(0, ntoccou - 1); ntoccou--; usernameValue.TextContent = userStr; return; } } else if (carattere != 'c' && ntoccou != 6) { userStr += carattere.ToString(); ntoccou++; usernameValue.TextContent = userStr; return; } } if (ntoccou >= 6 && ntoccou <= 10) { if (carattere == 'c' && ntoccou != 6) { if (ntoccou == 7) { pinStr = ""; pinValue.TextContent = ""; ntoccou = 6; ntoccop = 0; return; } else { pinStr = pinStr.Substring(0, ntoccop - 1); string tmp = ""; for (int j = 0; j < pinStr.Length; j++) { tmp += '*'; } pinValue.TextContent = tmp; ntoccop--; ntoccou--; return; } } else if (carattere != 'c' && ntoccou != 10) { pinStr += carattere.ToString(); pinValue.TextContent += '*'; ntoccou++; ntoccop++; return; } } }
void blackButton_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { drawingColor = GT.Color.Black; }
void clearButton_TouchUp(object sender, Microsoft.SPOT.Input.TouchEventArgs e) { background.Bitmap = new Bitmap(320 - sideBarWidth, 240); background.Invalidate(); }