示例#1
0
        private void btnShowAllByTypeDescrip_Click(object sender, EventArgs e)
        {
            UInt32 lookupType;

            if (this.rbShowVista.Checked)
            {
                lookupType = Constants.BCDE_VISTA_OS_ENTRY;
            }
            else
            {
                lookupType = Constants.BCDE_LEGACY_OS_ENTRY;
            }

            List <string> guidList = BcdStore_API.EnumerateObjectsByType(lookupType, "");

            if (guidList != null)
            {
                this.lstStoreObjects.Items.Clear();
                foreach (string guid in guidList)
                {
                    string descrip = BcdStore_API.GetDescriptionForGuid(guid, "");
                    if (descrip == null)
                    {
                        descrip = guid;
                    }
                    this.lstStoreObjects.Items.Add(descrip);
                }
            }
        }
示例#2
0
        private void FillListBoxWithCurrentOSListDisplay(ListBox lb, bool viewDescrips)
        {
            List <string> guidList = BcdStore_API.GetBootManagerGUIDEntriesDisplayListAsList();

            if (guidList == null)
            {
                MessageBox.Show("trouble getting guid list");
            }

            lb.Items.Clear();

            foreach (string guid in guidList)
            {
                string descrip = BcdStore_API.GetDescriptionForGuid(guid, "");
                if (viewDescrips)
                {
                    if (descrip == null)
                    {
                        descrip = guid;                         // if no description default to showing guid, this is how the actual boot loader does it also
                    }
                }

                if (!viewDescrips)
                {
                    lb.Items.Add(guid);
                }
                else
                {
                    lb.Items.Add(descrip);
                }
            }
        }