コード例 #1
0
        public void ConfigSaveSuccess()
        {
            var manager = new JsonConfigurationProvider(_validFilePath);

            manager.LoadFromSource();

            var actual   = manager.GetConfig();
            var expected = TestDataHolder.ProfileConfigExample2;

            actual.CallbackDuration   = expected.CallbackDuration;
            actual.HookedCoordinateX  = expected.HookedCoordinateX;
            actual.HookedCoordinateY  = expected.HookedCoordinateY;
            actual.HookedKeyCode      = expected.HookedKeyCode;
            actual.HookedRgbColorCode = expected.HookedRgbColorCode;

            manager.Save();
            manager.LoadFromSource();
            actual = manager.GetConfig();

            Assert.AreEqual(expected, actual);

            actual.CallbackDuration   = TestDataHolder.ProfileConfigExample1.CallbackDuration;
            actual.HookedCoordinateX  = TestDataHolder.ProfileConfigExample1.HookedCoordinateX;
            actual.HookedCoordinateY  = TestDataHolder.ProfileConfigExample1.HookedCoordinateY;
            actual.HookedKeyCode      = TestDataHolder.ProfileConfigExample1.HookedKeyCode;
            actual.HookedRgbColorCode = TestDataHolder.ProfileConfigExample1.HookedRgbColorCode;

            manager.Save();
        }
コード例 #2
0
        public void ConfigLoadSuccess()
        {
            var manager = new JsonConfigurationProvider(_validFilePath);

            manager.LoadFromSource();

            var actual   = manager.GetConfig();
            var expected = TestDataHolder.ProfileConfigExample1;

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            string configPath = GetConfigPath();
            var configProvider = new JsonConfigurationProvider<FileToSyncItemConfiguration>(configPath);
            var configurationWrapper = configProvider.GetConfig();

            if (configurationWrapper != null)
            {
                var serializationConfig = configurationWrapper.SerializationManagerConfig;
                foreach (FileToSyncItemConfiguration configuration in configurationWrapper.SynchronizationConfigs)
                {
                    var fileToSyncItemConverter = new FileToSyncItemConverter(configuration, serializationConfig);
                    fileToSyncItemConverter.Convert();
                }
            }
        }
コード例 #4
0
        static void Main(string[] args)
        {
            string configPath           = GetConfigPath();
            var    configProvider       = new JsonConfigurationProvider <FileToSyncItemConfiguration>(configPath);
            var    configurationWrapper = configProvider.GetConfig();

            if (configurationWrapper != null)
            {
                var serializationConfig = configurationWrapper.SerializationManagerConfig;
                foreach (FileToSyncItemConfiguration configuration in configurationWrapper.SynchronizationConfigs)
                {
                    var fileToSyncItemConverter = new FileToSyncItemConverter(configuration, serializationConfig);
                    fileToSyncItemConverter.Convert();
                }
            }
        }