Exemplo n.º 1
0
        public static VideoDriverSettings GetDriverSettings(IOccuRecCameraController driver)
        {
            AllVideoDriverSettings allSet = GetCurrentSettings();
            VideoDriverSettings settings = allSet.Drivers.SingleOrDefault(x => x.DriverName == driver.DriverName);
            if (settings == null)
                settings = new VideoDriverSettings() { DriverName = driver.DriverName };

            return settings;
        }
Exemplo n.º 2
0
        public static void SetDriverSettings(IOccuRecCameraController driver)
        {
            AllVideoDriverSettings allSet = GetCurrentSettings();
            VideoDriverSettings settings = allSet.Drivers.SingleOrDefault(x => x.DriverName == driver.DriverName);
            if (settings == null)
            {
                settings = new VideoDriverSettings() {DriverName = driver.DriverName};
                allSet.Drivers.Add(settings);
            }

            VideoDriverSettings newSettings = (VideoDriverSettings) driver.Configuration;

            settings.PropertyNames.Clear();
            settings.PropertyValues.Clear();

            for (int i = 0; i < newSettings.PropertyNames.Count; i++)
            {
                settings.PropertyNames.Add(newSettings.PropertyNames[i]);
                settings.PropertyValues.Add(newSettings.PropertyValues[i]);
            }

            SaveCurrentSettings(allSet);
        }