private void start() { sliverListActive = sliverList.Where(a => a.Active).ToList(); ds = new DiscordSend(discordHook.Text); populateResult = true; if (width > 3) { width = 3; } if (sliverList.Count == 0) { MessageBox.Show("Add a sliver using Save/Add"); return; } foreach (var sl in sliverList) { if (sl.alertSoundFilename == null || sl.alertSoundFilename.Length < 2) { sl.alertSoundFilename = Properties.Settings.Default.AlertSoundFile; } } Properties.Settings.Default.SliverList = ObjectToString(sliverList); Properties.Settings.Default.left = left; Properties.Settings.Default.top = top; Properties.Settings.Default.width = width; Properties.Settings.Default.height = height; Properties.Settings.Default.discord = discordHook.Text; Properties.Settings.Default.sftphost = sftphost.Text; Properties.Settings.Default.sftppw = sftppw.Password; Properties.Settings.Default.sftpun = sftpun.Text; Properties.Settings.Default.discordUrl = urlpic.Text; int testWidth; if (Int32.TryParse(copyWidth.Text, out testWidth)) { //Only save valid option to settings cpyWidth = testWidth; Properties.Settings.Default.cpyWidth = cpyWidth.ToString(); } Properties.Settings.Default.Save(); coord.Text = $"L:{(int)left}, T:{(int)top} W:{(int)width} H:{(int)height}"; BtnStart.Content = "Started"; if (gcwShowing) { gcwLocal.Close(); gcwSystem.Close(); } GreenGrid.Visibility = Visibility.Collapsed; Status.Background = Brushes.LightSeaGreen; Status.Content = "Started"; eveSystemBid = 0; dtimer.Start(); width = 3; setAbs(); }
private void Testdiscord_Click(object sender, RoutedEventArgs e) { var capImage = (Bitmap)sc.Capture(new System.Drawing.Point(left, (top)), new System.Drawing.Point(left + cpyWidth, top + height)); if (ds == null) { ds = new DiscordSend(discordHook.Text); } if (sftphost.Text.Length > 4 && sftppw.Password.Length > 4) { ds.pw = sftppw.Password; ds.host = sftphost.Text; ds.un = sftpun.Text; ds.urlpic = urlpic.Text; ds.SendImage(capImage); } ds.SendMessage("testing discord message"); }