コード例 #1
0
ファイル: FillEditor.cs プロジェクト: garryforreg/iview-scada
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if ((context != null) && (provider != null))
            {
                // Access the Property Browser's UI display service
                IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (editorService != null)
                {
                    // Create an instance of the UI editor form
                    FillForm modalEditor = new FillForm();

                    // Pass the UI editor dialog the current property value
                    modalEditor.Behavior = value as FillBehavior;

                    // Display the UI editor dialog
                    if (editorService.ShowDialog(modalEditor) == DialogResult.OK)
                    {
                        // Return the new property value from the UI editor form
                        return modalEditor.Behavior;
                    }
                }
            }
            return base.EditValue(context, provider, value);
        }
コード例 #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if ((context != null) && (provider != null))
            {
                // Access the Property Browser's UI display service
                IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (editorService != null)
                {
                    // Create an instance of the UI editor form
                    FillForm modalEditor = new FillForm();

                    // Pass the UI editor dialog the current property value
                    modalEditor.Behavior = value as FillBehavior;

                    // Display the UI editor dialog
                    if (editorService.ShowDialog(modalEditor) == DialogResult.OK)
                    {
                        // Return the new property value from the UI editor form
                        return(modalEditor.Behavior);
                    }
                }
            }
            return(base.EditValue(context, provider, value));
        }