public MainWindow() { InitializeComponent(); ReassembleLocations = new List <WorstHack>(); FindButton.AddHandler(MouseDownEvent, new RoutedEventHandler(FindButton_MouseDown), true); LeagueVersionLabel.Content = IntendedVersion; if (File.Exists("debug.log")) { File.Delete("debug.log"); } if (Directory.Exists("temp")) { DeletePathWithLongFileNames(Path.GetFullPath("temp")); } if (Directory.Exists(Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "wm"))) { MessageBox.Show("You may have malware on your system due to getting this application from an unknown source. Please delete C:/wm/ and the file inside it and then download this application from http://da.viddiaz.com/LESs"); } worker.DoWork += worker_DoWork; worker.RunWorkerCompleted += worker_RunWorkerCompleted; if (!Debugger.IsAttached) { AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException; } }
public FindCustomerResultsAdapter Find() { FindButton.Click(); Sleeper.Delay(500); ResetFindCustomerWindow(); return(new FindCustomerResultsAdapter()); }
/// <summary> /// Нажать на кнопку 'Найти' /// </summary> public ScheduleMainPage ClickFindButton() { CustomTestContext.WriteLine("Нажать на кнопку 'Найти'"); FindButton.Click(); return(LoadPage()); }
/// <summary> /// 保存配置文件 /// </summary> /// <param name="vm"></param> //private static void SaveConfig(TabViewModel vm) //{ // var saveDg = new System.Windows.Forms.SaveFileDialog // { // InitialDirectory = Directory.GetCurrentDirectory(), // Filter = "(*.lmf)|*.lmf", // FileName = string.Concat("untitled_", DateTime.Now.ToString("yyyyMMdd")), // AddExtension = true, // RestoreDirectory = true // }; // if (saveDg.ShowDialog() == System.Windows.Forms.DialogResult.OK) // { // try // { // string iniFilePath = saveDg.FileName; // File.Create(iniFilePath); // OperateIniFile.WriteIniData("Settings", "SrcDir", vm.SrcDir, iniFilePath); // OperateIniFile.WriteIniData("Settings", "DestDir", vm.DestDir, iniFilePath); // OperateIniFile.WriteIniData("Settings", "FileFilter", vm.FileFilter, iniFilePath); // OperateIniFile.WriteIniData("Settings", "ExcludeFilter", vm.ExcludeFilter, iniFilePath); // OperateIniFile.WriteIniData("Settings", "Hours", vm.Hours, iniFilePath); // } // catch (Exception ex) // { // System.Windows.MessageBox.Show(ex.Message, "异常", MessageBoxButton.OK, MessageBoxImage.Error); // } // } //} private void HandleKeyDownEvent(object sender, KeyEventArgs e) { if (e.Key == Key.Enter && e.Source is TextBox tb && tb != null) { FindButton.Focus(); Find(_vm, _container, Dispatcher); }
private void TextBlock_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { FindButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); } }
private void FindDialog_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { FindButton.PerformClick(); } }
// Use this for initialization private void Start() { //Initialazing lists _canvases = new Dictionary <string, Canvas>(); _stories = new Dictionary <string, Story>(); _panels = new List <GameObject>(); ElementsToCrossfade = new List <GameObject>(); //add panels to the list FillPanels(); //show the main menu control bar ShowPanel(FindPanel.GO("ControlBar")); //get stories from internet _stories = Resources.GetStoriesFromInternet(); // add ExitGame callback to ExitButton listener FindButton.Named("ExitButton").onClick.AddListener(ExitGame); //Testing text transition (fade in) var text = FindText.Named("TextGameTitle"); VisualEffects.SetTextTransparent(text); ElementsToCrossfade.Add(text.gameObject); //Canvas initialization var mainMenuCanvas = FindCanvas.Named("MainMenuCanvas"); mainMenuCanvas.transform.SetAsLastSibling(); _canvases["mainMenuCanvas"] = mainMenuCanvas; foreach (var story in Stories.Values) { var cnv = Instantiate(FindCanvas.Named("StoryCanvas")); cnv.name = story.SnakeCase() + "_canvas"; _canvases[story.SnakeCase()] = cnv; } /*Button initialization * _exitButton = GameObject.Find("btnExit").GetComponent<Button>(); * * * //Assigning Methods to Unity actions * _exit += ExitGame; * * * //Assigning Unity actions to button Events * _exitButton.onClick.AddListener(_exit); */ }
private void MyContext_AfterPerformFind(object sender, EventArgs e) { EnableDisableControls(); if (MyContext.SearchResultItems.Count > 0) { //ResultGrid.Focus(); //ResultGrid.MoveFocus(new TraversalRequest(FocusNavigationDirection.Down)); FindButton.Focus(); } }
private void FindTextBox_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { FindButton.PerformClick(); FindTextBox.Focus(); FindTextBox.Select(0, FindTextBox.TextLength); } }
private void EditorTextBox_KeyDown(object sender, KeyEventArgs e) { AcceptButton = null; if (e.KeyCode != Keys.Enter) { return; } e.Handled = true; FindButton.PerformClick(); AcceptButton = CreateButton; }
public SearchModalProxy Find(Type?selectType = null) { string changes = GetChanges(); var popup = FindButton.Find().CaptureOnClick(); popup = ChooseTypeCapture(popup, selectType); return(new SearchModalProxy(popup) { Disposing = okPressed => { WaitNewChanges(changes, "create dialog closed"); } }); }
private void FindTextBox_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; if (e.KeyChar == '\r') { FindButton.PerformClick(); } else { e.Handled = false; } }
public void BackToMainMenu() { DisableAllCanvases(); var canvas = FindCanvas.Named("MainMenuCanvas"); EnableCanvas(canvas); var panel = FindPanel.GO("ControlBar"); panel.transform.SetParent(canvas.transform); ShowPanel(panel, Color.grey); Destroy(FindButton.Named("BackButton").gameObject); }
private async void EnableControls() //called to enable the controls after the Discord Client connects { while (!Program.FirstConnectionEstablished) //while were not connected { await Task.Delay(25); //wait a bit } //at this point we have connected at least once foreach (Control ControlObj in this.Controls) //for all of the controls in the form { ControlObj.Enabled = true; //enable the control } FindButton.Focus(); }
void ReleaseDesignerOutlets() { if (FindButton != null) { FindButton.Dispose(); FindButton = null; } if (WhereText != null) { WhereText.Dispose(); WhereText = null; } }
private async void EnableControls() { while (!FirstConnectionEstablished) { await Task.Delay(25); } foreach (Control ControlObj in this.Controls) { ControlObj.Enabled = true; } FindButton.Focus(); YoutubeGetButton.Enabled = false; YoutubeBox.Enabled = false; }
void ReleaseDesignerOutlets() { if (FindButton != null) { FindButton.Dispose(); FindButton = null; } if (TotalFacesLabel != null) { TotalFacesLabel.Dispose(); TotalFacesLabel = null; } }
private void UserDialog_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (NameText.Focused) { FindButton.PerformClick(); } else if (list.Focused) { SelectAndClose(); } } }
async void FindPrinter_Click() { isBusy = true; UpdateButtons(); rootPage.NotifyUser("", NotifyType.StatusMessage); rootPage.ReleaseAllPrinters(); // Select a PosPrinter device using the Device Picker. DevicePicker devicePicker = new DevicePicker(); devicePicker.Filter.SupportedDeviceSelectors.Add(PosPrinter.GetDeviceSelector()); // Anchor the picker on the Find button. GeneralTransform ge = FindButton.TransformToVisual(Window.Current.Content as UIElement); Rect rect = ge.TransformBounds(new Rect(0, 0, FindButton.ActualWidth, FindButton.ActualHeight)); DeviceInformation deviceInfo = await devicePicker.PickSingleDeviceAsync(rect); rootPage.deviceInfo = deviceInfo; PosPrinter printer = null; if (deviceInfo != null) { printer = await PosPrinter.FromIdAsync(deviceInfo.Id); } if (printer != null && printer.Capabilities.Receipt.IsPrinterPresent) { rootPage.Printer = printer; rootPage.NotifyUser("Found receipt printer.", NotifyType.StatusMessage); } else { // Get rid of the printer we can't use. printer?.Dispose(); rootPage.NotifyUser("Please select a device whose printer is present.", NotifyType.ErrorMessage); } isBusy = false; UpdateButtons(); }
} // Window_MouseMove /// <summary> /// On Check button click gets id and checks whether such id exists /// </summary> /// <param name="sender">event source</param> /// <param name="e">event parametres</param> private void CheckButton_Click(object sender, RoutedEventArgs e) { // If not logged in remember about it if (token == null || currentUser == null) { ErrorText.Foreground = new SolidColorBrush(Color.FromRgb(223, 0, 0)); LoginButton.Focus(); System.Media.SystemSounds.Exclamation.Play(); return; } // if (token == null || currentUser == null) // Send request string req = "https://api.vk.com/method/users.get.xml?"; req += "uids=" + FindIDTextBox.Text + "&fields=first_name,last_name&access_token=" + token; WebRequest request = WebRequest.Create(req); WebResponse response = request.GetResponse(); XmlDocument xml = new XmlDocument(); xml.LoadXml(new System.IO.StreamReader(response.GetResponseStream()).ReadToEnd()); // If there is an error in response show it for user if (xml["error"] != null) { string errorCode = xml["error"]["error_code"].InnerText; ErrorText.Content = "Шаг 2: введите адрес и нажмите Проверить"; System.Media.SystemSounds.Exclamation.Play(); // If there was earlier finded user delete him searchedUser = null; // Show info about error switch (errorCode) { case "113": MessageBox.Show("Такой страницы не существует", "Ошибка"); ErrorText.Foreground = new SolidColorBrush(Color.FromRgb(0, 0, 0)); return; case "6": MessageBox.Show("Сервер перегружен запросами, повторите попытку через несколько секунд", "Ошибка"); return; case "5": MessageBox.Show("Ошибка авторизации. Попробуйте войти еще раз", "Ошибка"); ErrorText.Content = "Шаг 1: войдите ВКонтакте, нажав Войти"; token = null; currentUser = null; LoginButton.Focus(); return; case "4": goto case "5"; case "2": MessageBox.Show("Приложение отключено. Попробуйте повторить попытку через несколько минут", "Ошибка"); return; default: MessageBox.Show("ВКонтакте сообщил о неизвестной ошибке. Попробуйте еще раз", "Ошибка"); return; } // switch (errorCode) } // if (xml["error"] != null) // If user is DELETED there is no such user if (xml["response"]["user"]["first_name"].InnerText == "DELETED" && xml["response"]["user"]["last_name"].InnerText == "") { System.Media.SystemSounds.Exclamation.Play(); MessageBox.Show("Такой страницы не существует", "Ошибка"); ErrorText.Content = "Шаг 2: введите адрес и нажмите Проверить"; ErrorText.Foreground = new SolidColorBrush(Color.FromRgb(0, 0, 0)); // If there was earlier finded user delete him searchedUser = null; } // if first_name == DELETED && last_name == "" // save finded user and go to step 3 else { searchedUser = new User(xml["response"]["user"]); ErrorText.Content = "Шаг 3: нажмите Найти путь"; ErrorText.Foreground = new SolidColorBrush(Color.FromRgb(0, 0, 0)); MessageBox.Show(xml["response"]["user"]["first_name"].InnerText + " " + xml["response"]["user"]["last_name"].InnerText, "Пользователь найден"); FindButton.Focus(); } // if !(if first_name == DELETED && last_name == "") } // CheckButton_Click