コード例 #1
0
        public NvPreset(NvPreset preset) : this()
        {
            id = GetNewId();

            primaryDisplay = preset.primaryDisplay;
            displayName    = preset.displayName;

            var colorData = preset.colorData;

            this.colorData = new ColorData(colorData.ColorFormat, dynamicRange: colorData.DynamicRange, colorDepth: colorData.ColorDepth, colorSelectionPolicy: ColorDataSelectionPolicy.User);
            applyColorData = preset.applyColorData;

            applyHDR            = preset.applyHDR;
            HDREnabled          = preset.HDREnabled;
            toggleHDR           = preset.toggleHDR;
            applyDithering      = preset.applyDithering;
            ditheringEnabled    = preset.ditheringEnabled;
            applyRefreshRate    = preset.applyRefreshRate;
            refreshRate         = preset.refreshRate;
            applyResolution     = preset.applyResolution;
            resolutionWidth     = preset.resolutionWidth;
            resolutionHeight    = preset.resolutionHeight;
            applyDriverSettings = preset.applyDriverSettings;
            driverSettings      = new Dictionary <uint, uint>(preset.driverSettings);
        }
コード例 #2
0
        public override ColorData ReadJson(JsonReader reader, Type objectType, ColorData existingValue, bool hasExistingValue, JsonSerializer serializer)
        {
            var result = new Dictionary <string, object>();

            if (reader.TokenType == JsonToken.StartObject)
            {
                reader.Read();
                while (reader.TokenType == JsonToken.PropertyName)
                {
                    var propertyName = reader.Value;

                    reader.Read();
                    var value = reader.Value;

                    result.Add(propertyName.ToString(), value);

                    reader.Read();
                }
            }

            return(NvPreset.GenerateColorData(result));
        }
コード例 #3
0
        public NvPreset Clone()
        {
            var preset = new NvPreset(this);

            return(preset);
        }