示例#1
0
        public SubstancesControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.inConstruction = true;

            this.comboBoxUserDef.Items.Add(UI.STR_ALL);
            this.comboBoxUserDef.Items.Add(UI.STR_USER_DEF_USER_DEF);
            this.comboBoxUserDef.Items.Add(UI.STR_USER_DEF_NOT_USER_DEF);
            this.comboBoxUserDef.SelectedIndex = 0;

            this.comboBoxTypes.Items.Add(UI.STR_ALL);
            this.comboBoxTypes.Items.Add(SubstancesControl.STR_SUBSTANCE_TYPE_INORGANIC);
            this.comboBoxTypes.Items.Add(SubstancesControl.STR_SUBSTANCE_TYPE_ORGANIC);
            this.comboBoxTypes.SelectedIndex = 0;

            this.substancesToShow = SubstancesToShow.All;
            this.PopulateSubstanceList();

            SubstanceCatalog.GetInstance().SubstanceAdded   += new SubstanceAddedEventHandler(SubstancesControl_SubstanceAdded);
            SubstanceCatalog.GetInstance().SubstanceChanged += new SubstanceChangedEventHandler(SubstancesControl_SubstanceChanged);
            SubstanceCatalog.GetInstance().SubstanceDeleted += new SubstanceDeletedEventHandler(SubstancesControl_SubstanceDeleted);

            this.inConstruction = false;
        }
示例#2
0
        internal void Initialization()
        {
            this.inConstruction = true;

            this.comboBoxUserDef.Items.Add(UI.STR_ALL);
            this.comboBoxUserDef.Items.Add(UI.STR_USER_DEF_USER_DEF);
            this.comboBoxUserDef.Items.Add(UI.STR_USER_DEF_NOT_USER_DEF);
            this.comboBoxUserDef.SelectedIndex = 0;

            this.comboBoxTypes.Items.Add(UI.STR_ALL);
            this.comboBoxTypes.Items.Add(SubstancesControl.STR_SUBSTANCE_TYPE_INORGANIC);
            this.comboBoxTypes.Items.Add(SubstancesControl.STR_SUBSTANCE_TYPE_ORGANIC);
            this.comboBoxTypes.SelectedIndex = 0;

            this.substancesToShow = SubstancesToShow.All;
            this.PopulateSubstanceList();

            SubstanceCatalog.GetInstance().SubstanceAdded   += new SubstanceAddedEventHandler(SubstancesControl_SubstanceAdded);
            SubstanceCatalog.GetInstance().SubstanceChanged += new SubstanceChangedEventHandler(SubstancesControl_SubstanceChanged);
            SubstanceCatalog.GetInstance().SubstanceDeleted += new SubstanceDeletedEventHandler(SubstancesControl_SubstanceDeleted);

            this.inConstruction = false;
        }