예제 #1
0
        /// <summary>Allows the property grid drop down.</summary>
        /// <param name="context">The context for the type.</param>
        /// <param name="provider">The service provider.</param>
        /// <param name="value">The value that the object has.</param>
        /// <returns></returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var wfes = provider.GetService(
                typeof(IWindowsFormsEditorService)) as
                       IWindowsFormsEditorService;

            if (wfes == null)
            {
                if (value != null)
                {
                    return(value);
                }
            }
            var setKey = new SetKey((Key)value);

            if (wfes != null)
            {
                wfes.DropDownControl(setKey);
            }
            value = setKey.Key;

            return(value);
        }
예제 #2
0
파일: Key.cs 프로젝트: seven2966/data
        /// <summary>Allows the property grid drop down.</summary>
        /// <param name="context">The context for the type.</param>
        /// <param name="provider">The service provider.</param>
        /// <param name="value">The value that the object has.</param>
        /// <returns></returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var wfes = provider.GetService(
                typeof (IWindowsFormsEditorService)) as
                IWindowsFormsEditorService;

            if (wfes == null) if (value != null) return value;
            var setKey = new SetKey((Key) value);

            if (wfes != null) wfes.DropDownControl(setKey);
            value = setKey.Key;

            return value;
        }