Esempio n. 1
0
        // Displays the UI for value selection. 
        // Para ver en un User control edSvc.DropDownControl(styleControl);
        // Para ver en un formulario edSvc.ShowDialog(styleForm);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {

            
            // Return the value if the value is not of type Int32, Double and Single.
            //if (value.GetType() != typeof(IFwkCellStyle))
            //    return value;

            // Uses the IWindowsFormsEditorService to display a 
            // drop-down UI in the Properties window.
            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            if (edSvc != null)
            {
                // Display an angle selection control and retrieve the value.
                //StyleControl styleControl = new StyleControl((GridProperties)value);
                //edSvc.DropDownControl(styleControl);
                FwkGridStyleForm wStyleForm = new FwkGridStyleForm((GridProperties)value);
                edSvc.ShowDialog(wStyleForm);
                // Return the value in the appropraite data format.
                //if (value.GetType() == typeof(IFwkCellStyle))
                return wStyleForm.GridProperties;
                
            }
            
            return value;

        }
Esempio n. 2
0
        // Displays the UI for value selection.
        // Para ver en un User control edSvc.DropDownControl(styleControl);
        // Para ver en un formulario edSvc.ShowDialog(styleForm);
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            // Return the value if the value is not of type Int32, Double and Single.
            //if (value.GetType() != typeof(IFwkCellStyle))
            //    return value;

            // Uses the IWindowsFormsEditorService to display a
            // drop-down UI in the Properties window.
            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc != null)
            {
                // Display an angle selection control and retrieve the value.
                //StyleControl styleControl = new StyleControl((GridProperties)value);
                //edSvc.DropDownControl(styleControl);
                FwkGridStyleForm wStyleForm = new FwkGridStyleForm((GridProperties)value);
                edSvc.ShowDialog(wStyleForm);
                // Return the value in the appropraite data format.
                //if (value.GetType() == typeof(IFwkCellStyle))
                return(wStyleForm.GridProperties);
            }

            return(value);
        }