예제 #1
0
        private void UpdateVersionsComboBox()
        {
            Versions.Clear();
            InstallationVersionSelect.ItemsSource = null;
            foreach (var entry in LauncherModel.Default.Versions)
            {
                Versions.Add(BLVersion.Convert(entry));
            }
            GetManualComboBoxEntries();
            InstallationVersionSelect.ItemsSource = Versions;
            var view = CollectionViewSource.GetDefaultView(InstallationVersionSelect.ItemsSource) as CollectionView;

            view.Filter = Filter_VersionList;
            InstallationVersionSelect.SelectedIndex = 0;
        }
        public bool Filter_VersionList(object obj)
        {
            BLVersion v = BLVersion.Convert(obj as MCVersion);

            if (v != null && v.IsInstalled)
            {
                if (!Properties.LauncherSettings.Default.ShowBetas && v.IsBeta)
                {
                    return(false);
                }
                else if (!Properties.LauncherSettings.Default.ShowReleases && !v.IsBeta)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }