public InfoWindow() { InitializeComponent(); VerLabel.Text = ReturnDriverAssemblyVersion( "OmniConverter", "CR", new int[] { Converter.Major, Converter.Minor, Converter.Build, 0 } ); BASSVer.Text = ReturnDriverAssemblyVersion( null, "U", new int[] { BASS.FileMajorPart, BASS.FileMinorPart, BASS.FileBuildPart, BASS.FilePrivatePart } ); BASSMIDIVer.Text = ReturnDriverAssemblyVersion( null, "U", new int[] { BASSMIDI.FileMajorPart, BASSMIDI.FileMinorPart, BASSMIDI.FileBuildPart, BASSMIDI.FilePrivatePart } ); CopyrightLabel.Text = String.Format(CopyrightLabel.Text, DateTime.Today.Year); CurBranch.Text = UpdateSystem.GetCurrentBranch(); CurBranch.ForeColor = UpdateSystem.GetCurrentBranchColor(); BranchToolTip.SetToolTip(CurBranch, UpdateSystem.GetCurrentBranchToolTip()); if (Properties.Settings.Default.PreRelease) { VerLabel.Text += " (PR)"; } // Date check :^) OCBigLogo.Image = IconSystem.GetResizedIcon(Properties.Resources.OCLogo, OCBigLogo.Width, OCBigLogo.Height); GitHubPage.Cursor = Program.SystemHandCursor; GitHubPage.Image = IconSystem.GetResizedIcon(Properties.Resources.Octocat, GitHubPage.Width, GitHubPage.Height); OMLicense.Cursor = Program.SystemHandCursor; OMLicense.Image = IconSystem.GetResizedIcon(Properties.Resources.License, OMLicense.Width, OMLicense.Height); WinName.Text = String.Format("{0}", OSInfo.Name.Replace("Microsoft ", "")); RAMAmount.Text = DataCheck.BytesToHumanReadableSize(Convert.ToUInt64((new ComputerInfo()).TotalPhysicalMemory)); switch (Environment.OSVersion.Version.Major) { case 10: WinVer.Text = String.Format( "Version {0} ({1})\nRelease {2}, Revision {3}", WVerKey.GetValue("ReleaseId", 0).ToString(), Environment.Is64BitOperatingSystem ? "64-bit" : "32-bit", Environment.OSVersion.Version.Build, WVerKey.GetValue("UBR", 0).ToString() ); break; case 6: if (Environment.OSVersion.Version.Minor > 1) { WinVer.Text = String.Format( "Version {0}.{1}\nBuild {2}", Environment.OSVersion.Version.Major, Environment.OSVersion.Version.Minor, Environment.OSVersion.Version.Build ); } else { if (Int32.Parse(Regex.Match(Environment.OSVersion.ServicePack, @"\d+").Value, NumberFormatInfo.InvariantInfo) > 0) { WinVer.Text = String.Format("{0}.{1}\nBuild {2}, Service Pack {3}", Environment.OSVersion.Version.Major, Environment.OSVersion.Version.Minor, Environment.OSVersion.Version.Build, Environment.OSVersion.ServicePack); } else { WinVer.Text = String.Format("{0}.{1}\nBuild {2}", Environment.OSVersion.Version.Major, Environment.OSVersion.Version.Minor, Environment.OSVersion.Version.Build); } } break; } }
private void GetSelectedMIDIInfo() { Boolean AtLeastOne = MIDIQueue.SelectedItems.Count > 0, MultiSelect = MIDIQueue.SelectedItems.Count > 1, TooMany = MIDIQueue.SelectedItems.Count > 4; TMIDIs.Text = String.Format("Total MIDIs in queue: {0}", MIDIQueue.Items.Count.ToString("N0", new CultureInfo("is-IS"))); Debug.PrintToConsole("ok", "GetSelectedMIDIInfo() called."); while (AtLeastOne) { String FN = "", FP = "", NC = "", TL = "", T = "", S = "", Sep = ", "; TimeSpan L; if (MultiSelect) { Int32 I = 0; if (TooMany) { break; } foreach (MIDI MFile in MIDIQueue.SelectedItems) { Boolean NMT = I < 1; L = MFile.TimeLength; FN += String.Format("{0}{1}", NMT ? "" : Sep, MFile.Name); FP += String.Format("{0}{1}", NMT ? "" : Sep, MFile.Path); NC += String.Format("{0}{1}", NMT ? "" : Sep, MFile.NoteCount.ToString("N0", new CultureInfo("is-IS"))); TL += String.Format("{0}{1}:{2}.{3}", NMT ? "" : Sep, L.Minutes, L.Seconds.ToString().PadLeft(2, '0'), L.Milliseconds.ToString().PadLeft(3, '0')); T += String.Format("{0}{1}", NMT ? "" : Sep, MFile.Tracks.ToString("N0", new CultureInfo("is-IS"))); S += String.Format("{0}{1}", NMT ? "" : Sep, DataCheck.BytesToHumanReadableSize(MFile.Size)); I++; } } else { L = ((MIDI)MIDIQueue.SelectedItem).TimeLength; FN = String.Format("{0}", ((MIDI)MIDIQueue.SelectedItem).Name); FP = String.Format("{0}", ((MIDI)MIDIQueue.SelectedItem).Path); NC = String.Format("{0}", ((MIDI)MIDIQueue.SelectedItem).NoteCount.ToString("N0", new CultureInfo("is-IS"))); TL = String.Format("{0}:{1}.{2}", L.Minutes, L.Seconds.ToString().PadLeft(2, '0'), L.Milliseconds.ToString().PadLeft(3, '0')); T = String.Format("{0}", ((MIDI)MIDIQueue.SelectedItem).Tracks.ToString("N0", new CultureInfo("is-IS"))); S = String.Format("{0}", DataCheck.BytesToHumanReadableSize(((MIDI)MIDIQueue.SelectedItem).Size)); } FNVal.Text = FN; FPVal.Text = FP; NCVal.Text = NC; TLVal.Text = TL; TVal.Text = T; SVal.Text = S; return; } FNVal.Text = TooMany ? "Too many MIDIs selected" : "No MIDI selected"; FPVal.Text = TooMany ? "Too many MIDIs selected" : "No MIDI selected"; NCVal.Text = "-"; TLVal.Text = "-:--.---"; TVal.Text = "-"; SVal.Text = "-.-- -"; }