示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RecordsCounterFilterWizard"/> class.
 /// </summary>
 /// <param name="rc">The rc.</param>
 /// <param name="entityName">Name of the entity.</param>
 public RecordsCounterFilterWizard(RecordsCounter rc, string entityName)
 {
     InitializeComponent();
     this.entity          = entityName;
     this.rc              = rc;
     labelEntityName.Text = "Filter for entity: " + entity;
     rl = rc.selectedEntities.Find(se => se.Entity == entity);
     xmlEditor1.Text = rl.Filter;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RecordsCounterFilterWizard"/> class.
 /// </summary>
 /// <param name="rc">The rc.</param>
 /// <param name="entityName">Name of the entity.</param>
 public RecordsCounterFilterWizard(RecordsCounter rc, string entityName)
 {
     InitializeComponent();
     this.entity = entityName;
     this.rc = rc;
     labelEntityName.Text = "Filter for entity: " + entity;
     rl = rc.selectedEntities.Find(se => se.Entity == entity);
     xmlEditor1.Text = rl.Filter;
 }
示例#3
0
        /// <summary>
        /// Handles the SelectedIndexChanged event of the checkedListBoxEntities control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void checkedListBoxEntities_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Remove all the combobox and labels
            ArrayList list = new ArrayList(panelSelectedEntities.Controls);

            foreach (Control c in list)
            {
                panelSelectedEntities.Controls.Remove(c);
                selectedEntities = new List <RecordLine>();
            }

            if (checkedListBoxEntities.Items.Count == 0)
            {
                return;
            }

            int           transportOrderYLocation = 7;
            int           orderCpt        = 1;
            List <string> treatedEntities = new List <string>();

            foreach (string checkedEntity in checkedListBoxEntities.CheckedItems)
            {
                RecordLine temp = allEntities.Find(t => t.Entity == checkedEntity);
                selectedEntities.Add(temp);
                if (treatedEntities.Contains(checkedEntity))
                {
                    continue;
                }
                System.Windows.Forms.Label label = new System.Windows.Forms.Label();
                label.Name     = "entity_" + checkedEntity;
                label.Text     = checkedEntity;
                label.Size     = new System.Drawing.Size(248, 23);
                label.Location = new System.Drawing.Point(0, transportOrderYLocation + 4);
                panelSelectedEntities.Controls.Add(label);

                Button setupIgnoredAttributes = new Button();
                setupIgnoredAttributes.Name     = "button_" + checkedEntity;
                setupIgnoredAttributes.Text     = "...";
                setupIgnoredAttributes.Tag      = checkedEntity;
                setupIgnoredAttributes.Size     = new System.Drawing.Size(25, 23);
                setupIgnoredAttributes.Location = new System.Drawing.Point(250, transportOrderYLocation - 1);
                setupIgnoredAttributes.Click   += new System.EventHandler(showFilterSetupWizard);
                panelSelectedEntities.Controls.Add(setupIgnoredAttributes);

                orderCpt++;
                transportOrderYLocation += 25;
            }
        }