public OperaPatch(OperaVersion startVersion, OperaVersion endVersion, int speeddialLayoutJs, int startPageHtml, int preinstalledSpeeddialsJs, int speeddialSuggestionsJs, int toolsCss, int filterCss, ExePatch exePatch) { StartVersion = startVersion; EndVersion = endVersion; SpeeddialLayoutJs = speeddialLayoutJs; StartPageHtml = startPageHtml; PreinstalledSpeeddialsJs = preinstalledSpeeddialsJs; SpeeddialSuggestionsJs = speeddialSuggestionsJs; ToolsCss = toolsCss; FilterCss = filterCss; ExePatch = exePatch; }
public static OperaPatch Find(OperaVersion version) { for (int n = 0; n < Patches.Length; n++) { OperaPatch patch = Patches[n]; if (patch.Match(version)) { return(patch); } } return(null); }
private static string FindLatestOperaPak(string baseFolder) { string[] folders = Directory.GetDirectories(baseFolder); string result = null; OperaVersion resultVersion = null; foreach (string folder in folders) { string fileName = Path.Combine(folder, "opera.pak"); OperaVersion version; if (!File.Exists(fileName) || !OperaVersion.TryParse(Path.GetFileName(folder), out version)) { continue; } if (resultVersion == null || version > resultVersion) { result = fileName; resultVersion = version; } } return(result); }
private static OperaVersion GetOperaPakVersion(string fileName) { return(OperaVersion.Parse(Path.GetFileName(Path.GetDirectoryName(fileName)))); }
public bool Match(OperaVersion version) { return(version >= StartVersion && version <= EndVersion); }
public OperaPatch(string startVersion, string endVersion, int speeddialLayoutJs, int startPageHtml, int preinstalledSpeeddialsJs, int speeddialSuggestionsJs, int toolsCss, int filterCss, ExePatch exePatch) : this(OperaVersion.Parse(startVersion), OperaVersion.Parse(endVersion), speeddialLayoutJs, startPageHtml, preinstalledSpeeddialsJs, speeddialSuggestionsJs, toolsCss, filterCss, exePatch) { }