Automatak.Simulator.DNP3.DefaultOutstationPlugin.OutstationForm.comboBoxTypes_SelectedIndexChanged C# (CSharp) Method

comboBoxTypes_SelectedIndexChanged() private method

private comboBoxTypes_SelectedIndexChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        void comboBoxTypes_SelectedIndexChanged(object sender, EventArgs e)
        {
            var index = this.comboBoxTypes.SelectedIndex;
            if(Enum.IsDefined(typeof(MeasType), index))
            {
                MeasType type = (MeasType) Enum.ToObject(typeof(MeasType), index);
                var collection = cache.GetCollection(type);
                if (collection != null)
                {
                    if (activeCollection != null)
                    {
                        activeCollection.RemoveObserver(this.measurementView);
                    }

                    activeCollection = collection;

                    collection.AddObserver(this.measurementView);
                }
            }
            this.CheckState();
        }