private void ClearAfterDelete()
 {
     DataChangeOff();
     LoadData();
     SearchTB.Clear();
     SearchStatusL.Text = "Number of results: " + Selected + "/" + x.Count;
 }
Esempio n. 2
0
        private void RemoveButton_Click(object sender, EventArgs e)
        {
            try
            {
                string id = ((AppMessage)MessagesLB.SelectedIndex())?.Id;

                if (!string.IsNullOrEmpty(id) && _messages.Remove(id))
                {
                    if (!_messages.SaveMessages())
                    {
                        MessageBox.Show("Unable to save some or all messages.", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    ClearMessageDetails();
                    ToggleButtons(false, DASH);
                    SearchTB.SetText(string.Empty);
                    UpdateMessages();
                    ClearMessageDisplay();
                }
            }
            catch (Exception)
            {
                //Something happened
            }
        }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SearchTB.Focus();
         MyDataBind();
     }
 }
Esempio n. 4
0
 private void ClearWorkPlace()
 {
     foreach (UIElement workPlaceChild in WorkPlace.Children)
     {
         if (workPlaceChild.Visibility == Visibility.Visible)
         {
             workPlaceChild.Visibility = Visibility.Hidden;
         }
     }
     SearchTB.Clear();
 }
Esempio n. 5
0
        // searches for the specified gallery and sets it to selected if exists
        private void SearchGalBtn_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(SearchTB.Text))
            {
                int target = Searcher.GallerySearch(SearchTB.Text, galleries);

                if (target >= 0)
                {
                    GalleryList.SelectedItem = galleries.ElementAt(target);
                }
            }

            SearchTB.Clear();
        }
Esempio n. 6
0
 public void Cleanup()
 {
     _controls.Remove(_parentId, SearchTB.GetId());
     _controls.Remove(_parentId, MessageTB.GetId());
     _controls.Remove(_parentId, PreviewTB.GetId());
     _controls.Remove(_parentId, AuthorsTB.GetId());
     _controls.Remove(_parentId, SourcesTB.GetId());
     _controls.Remove(_parentId, MessagesLB.GetId());
     _controls.Remove(_parentId, Title.GetId());
     _controls.Remove(_parentId, Status.GetId());
     _controls.Remove(_parentId, Date_Created.GetId());
     _controls.Remove(_parentId, Time_Created.GetId());
     _controls.Remove(_parentId, Last_Displayed_Date.GetId());
     _controls.Remove(_parentId, Last_Displayed_Time.GetId());
 }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["DoctorGUID"] == null)
         {
             Util.ShowMessage("用户登录超时,请重新登录!", "../Login.aspx");
             Response.End();
         }
         else
         {
             SearchTB.Focus();
             MyDataBind();
         }
     }
 }
Esempio n. 8
0
        private void CreateButton_Click(object sender, EventArgs e)
        {
            if (_messages.Add())
            {
                if (!_messages.SaveMessages())
                {
                    MessageBox.Show("Unable to save some or all messages.", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                ClearMessageDetails();
                ToggleButtons(false, DASH);
                SearchTB.SetText(string.Empty);
                UpdateMessages();
                ClearMessageDisplay();
            }
        }
Esempio n. 9
0
        // searches for the specified image and sets it to selected if exists
        private void SearchImgBtn_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(SearchTB.Text))
            {
                int target = Searcher.ImageSearch(SearchTB.Text, selectedGallery.Images);

                if (target >= 0)
                {
                    // load img
                    ImageGallery.ClearSelection();
                    ImageGallery.CurrentCell = ImageGallery.Rows[target].Cells[0];
                    //ImageGallery.Rows[target].Selected = true;
                }
            }

            SearchTB.Clear();
        }
 private TextBox Focused()
 {
     if (NameTb.Focus())
     {
         return(NameTb);
     }
     else if (ValueTb.Focus())
     {
         return(ValueTb);
     }
     else if (DescriptionTb.Focus())
     {
         return(DescriptionTb);
     }
     else if (SearchTB.Focus())
     {
         return(SearchTB);
     }
     else
     {
         return(NameTb);
     }
 }
Esempio n. 11
0
 /// <summary>
 /// Updates the messages view
 /// </summary>
 public void UpdateMessagesView()
 {
     SearchTB.SetText(string.Empty);
     UpdateMessages();
     ToggleButtons(false, DASH);
 }
 private void SearchTB_MouseDown(object sender, MouseButtonEventArgs e)
 {
     SearchTB.Focusable  = true;
     SearchTB.CaretIndex = SearchTB.CaretIndex;
     SearchTB.Focus();
 }
Esempio n. 13
0
        // call it with: string repeatPassword = PromptDialog.Prompt("Repeat password", "Password confirm", inputType: PromptDialog.InputType.Password)

        // SedResult ret = SedWindow.Prompt();
        void SedWindow_Loaded(object sender, RoutedEventArgs e)
        {
            SearchTB.Focus();
        }
 private void EmptyButton_Click(object sender, RoutedEventArgs e)
 {
     SearchTB.Clear();
     PerformDictionaryPrint(_mainWindow.Serializer.TermList);
 }
 private void SearchTB_Leave(object sender, EventArgs e)
 {
     SearchTB.AddText(SearchPlaceholder);
 }
 private void SearchTB_Enter(object sender, EventArgs e)
 {
     SearchTB.RemoveText(SearchPlaceholder);
 }