private void btnSystemTypeFilter_Click(object sender, EventArgs e)
        {
            ReportSystemTypeFilterDlg reportSTFilterDlg = new ReportSystemTypeFilterDlg(allValidSystemType, checkedSystemType);

            if (reportSTFilterDlg.ShowDialog() == DialogResult.OK)
            {
                List <string> checkedItems = new List <string>();
                for (int ii = 0; ii < SystemCheckList.Items.Count; ++ii)
                {
                    if (SystemCheckList.GetItemChecked(ii))
                    {
                        String itemName = SystemCheckList.Items[ii].ToString();
                        checkedItems.Add(itemName);
                    }
                }
                SystemCheckList.Items.Clear();
                allElementItems.Clear();

                foreach (Autodesk.Revit.DB.BuiltInCategory categoryId in filterCategories)
                {
                    ICollection <Autodesk.Revit.DB.Element> founds = PressureLossReportHelper.instance.getCategoryElements(categoryId);
                    addItemsToCheckList(PressureLossReportHelper.instance, founds, checkedItems);
                }
            }
        }
 private void SystemCheckList_SelectedIndexChanged(object sender, EventArgs e)
 {
     for (int i = 0; i < SystemCheckList.Items.Count; i++)
     {
         if (SystemCheckList.GetItemChecked(i))
         {
             btnOK.Enabled = true;
             return;
         }
     }
     btnOK.Enabled = false;
 }
        private void btnInvert_Click(object sender, EventArgs e)
        {
            if (SystemCheckList.Items.Count < 1)
            {
                return;
            }
            bool bDisabled = true;

            for (int ii = 0; ii < SystemCheckList.Items.Count; ++ii)
            {
                SystemCheckList.SetItemChecked(ii, !SystemCheckList.GetItemChecked(ii));
                if (bDisabled && SystemCheckList.GetItemChecked(ii) == true)
                {
                    bDisabled = false;
                }
            }
            btnOK.Enabled = !bDisabled;
        }
 private void btnOK_Click(object sender, EventArgs e)
 {
     CheckedElements.Clear();
     for (int ii = 0; ii < SystemCheckList.Items.Count; ++ii)
     {
         if (SystemCheckList.GetItemChecked(ii))
         {
             CheckedElements.Insert(allElementItems[ii]);
         }
     }
     if (CheckedElements.Size == 0)
     {
         //UIHelperFunctions.postWarning(ReportResource.invalidSystemMsg, ReportResource.selectSystemsMsg);
         this.DialogResult = DialogResult.None;
     }
     else
     {
         this.DialogResult = DialogResult.OK;
     }
 }