private void SetupVersionComboBox(ComboBox box, string version, VIBoolPredicate versionInfoCheck)
        {
            string currentItem = box.Text;

            if (version != null)
            {
                currentItem = version;
            }
            box.Items.Clear();

            foreach (string v in versionManager.GetVersions())
            {
                if (v == "$(DefaultQtVersion)")
                {
                    continue;
                }
                try
                {
                    VersionInformation vi = new VersionInformation(versionManager.GetInstallPath(v));
                    if (versionInfoCheck(vi))
                    {
                        box.Items.Add(v);
                    }
                }
                catch (Exception)
                {
                }
            }

            if (box.Items.Count > 0)
            {
                if (box.Items.Contains(currentItem))
                {
                    box.Text = currentItem;
                }
                else
                {
                    box.Text = (string)box.Items[0];
                }
            }
            else
            {
                box.Text = "";
            }
        }
Пример #2
0
        private void SetupVersionComboBox(ComboBox box, string version, VIBoolPredicate versionInfoCheck)
        {
            string currentItem = box.Text;
            if (version != null)
                currentItem = version;
            box.Items.Clear();

            foreach (string v in versionManager.GetVersions())
            {
                if (v == "$(DefaultQtVersion)")
                    continue;
                try
                {
                    VersionInformation vi = new VersionInformation(versionManager.GetInstallPath(v));
                    if (versionInfoCheck(vi))
                        box.Items.Add(v);
                }
                catch (Exception)
                {
                }
            }

            if (box.Items.Count > 0)
            {
                if (box.Items.Contains(currentItem))
                    box.Text = currentItem;
                else
                    box.Text = (string)box.Items[0];
            }
            else
            {
                box.Text = "";
            }
        }