Пример #1
0
        private static void PgrdStudiesEditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
        {
            switch (e.Item.Name)
            {
            case "Color":
            {
                PropertyGridColorEditor gridColorEditor = e.Editor as PropertyGridColorEditor;

                if (gridColorEditor != null)
                {
                    RadColorBoxElement colorBoxElement = ((PropertyGridColorEditor)e.Editor).EditorElement as RadColorBoxElement;

                    if (colorBoxElement != null)
                    {
                        colorBoxElement.ColorDialog.ColorDialogForm.ShowWebColors    = false;
                        colorBoxElement.ColorDialog.ColorDialogForm.ShowSystemColors = false;
                        colorBoxElement.ColorDialog.ColorDialogForm.ActiveMode       = ColorPickerActiveMode.Basic;
                    }
                }

                return;
            }
            }

            PropertyGridSpinEditor editorGridSpinEditor = e.Editor as PropertyGridSpinEditor;

            if (editorGridSpinEditor == null)
            {
                return;
            }

            BaseSpinEditorElement element = editorGridSpinEditor.EditorElement as BaseSpinEditorElement;

            switch (e.Item.Name)
            {
            case "LineThickness":
                if (element != null)
                {
                    element.MinValue = 0;
                    element.MaxValue = 10;
                }
                break;
            }
        }
Пример #2
0
        private void pgrdStudy_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
        {
            PropertyGridColorEditor gridColorEditor = e.Editor as PropertyGridColorEditor;

            if (gridColorEditor != null)
            {
                RadColorBoxElement colorBoxElement = ((PropertyGridColorEditor)e.Editor).EditorElement as RadColorBoxElement;

                if (colorBoxElement != null)
                {
                    //colorBoxElement.ColorDialog.ColorDialogForm.ShowSystemColors = false;
                    //colorBoxElement.ColorDialog.ColorDialogForm.ShowWebColors = false;
                    colorBoxElement.ColorDialog.ColorDialogForm.ActiveMode = Telerik.WinControls.ColorPickerActiveMode.Basic;
                }
            }

            PropertyGridSpinEditor editor = e.Editor as PropertyGridSpinEditor;

            if (editor == null)
            {
                return;
            }

            BaseSpinEditorElement element = editor.EditorElement as BaseSpinEditorElement;

            switch (e.Item.Name)
            {
            case "LineThicknessValue":
            case "LineThicknessAverage":
            case "LineThicknessParameters":
            case "LineThickness2Parameters":
                if (element != null)
                {
                    element.MinValue = 1;
                    element.MaxValue = 10;
                }
                break;

            case "ShortCycle":
            case "ShortTermParameters":
                if (element != null)
                {
                    element.MinValue = 1;
                    element.MaxValue = 999;
                }
                break;

            case "LongCycle":
            case "LongTermParameters":
                if (element != null)
                {
                    element.MinValue = 1;
                    element.MaxValue = 999;
                }
                break;

            case "Periods":
            case "PeriodsParameters":
                if (element != null)
                {
                    element.MinValue = 1;
                    element.MaxValue = 999;
                }
                break;
            }
        }