Пример #1
0
        protected override Boolean PatchFile(String fileName)
        {
            PatchFinder finder = UXThemePatchFinderFactory.Create(fileName);
            Patch       patch  = finder.GetPatchStatus();

            if (patch.CanPatch)
            {
                patch.ApplyPatch();

                Miscellaneous.CorrectPEChecksum(fileName);

                return(true);
            }
            else
            {
                File.Delete(fileName);

                String reason = "";
                foreach (PatchEntry entry in patch.Entries)
                {
                    reason += entry.Status + "; ";
                }

                Package.Log.Add(LogSeverity.Warning, "Did not UxTheme Patch: " + fileName + " because \"" + reason + "\", deleted working file");

                return(false);
            }
        }
Пример #2
0
        public WeatherForecast PatchForecast(Patch <WeatherForecast> input)
        {
            var target = new WeatherForecast()
            {
                Date = DateTime.UtcNow, Summary = "Sample weather forecast", TemperatureC = 24
            };
            var result = input.ApplyPatch(target);

            return(result);
        }
Пример #3
0
        public CitiesData PatchCities(Patch <CitiesData> input)
        {
            var target = new CitiesData()
            {
                Cities = new Dictionary <string, string>()
                {
                    { "Frankfurt", "Germany" }, { "New York", "US" }, { "London", "UK" }
                }
            };
            var result = input.ApplyPatch(target);

            return(result);
        }
Пример #4
0
    public CitiesData PatchCities(Patch <CitiesData> input)
    {
        var result = input.ApplyPatch(_targetCities);

        return(result);
    }
Пример #5
0
    public WeatherForecast PatchForecast(Patch <WeatherForecast> input)
    {
        var result = input.ApplyPatch(_targetWeather);

        return(result);
    }