コード例 #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            // get PreValues, load them into the controls.
            var options = this.GetPreValueOptions <YTSV_Options>();

            // if the options are null, then load the defaults
            if (options == null)
            {
                options = new YTSV_Options(true);
            }

            // set the values
            this.cbEnablePreview.Checked = options.EnablePreview;
            this.txtPreviewHeight.Text   = options.PreviewHeight.ToString();
            this.txtPreviewWidth.Text    = options.PreviewWidth.ToString();
            this.cbSaveVideoData.Checked = options.SaveVideoData;
        }
コード例 #2
0
        public override void Save()
        {
            // prep the option values
            int previewHeight = 240;
            int previewWidth  = 320;

            int.TryParse(this.txtPreviewHeight.Text, out previewHeight);
            int.TryParse(this.txtPreviewWidth.Text, out previewWidth);

            // set the options
            var options = new YTSV_Options()
            {
                EnablePreview = this.cbEnablePreview.Checked,
                PreviewHeight = previewHeight,
                PreviewWidth  = previewWidth,
                SaveVideoData = this.cbSaveVideoData.Checked
            };

            // save the options as JSON
            this.SaveAsJson(options);
        }