CodeTV.VideoEditor.EditValue C# (CSharp) Method

EditValue() public method

public EditValue ( ITypeDescriptorContext context, System provider, object value ) : object
context ITypeDescriptorContext
provider System
value object
return object
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && provider != null)
            {
                ChannelTV channelTV = context.Instance as ChannelTV;
                GraphBuilderBase graphBuilder = MainForm.Form.GraphBuilder;
                if (graphBuilder != null)
                {
                    if (MessageBox.Show("Get current values?", "Video", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {
                        channelTV.VideoZoomMode = graphBuilder.VideoZoomMode;
                        channelTV.VideoZoom = graphBuilder.VideoZoom;
                        channelTV.VideoKeepAspectRatio = graphBuilder.VideoKeepAspectRatio;
                        channelTV.VideoAspectRatioFactor = graphBuilder.VideoAspectRatioFactor;
                        channelTV.VideoOffset = graphBuilder.VideoOffset;
                    }
                }
                else
                {
                    this.useTheBaseEditor = true;
                    return base.EditValue(context, provider, value);
                }
                switch (context.PropertyDescriptor.Name)
                {
                    case "VideoZoomMode":
                        return channelTV.VideoZoomMode;
                    case "VideoZoom":
                        return channelTV.VideoZoom;
                    case "VideoKeepAspectRatio":
                        return channelTV.VideoKeepAspectRatio;
                    case "VideoAspectRatioFactor":
                        return channelTV.VideoAspectRatioFactor;
                    case "VideoOffset":
                        return channelTV.VideoOffset;
                }
            }

            return null;
        }