コード例 #1
0
        public List <string> GetAllDownloadables()
        {
            var extraFiles = new List <string>();

            var versionSpecificDownloads = VersionInfos.SelectMany(kvp =>
            {
                var patchDir = GetPatchDir(kvp.Key);

                extraFiles.Add(patchDir + GetVersionFilename());
                extraFiles.Add(patchDir + "ExePatch.dat");   // Subversion
                extraFiles.Add(patchDir + "NewPatcher.dat"); // a new Patcher executable

                var patches = kvp.Value.VersionsPatchable.Select(prevVersion => patchDir + GetPatchFilename(prevVersion, kvp.Key));

                return(patches);
            });

            if (!NewFormat)
            {
                // Add all patchnotes
                ushort latestVersion = VersionInfos.Keys.Max();
                for (ushort i = 0; i < latestVersion; i++)
                {
                    extraFiles.Add(GetNoticeFile(i));
                }
            }

            return(versionSpecificDownloads.Concat(extraFiles).Select(x => URL + x).ToList());
        }
コード例 #2
0
ファイル: VersionInfo.cs プロジェクト: vmanthena/barcoder
 public static VersionInfo FindSmallestVersionInfo(ErrorCorrectionLevel errorCorrectionLevel, EncodingMode encodingMode, int dataBits)
 {
     dataBits += 4; // Mode indicator
     foreach (VersionInfo versionInfo in VersionInfos.Where(x => x.ErrorCorrectionLevel == errorCorrectionLevel))
     {
         if ((versionInfo.TotalDataBytes() * 8) >= (dataBits + (int)versionInfo.CharCountBits(encodingMode)))
         {
             return(versionInfo);
         }
     }
     return(null);
 }
コード例 #3
0
 private void ExportContinueButton_Click(object sender, RoutedEventArgs e)
 {
     //find the one that is selected
     foreach (RadioButton button in ExportSelectVersionPanel.Children)
     {
         if ((bool)button.IsChecked)
         {
             SelectedVersionInfo = (VersionInfos)button.Tag;
             DialogResult        = true;
             Close();
         }
     }
 }
コード例 #4
0
        private void RelhaxWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Logging.Debug("loading supported_clients from zip file");

            //parse each online folder to list type string
            VersionInfosList.Clear();
            string      xmlString        = FileUtils.GetStringFromZip(Settings.ManagerInfoZipfile, Settings.SupportedClients);
            XmlNodeList supportedClients = XmlUtils.GetXmlNodesFromXPath(xmlString, "//versions/version", Settings.SupportedClients);

            VersionInfosList = new List <VersionInfos>();
            foreach (XmlNode node in supportedClients)
            {
                VersionInfos newVersionInfo = new VersionInfos()
                {
                    WoTOnlineFolderVersion = node.Attributes["folder"].Value,
                    WoTClientVersion       = node.InnerText
                };
                VersionInfosList.Add(newVersionInfo);
            }

            //load them into the list with tag holding info
            ExportSelectVersionPanel.Children.Clear();
            foreach (VersionInfos versionInfo in VersionInfosList)
            {
                RadioButton button = new RadioButton()
                {
                    Tag     = versionInfo,
                    Content = string.Format("{0} = {1}, {2} = {3}", Translations.GetTranslatedString("ExportModeMajorVersion"), versionInfo.WoTOnlineFolderVersion,
                                            Translations.GetTranslatedString("ExportModeMinorVersion"), versionInfo.WoTClientVersion)
                };
                ExportSelectVersionPanel.Children.Add(button);
            }

            //select the first one
            (ExportSelectVersionPanel.Children[0] as RadioButton).IsChecked = true;
        }