//------------------------------------------------------------------------------------------------------
        public override object EditValue(
            System.ComponentModel.ITypeDescriptorContext context,
            IServiceProvider provider,
            object value)
        {
            if ((context != null) && (context.Instance != null) && (provider != null))
            {
                service =
                    (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(
                        typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

                if (service != null)
                {
                    if (context.Instance is MeasuringDeviceMainPower)
                    {
                        MeasuringPeriodMainPowerControl cntr =
                            new MeasuringPeriodMainPowerControl(TYPE_NGK_DEVICE.BI_MAIN_POWERED);
                        cntr.ValueChanged += new ValueChangedEventHandler(cntr_ValueChanged);
                        cntr.Value         = (UInt32)value;
                        service.DropDownControl(cntr);
                        value = cntr.Value;
                    }
                    else if (context.Instance is MeasuringDeviceBatteryPower)
                    {
                        MeasuringPeriodMainPowerControl cntr =
                            new MeasuringPeriodMainPowerControl(TYPE_NGK_DEVICE.BI_BATTERY_POWER);
                        cntr.ValueChanged += new ValueChangedEventHandler(cntr_ValueChanged);
                        cntr.Value         = (UInt32)value;
                        service.DropDownControl(cntr);
                        value = cntr.Value;
                    }
                    else
                    {
                        throw new InvalidOperationException(
                                  "Объект для которого вызывается редактор не яввляется устройством БИ");
                    }
                }
            }
            else
            {
                return(base.EditValue(context, provider, value));
            }
            return(value);
        }
        //------------------------------------------------------------------------------------------------------
        public override object EditValue(
            System.ComponentModel.ITypeDescriptorContext context, 
            IServiceProvider provider, 
            object value)
        {
            if ((context != null) && (context.Instance != null) && (provider != null))
            {
                service = 
                    (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(
                    typeof(System.Windows.Forms.Design.IWindowsFormsEditorService));

                if (service != null)
                {
                    if (context.Instance is MeasuringDeviceMainPower)
                    {
                        MeasuringPeriodMainPowerControl cntr =
                            new MeasuringPeriodMainPowerControl(TYPE_NGK_DEVICE.BI_MAIN_POWERED);
                        cntr.ValueChanged += new ValueChangedEventHandler(cntr_ValueChanged);
                        cntr.Value = (UInt32)value;
                        service.DropDownControl(cntr);
                        value = cntr.Value;
                    }
                    else if (context.Instance is MeasuringDeviceBatteryPower)
                    {
                        MeasuringPeriodMainPowerControl cntr =
                            new MeasuringPeriodMainPowerControl(TYPE_NGK_DEVICE.BI_BATTERY_POWER);
                        cntr.ValueChanged += new ValueChangedEventHandler(cntr_ValueChanged);
                        cntr.Value = (UInt32)value;
                        service.DropDownControl(cntr);
                        value = cntr.Value;
                    }
                    else
                    {
                        throw new InvalidOperationException(
                            "Объект для которого вызывается редактор не яввляется устройством БИ");
                    }
                }
            }
            else
            {
                return base.EditValue(context, provider, value);
            }
            return value;
        }