/// <summary> /// Display a drop down when editing instead of the normal control, and allow the user to "grab" a /// new dynamic visibility extent. /// </summary> /// <param name="context"></param> /// <param name="provider"></param> /// <param name="value"></param> /// <returns></returns> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { _layer = context.Instance as ILayer; IWindowsFormsEditorService dialogProvider = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; DynamicVisibilityControl dvc = new DynamicVisibilityControl(dialogProvider, _layer); if (dialogProvider != null) dialogProvider.DropDownControl(dvc); if (_layer != null) _layer.Invalidate(); return dvc.UseDynamicVisibility; }
/// <summary> /// Display a drop down when editing instead of the normal control, and allow the user to "grab" a /// new dynamic visibility extent. /// </summary> /// <param name="context">The type descriptor context.</param> /// <param name="provider">The service provider.</param> /// <param name="value">Not used.</param> /// <returns>Returns whether or not to use the dynamic visibility.</returns> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { _layer = context?.Instance as ILayer; IWindowsFormsEditorService dialogProvider = provider?.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; DynamicVisibilityControl dvc = new DynamicVisibilityControl(dialogProvider, _layer); dialogProvider?.DropDownControl(dvc); _layer?.Invalidate(); return(dvc.UseDynamicVisibility); }