Exemple #1
0
        private void RefreshDefines()
        {
            if (renderWindow == null)
                return;
            for (var i = 0; i < Controls.Count; i++)
            {
                if (Controls[i].Name.StartsWith("temp_") == false)
                    continue;
                Controls.RemoveAt(i);
                i--;
            }

            if (renderWindow.Renderer.Kernel == null)
                return;

            var y = 325;

            if (renderWindow.Renderer.Parameters != null)
            {
                var help = new TextBox();
                help.Multiline = true;
                help.Text = renderWindow.Renderer.Parameters.ControlsHelp;
                help.Name = "temp_h" + y;
                help.Enabled = false;
                help.Location = new Point(0, y);
                help.Size = help.GetPreferredSize(new Size(200, 23));
                Controls.Add(help);
                y += help.Height;
            }

            AddConfigOption(ref y, "OpenClOptions", StaticSettings.Fetch.OpenClOptions,
                s => StaticSettings.Fetch.OpenClOptions = s);
            AddConfigOption(ref y, "ScreenshotHeight", StaticSettings.Fetch.ScreenshotHeight.ToString(CultureInfo.InvariantCulture),
                s => int.TryParse(s, out StaticSettings.Fetch.ScreenshotHeight));
            AddConfigOption(ref y, "ScreenshotPartialRender", StaticSettings.Fetch.ScreenshotPartialRender.ToString(CultureInfo.InvariantCulture),
                s => int.TryParse(s, out StaticSettings.Fetch.ScreenshotPartialRender));
            AddConfigOption(ref y, "GifFramecount", StaticSettings.Fetch.GifFramecount.ToString(CultureInfo.InvariantCulture),
                s => int.TryParse(s, out StaticSettings.Fetch.GifFramecount));
            AddConfigOption(ref y, "GifFramerate", StaticSettings.Fetch.GifFramerate.ToString(CultureInfo.InvariantCulture),
                s => int.TryParse(s, out StaticSettings.Fetch.GifFramerate));
            AddConfigOption(ref y, "GifHeight", StaticSettings.Fetch.GifHeight.ToString(CultureInfo.InvariantCulture),
                s => int.TryParse(s, out StaticSettings.Fetch.GifHeight));

            foreach (var kvp in renderWindow.Renderer.Kernel.Options)
            {
                var kvp1 = kvp;
                AddConfigOption(ref y, kvp.Key, kvp.Value, s =>
                {
                    if (renderWindow.Renderer.Kernel == null)
                        return;
                    renderWindow.Renderer.Kernel.SetOption(kvp1.Key, s);
                });
            }
        }