Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 private static OperaVersion GetOperaPakVersion(string fileName)
 {
     return(OperaVersion.Parse(Path.GetFileName(Path.GetDirectoryName(fileName))));
 }
Ejemplo n.º 5
0
 public bool Match(OperaVersion version)
 {
     return(version >= StartVersion && version <= EndVersion);
 }
Ejemplo n.º 6
0
 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)
 {
 }