Esempio n. 1
0
        private void AddCameraProperty(string key, string text, int top)
        {
            if (!cameraProperties.ContainsKey(key))
            {
                return;
            }

            CameraProperty property = cameraProperties[key];

            AbstractCameraPropertyView control = null;

            switch (property.Representation)
            {
            case CameraPropertyRepresentation.LinearSlider:
                control = new CameraPropertyViewLinear(property, text, null);
                break;

            case CameraPropertyRepresentation.LogarithmicSlider:
                control = new CameraPropertyViewLogarithmic(property, text, null);
                break;

            case CameraPropertyRepresentation.Checkbox:
                control = new CameraPropertyViewCheckbox(property, text);
                break;

            default:
                break;
            }

            if (control == null)
            {
                return;
            }

            control.Tag           = key;
            control.ValueChanged += cpvCameraControl_ValueChanged;
            control.Left          = 20;
            control.Top           = top;
            gbProperties.Controls.Add(control);
            propertiesControls.Add(key, control);
        }
        private bool AddCameraProperty(string key, string text, Func <int, string> valueMapper, int top)
        {
            if (!cameraProperties.ContainsKey(key))
            {
                return(false);
            }

            CameraProperty property = cameraProperties[key];

            AbstractCameraPropertyView control = null;

            switch (property.Representation)
            {
            case CameraPropertyRepresentation.LinearSlider:
                control = new CameraPropertyViewLinear(property, text, valueMapper);
                break;

            case CameraPropertyRepresentation.LogarithmicSlider:
                control = new CameraPropertyViewLogarithmic(property, text, valueMapper);
                break;

            default:
                break;
            }

            if (control == null)
            {
                return(false);
            }

            control.Tag           = key;
            control.ValueChanged += cpvCameraControl_ValueChanged;
            control.Left          = 20;
            control.Top           = top;
            groupBox1.Controls.Add(control);

            return(true);
        }