示例#1
0
        private void radio_CheckedChanged(object sender, EventArgs e)
        {
            if (!lockIt)
            {
                lockIt = true;

                foreach (RadioButton rbtn in radioButtons)
                {
                    rbtn.Checked = false;
                }
                RadioButton current = sender as RadioButton;
                current.Checked = true;
                currentStore    = current.Tag as Dictionary <string, Autodesk.Revit.DB.ElementId>;
                var registrationsList = currentStore.Keys.ToList(); //return original data from Store

                filtersList.BeginUpdate();
                filtersList.Items.Clear();
                filtersList.Items.AddRange(registrationsList.ToArray());
                filtersList.EndUpdate();
                totalLbl.Text = registrationsList.Count().ToString();
                totalLbl.Update();


                SrchBox.Text      = "Contains ..";
                SrchBox.Font      = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                SrchBox.ForeColor = System.Drawing.SystemColors.InactiveCaption;
                SrchBox.Update();

                lockIt = false;
                return;
            }
        }
示例#2
0
        /// <summary>
        /// Search filter the Filters
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SrchBox_TextChanged(object sender, EventArgs e)
        {
            if (string.Equals("Contains ..", SrchBox.Text))
            {
                SrchBox.Clear();
            }
            if (!string.Equals("Contains ..", SrchBox.Text))
            {
                SrchBox.Font      = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                SrchBox.ForeColor = System.Drawing.SystemColors.WindowText;
                var registrationsList = currentStore.Keys.ToList(); //return original data from Store

                filtersList.BeginUpdate();
                filtersList.Items.Clear();

                if (!string.IsNullOrEmpty(SrchBox.Text))
                {
                    foreach (string str in registrationsList)
                    {
                        if (str.IndexOf(SrchBox.Text, StringComparison.InvariantCultureIgnoreCase) >= 0)
                        {
                            filtersList.Items.Add(str);
                        }
                    }
                }
                else
                {
                    filtersList.Items.AddRange(registrationsList.ToArray()); //there is no any filter string, so add all data we have in Store
                }
                filtersList.EndUpdate();
                totalLbl.Text = filtersList.Items.Count.ToString();
                totalLbl.Update();
            }
        }
示例#3
0
 private void ClearBtn_Click(object sender, EventArgs e)
 {
     SrchBox.Clear();
     Load_Fine_View();
     if (SrchAllFinesGrp.Visible == true)
     {
         SrchAllTxtBox.Clear();
         SrchAllFinesGrp.Hide();
     }
     Load_Fine_View();
 }