/// <summary> /// Will clean all the text fields /// </summary> private void ClearFields() { EventNameTextBox.Clear(); InitializeDatePicker(); InitializeTimePicker(); DescriptionTextBox.Clear(); }
/// <summary> /// Updates the changes in the scenario values into the datamodel. Occurs when the save button is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveDataButton_OnClickDataButton_Click(object sender, RoutedEventArgs e) { BindingExpression be = TitleTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null) { be.UpdateSource(); } be = AuthorTextbox.GetBindingExpression(TextBox.TextProperty); if (be != null) { be.UpdateSource(); } be = DescriptionTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null) { be.UpdateSource(); } be = CreateDatePicker.GetBindingExpression(DatePicker.SelectedDateProperty); if (be != null) { be.UpdateSource(); } be = RatingTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null) { be.UpdateSource(); } WorkbookModel workbook = new WorkbookModel(Globals.ThisAddIn.Application.ActiveWorkbook); workbook.ShouldScanAfterSave = false; Globals.ThisAddIn.Application.ActiveWorkbook.Save(); workbook.ShouldScanAfterSave = true; }
private void ClearFields() { if (SelectedDatabase.SelectedItem.ToString() == "Games") { foreach (Control c in MainTableLayout.Controls) { if (c.GetType() == GameNameTextbox.GetType() || c.GetType() == DescriptionTextBox.GetType()) c.Text = ""; } DateTextbox.Value = DateTime.Today; DataChanged = false; PosterBox.BackgroundImage = null; IconBox.BackgroundImage = null; SelectedGame = null; for(int i = 0; i < ListboxPlatforms.Items.Count; i++) { ListboxPlatforms.SetSelected(i, false); } } if (SelectedDatabase.SelectedItem.ToString() == "Platforms") { foreach (Control c in PlatformTableLayout.Controls) { if (c.GetType() == PlatformNameTextbox.GetType()) c.Text = ""; } PlatformIconBox.BackgroundImage = null; SelectedPlatform = null; } }
private void CameraSettingsCB_SelectionChanged(object sender, SelectionChangedEventArgs e) { var selection = vm.CurrentCameraSettings; if (DescriptionTextBox != null) { //CameraSettingIDTextBlock.GetBindingExpression(TextBlock.TextProperty).UpdateTarget(); DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateTarget(); VSSCombo.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateTarget(); HSSCombo.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateTarget(); VertClockAmpCombo.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateTarget(); UseEMGainCkBx.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateTarget(); UseFrameTransferCkBx.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateTarget(); IsDefaultCkBx.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateTarget(); StartingExposureUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget(); ExposureLimitUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget(); HighPixelThresholdPercentUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget(); LowPixelThresholdPercentUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget(); MinPercentPixelsAboveLowThresholdUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget(); MaxPercentPixelsAboveHighThresholdUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget(); IncreasingSignalRB.GetBindingExpression(RadioButton.IsCheckedProperty).UpdateTarget(); DecreasingSignalRB.GetBindingExpression(RadioButton.IsCheckedProperty).UpdateTarget(); StartingBinningCombo.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateTarget(); EMGainLimitUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget(); } }
private void SaveButton_Click_1(object sender, EventArgs e) { if (NameTextBox.Text == "" || DescriptionTextBox.Text == "") { WarningLabel.DissapearAfterSeconds(2); NameTextBox.FlickerIfEmpty(); DescriptionTextBox.FlickerIfEmpty(); } else { //DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image); Place place = (Place)PlacesComboBox.SelectedItem; if (NameTextBox.Text != place.Name) { place.Name = NameTextBox.Text; } if (LuxeCheckBox.Checked != place.Luxe) { place.Luxe = LuxeCheckBox.Checked; } if (DescriptionTextBox.Text != place.Description) { place.Description = DescriptionTextBox.Text; } if (ImagePictureBox.BackgroundImage != place.Image) { place.Image = ImagePictureBox.BackgroundImage; } this.Close(); } }
private void SurroundDescriptionTextWith(string leftChars, string rightChars, string tempText) { string part1; string part2; string part3; if (DescriptionTextBox.SelectionLength > 0) { var startIndex = DescriptionTextBox.SelectionStart; var stringLength = DescriptionTextBox.SelectionLength; part1 = DescriptionTextBox.Text.Substring(0, startIndex); part2 = DescriptionTextBox.Text.Substring(startIndex, stringLength); part3 = DescriptionTextBox.Text.Substring(startIndex + stringLength); DescriptionTextBox.Text = part1 + leftChars + part2 + rightChars + part3; DescriptionTextBox.SelectionStart = startIndex + leftChars.Length; DescriptionTextBox.SelectionLength = stringLength; } else { var startIndex = DescriptionTextBox.CaretIndex; part1 = DescriptionTextBox.Text.Substring(0, startIndex); part2 = leftChars + tempText + rightChars; part3 = DescriptionTextBox.Text.Substring(startIndex); DescriptionTextBox.Text = part1 + part2 + part3; DescriptionTextBox.SelectionStart = startIndex + leftChars.Length; DescriptionTextBox.SelectionLength = tempText.Length; } DescriptionTextBox.Focus(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { DescriptionTextBox.Focus(); DescriptionTextBox.SelectAll(); UpdateACFChart(); }
private async void CreateFoodButton_Click(object sender, EventArgs e) { if (_isHubConnectionStarted is false) { await _hubConnection.StartAsync(); _isHubConnectionStarted = true; } CreateFoodDto createFoodDto = new CreateFoodDto { Name = NameTextBox.Text, Description = DescriptionTextBox.Text, Ingredients = IngredientsTextBox.Text, }; await _hubConnection.SendAsync("CreateFood", createFoodDto); _hubConnection.On <bool>("CreateFoodResult", handler => { if (handler) { MessageBox.Show("Created."); NameTextBox.Clear(); DescriptionTextBox.Clear(); IngredientsTextBox.Clear(); } else { MessageBox.Show("Faild to create."); } }); }
/// <summary> /// Checks if the scenario details need saving or not /// </summary> /// <returns></returns> public bool NeedSave() { BindingExpression be = TitleTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null && be.IsDirty) { return(true); } be = AuthorTextbox.GetBindingExpression(TextBox.TextProperty); if (be != null && be.IsDirty) { return(true); } be = DescriptionTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null && be.IsDirty) { return(true); } be = CreateDatePicker.GetBindingExpression(DatePicker.SelectedDateProperty); if (be != null && be.IsDirty) { return(true); } be = RatingTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null && be.IsDirty) { return(true); } return(false); }
/// <summary> /// Updates the Targets of every field. This is done when changes get discarded. So the values get overridden with the values in the source of the binding /// </summary> private void UpdateTargets() { BindingExpression be = TitleTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null) { be.UpdateTarget(); } be = AuthorTextbox.GetBindingExpression(TextBox.TextProperty); if (be != null) { be.UpdateTarget(); } be = DescriptionTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null) { be.UpdateTarget(); } be = CreateDatePicker.GetBindingExpression(DatePicker.SelectedDateProperty); if (be != null) { be.UpdateTarget(); } be = RatingTextBox.GetBindingExpression(TextBox.TextProperty); if (be != null) { be.UpdateTarget(); } }
private void OnAddTableClicked(object sender, RoutedEventArgs e) { var tableSizeVm = new TableMarkdownSizeViewModel("Enter table size:", "Enter table size"); var view = ViewFactory.CreateViewWithDataContext <TableMarkdownSizeView>(tableSizeVm); view.ShowDialog(); if (tableSizeVm.UserCancelled) { return; } var tableVm = new TableMarkdownViewModel(tableSizeVm.NumCols, tableSizeVm.NumRows); view = ViewFactory.CreateViewWithDataContext <TableMarkdownView>(tableVm); view.ShowDialog(); if (!tableVm.UserCancelled) { var startIndex = DescriptionTextBox.CaretIndex; var part1 = DescriptionTextBox.Text.Substring(0, startIndex); var part2 = $"\n{tableVm.SelectedValue}\n"; var part3 = DescriptionTextBox.Text.Substring(startIndex); DescriptionTextBox.Text = part1 + part2 + part3; DescriptionTextBox.Focus(); } }
private void OnCodeClicked(object sender, RoutedEventArgs e) { var textwrap = DescriptionTextBox.TextWrapping; if (textwrap == TextWrapping.Wrap) { DescriptionTextBox.TextWrapping = TextWrapping.NoWrap; } var startLineIndex = DescriptionTextBox.GetLineIndexFromCharacterIndex(DescriptionTextBox.SelectionStart); var endLineIndex = DescriptionTextBox.GetLineIndexFromCharacterIndex(DescriptionTextBox.SelectionStart + DescriptionTextBox.SelectionLength); if (startLineIndex != endLineIndex) { var collection = ColorCode.Languages.All.Select(l => l.Name).OrderBy(n => n).ToList(); collection.Insert(0, "None"); var vm = InputViewFactory.ShowComboBoxInput("Please choose a code language:", "Code Language", collection); var language = String.Empty; if (vm.UserCancelled) { DescriptionTextBox.TextWrapping = textwrap; return; } if (vm.SelectedValue != "None") { language = vm.SelectedValue; } for (var index = startLineIndex; index <= endLineIndex; index++) { var lineStartIndex = DescriptionTextBox.GetCharacterIndexFromLineIndex(index); DescriptionTextBox.Text = DescriptionTextBox.Text.Insert(lineStartIndex, " "); } if (language != String.Empty) { DescriptionTextBox.Text = DescriptionTextBox.Text.Insert( DescriptionTextBox.GetCharacterIndexFromLineIndex(startLineIndex), " " + OmniTextRenderer.LangDefinitionText + language + Environment.NewLine); endLineIndex++; } DescriptionTextBox.SelectionStart = DescriptionTextBox.GetCharacterIndexFromLineIndex(startLineIndex); var endOfLastLineIndex = DescriptionTextBox.GetCharacterIndexFromLineIndex(endLineIndex) + DescriptionTextBox.GetLineText(endLineIndex).Length; DescriptionTextBox.SelectionLength = endOfLastLineIndex - DescriptionTextBox.SelectionStart; DescriptionTextBox.Focus(); } else { SurroundDescriptionTextWith("`", "code text"); } DescriptionTextBox.TextWrapping = textwrap; }
private void Clear() { ProductIdTextBox.Clear(); ProductNameTextBox.Clear(); DescriptionTextBox.Clear(); ProductPriceTextBox.Clear(); NewProductArrivedTextBox.Clear(); onHandCount.Clear(); }
private bool verifier() { if (DescriptionTextBox.Text.Trim() == string.Empty) { MessageBox.Show("Description de la fonction est Obligatoire", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); DescriptionTextBox.Focus(); } return(true); }
private void SaveButton_Click(object sender, EventArgs e) { new LogController().AddLogEntry(TitleTextBox.Text, DateTimePicker.Value, StartTimeTimePicker.Value, EndTimeTimePicker.Value, HoursWorkedTimePicker.Value, DescriptionTextBox.Text, AuthorTextBox.Text); TitleTextBox.Clear(); DescriptionTextBox.Clear(); AuthorTextBox.Clear(); MessageBox.Show("New log entry added!", "Log added!"); }
public bool Validate() { ServernameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); ServerAddressTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); PortTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); PasswordTextBox.GetBindingExpression(PasswordHelper.PasswordProperty).UpdateSource(); DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); return(IsValid()); }
public void AddShareSkillDetails(ShareSkillDetails skillObj) { //Enter Title data from Excel driver.WaitForElementIsVisible(TitleTextBox); TitleTextBox.SendKeys(skillObj.Title); //Enter Description data from Excel DescriptionTextBox.SendKeys(skillObj.Description); //Select Category based on Excel data driver.WaitForElementIsVisible(CategoryDropDown); SelectElement categorySelect = new SelectElement(CategoryDropDown); categorySelect.SelectByText(skillObj.Category); //Select Subcategory based on Excel data SelectElement subCategorySelect = new SelectElement(SubCategoryDropDown); subCategorySelect.SelectByText(skillObj.SubCategory); //Enter Text in Tag and perform keyboard action "Enter" TagTextBox.SendKeys(skillObj.Tags + Keys.Enter); //Select Service Type based on Excel data SelectRadioButton(ServiceType, ServiceTypeLabel, skillObj.ServiceType); //Select Location Type based on Excel data SelectRadioButton(LocationType, LocationTypeLabel, skillObj.LocationType); //Enter Startdate based on Excel data StartDate.SendKeys(skillObj.StartDate); //Enter Enddate based on Excel data EndDate.SendKeys(skillObj.EndDate); //Select days based on excel data and enter start and end time SelectAvailableDays(skillObj.SelectDay, skillObj.StartTime, skillObj.EndTime); //Select SkillTrade based on Excel data SelectRadioButton(SkillTrade, SkillTradeLabel, skillObj.SkillTrade); //Enter Text in Tag and perform keyboard action "Enter" SkillExchange.SendKeys(skillObj.SkillExchange + Keys.Enter); //Click WorkSample and upload the file through AutoIT driver.WaitForElementIsVisible(WorkSamples); WorkSamples.Click(); UploadFileByAutoIT(); //Select Active/Hidden based on Excel data SelectRadioButton(Active, ActiveLabel, skillObj.Active); //Save ShareSkill data SaveButton.Click(); }
private bool DescriptionIsFilled() { bool filled = !string.IsNullOrEmpty(DescriptionTextBox.Text); if (!filled) { MessageBox.Show("Description cannot be empty"); DescriptionTextBox.Focus(); } return(filled); }
private bool ValidateForm() { if (!Regex.Match(DescriptionTextBox.Text, @"^\D{1,150}$").Success) { MessageBox.Show("Description must consist of at least 6 character and not exceed 150 characters!"); DescriptionTextBox.Focus(); return(false); } return(true); }
private void RestoreDefaultValues() { TitleTextBox.Clear(); DescriptionTextBox.Clear(); StartDatePicker.Value = _dateTimeProvider.Today; DueDatePicker.Value = _dateTimeProvider.Today; StatusBox.SelectedIndex = 0; PriorityBox.SelectedIndex = 0; UsersBox.SelectedIndex = 0; }
public BusinessFlowInfoPage(BusinessFlow businessFlow) { InitializeComponent(); mBusinessFlow = businessFlow; NameTextBox.BindControl(mBusinessFlow, nameof(BusinessFlow.Name)); DescriptionTextBox.BindControl(mBusinessFlow, nameof(BusinessFlow.Description)); TargetApplicationsListBox.ItemsSource = mBusinessFlow.TargetApplications; TargetApplicationsListBox.DisplayMemberPath = nameof(TargetApplication.AppName); }
public void OnWorkspaceReset() { PatchListView.Items.Clear(); DescriptionTextBox.Clear(); ConflictsTextBox.Clear(); ApplyPatchesButton.Enabled = false; RollbackPatchesButton.Enabled = false; OpenInEditorButton.Enabled = false; CheckForUpdatesButton.Enabled = false; ReloadPatchesButton.Enabled = false; }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (DescriptionTextBox.ContainsFocus) { if (keyData.HasFlag(Keys.Z) && keyData.HasFlag(Keys.Control) && DescriptionTextBox.CanUndo) { DescriptionTextBox.Undo(); return(true); } } return(base.ProcessCmdKey(ref msg, keyData)); }
private void displayValidation() { DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); NameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); ImageTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TypesComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); EraComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); IconTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TouristicComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); IncomeTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); DateTextBox.GetBindingExpression(Xceed.Wpf.Toolkit.MaskedTextBox.TextProperty).UpdateSource(); DateComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); }
private void Clear_All() { AssetTagTextBox.Clear(); AssetTagSearchTextBox.Clear(); SerialTextBox.Clear(); SerialSearchTextBox.Clear(); CurrrentUserTextBox.Clear(); DescriptionTextBox.Clear(); ReplaceYearTextBox.Clear(); TrackablesCheckBox.Checked = false; HistoricalCheckBox.Checked = false; RefreshCombos(); }
private void InitDBControls() { SerialSearchTextBox.SetDBInfo(DevicesCols.Serial); AssetTagSearchTextBox.SetDBInfo(DevicesCols.AssetTag); DescriptionTextBox.SetDBInfo(DevicesCols.Description); EquipTypeComboBox.SetDBInfo(DevicesCols.EQType, Attributes.DeviceAttributes.EquipType); ReplaceYearTextBox.SetDBInfo(DevicesCols.ReplacementYear); OSTypeComboBox.SetDBInfo(DevicesCols.OSVersion, Attributes.DeviceAttributes.OSType); LocationComboBox.SetDBInfo(DevicesCols.Location, Attributes.DeviceAttributes.Locations); CurrrentUserTextBox.SetDBInfo(DevicesCols.CurrentUser); StatusComboBox.SetDBInfo(DevicesCols.Status, Attributes.DeviceAttributes.StatusType); TrackablesCheckBox.SetDBInfo(DevicesCols.Trackable); }
private bool ValidateForm() { if (!Regex.Match(TitleTextBox.Text, @"^\D{1,20}$").Success) { MessageBox.Show("Title must consist of at least 1 character and not exceed 20 characters!"); TitleTextBox.Focus(); return(false); } if (!Regex.Match(DescriptionTextBox.Text, @"^\D{1,200}$").Success) { MessageBox.Show("Description must consist of at least 1 character and not exceed 200 characters!"); DescriptionTextBox.Focus(); return(false); } if (CategoryComboBox.SelectedItem == null) { MessageBox.Show("Please select category"); return(false); } if (ProducerComboBox.SelectedItem == null) { MessageBox.Show("Please select categoty"); return(false); } if (!Regex.Match(WeightTextBox.Text, @"^[0-9]*(?:\,[0-9]*)?$").Success) { MessageBox.Show("Invalid weight! Check the data you've entered!"); WeightTextBox.Focus(); return(false); } if (!Regex.Match(ComponentsTextBox.Text, @"^\D{1,200}$").Success) { MessageBox.Show("Components must consist of at least 1 character and not exceed 200 characters!"); ComponentsTextBox.Focus(); return(false); } if (!Regex.Match(PriceTextBox.Text, @"^[0-9]*(?:\,[0-9]*)?$").Success) { MessageBox.Show("Invalid price! Check the data you've entered!"); PriceTextBox.Focus(); return(false); } return(true); }
private void SaveButton_Click(object sender, EventArgs e) { if (NameTextBox.Text == "" || DescriptionTextBox.Text == "") { WarningLabel.DissapearAfterSeconds(2); NameTextBox.FlickerIfEmpty(); DescriptionTextBox.FlickerIfEmpty(); } else { DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image); this.Close(); } }
/// <summary> /// ProjTextBoxのKeyDownイベント /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ProjTextBox_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { DescriptionTextBox.Focus(); } } catch (Exception ex) { throw Program.ThrowException(ex); } }
private void ResetFormControl() { TitleTextBox.Clear(); DescriptionTextBox.Clear(); TitleTextBox.Focus(); //moves cursor to TitleTextBox // Check if form is loaded for updated process if (this.IsUpdate) { this.RoleId = 0; this.IsUpdate = false; SaveButton.Text = "Save Information"; DeleteButton.Enabled = false; } }