Inheritance: System.EventArgs
        private void btnDone_Click(object sender, EventArgs e)
        {
            CheckedListBox.CheckedItemCollection selectedItems = this.chkListBox.CheckedItems;
            string[] items = new string[this.chkListBox.CheckedItems.Count];
            if (selectedItems.Count > 0)
            {
                //do something
                for (int i = 0; i < selectedItems.Count; i++)
                {
                    items[i] = selectedItems[i].ToString();
                }
            }

            //raise event back to controller
            ReduceEvents reduce = new ReduceEvents(items);
            this.doneFormEvent(sender,reduce);
        }
        private void btnDone_Click(object sender, EventArgs e)
        {
            CheckedListBox.CheckedItemCollection selectedItems = this.chkListBox.CheckedItems;
            string[] items = new string[this.chkListBox.CheckedItems.Count];
            if (selectedItems.Count > 0)
            {
                //do something
                for (int i = 0; i < selectedItems.Count; i++)
                {
                    items[i] = selectedItems[i].ToString();
                }
            }

            //raise event back to controller
            ReduceEvents reduce = new ReduceEvents(items);

            this.doneFormEvent(sender, reduce);
        }
        void formReduce_doneFormEvent(object sender, ReduceEvents e)
        {
            //user click the done button on the reduce form
            ISchematicBuilderRule              pIsbr;
            ISchematicBuilderRuleContainer     pIsbrc  = (ISchematicBuilderRuleContainer)m_pSDT;
            ISchematicBuilderRuleContainerEdit pIsbrce = (ISchematicBuilderRuleContainerEdit)pIsbrc;

            formReduce.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            string[] selectedItems = e.SelectedObjects;
            m_pSDS.DesignMode = true;
            foreach (string s in selectedItems)
            {
                //setup rule properties
                ISchematicNodeReductionRuleByPriority pRule = new SchematicNodeReductionRuleByPriorityClass();
                pRule.NodeDegreeConstraint = true;
                pRule.ReduceNodeDegree0    = true;
                pRule.ReduceNodeDegree2    = true;
                pRule.ReduceNodeDegree1    = false;
                pRule.ReduceNodeDegreeSup3 = false;

                //set the name and class to reduce
                ISchematicNodeReductionRule pNR = (ISchematicNodeReductionRule)pRule;
                pNR.Description   = "Remove " + s.ToString();
                pNR.NodeClassName = s.ToString();

                //add it to the template
                pIsbr = pIsbrce.AddSchematicBuilderRule();
                pIsbr.SchematicRule = (ISchematicRule)pRule;
            }

            //save and close
            m_pSDS.Save(ESRI.ArcGIS.esriSystem.esriArcGISVersion.esriArcGISVersion10, false);
            m_pSDS.DesignMode = false;
            formReduce.Cursor = System.Windows.Forms.Cursors.Default;
            formReduce.Close();
        }
		void formReduce_doneFormEvent(object sender, ReduceEvents e)
		{
			//user click the done button on the reduce form
			ISchematicBuilderRule pIsbr;
			ISchematicBuilderRuleContainer pIsbrc = (ISchematicBuilderRuleContainer)m_pSDT;
			ISchematicBuilderRuleContainerEdit pIsbrce = (ISchematicBuilderRuleContainerEdit)pIsbrc;

			formReduce.Cursor = System.Windows.Forms.Cursors.WaitCursor;
			string[] selectedItems = e.SelectedObjects;
			m_pSDS.DesignMode = true;
			foreach (string s in selectedItems)
			{
				//setup rule properties
				ISchematicNodeReductionRuleByPriority pRule = new SchematicNodeReductionRuleByPriorityClass();
				pRule.NodeDegreeConstraint = true;
				pRule.ReduceNodeDegree0 = true;
				pRule.ReduceNodeDegree2 = true;
				pRule.ReduceNodeDegree1 = false;
				pRule.ReduceNodeDegreeSup3 = false;

				//set the name and class to reduce
				ISchematicNodeReductionRule pNR = (ISchematicNodeReductionRule)pRule;
				pNR.Description = "Remove " + s.ToString();
				pNR.NodeClassName = s.ToString();

				//add it to the template
				pIsbr = pIsbrce.AddSchematicBuilderRule();
				pIsbr.SchematicRule = (ISchematicRule)pRule;
			}

			//save and close
			m_pSDS.Save(ESRI.ArcGIS.esriSystem.esriArcGISVersion.esriArcGISVersion10, false);
			m_pSDS.DesignMode = false;
			formReduce.Cursor = System.Windows.Forms.Cursors.Default;
			formReduce.Close();
		}