Exemplo n.º 1
0
        private void FillCatalogListBox(int iSelect)   //fill with _catalogList items (flattened)
        {
            catListBox.DataSource = null;
            List <string> items = new List <string>();

            //Fill list box from flat list
            _flatCalaogList = FlatCatalogList.MakeList(_catalogList);  //Take the catalog list list can flatten it out
            _flatCalaogList.ForEach(delegate(FlatCatalogListItem catalog)
            {
                //artbitary display
                if (String.IsNullOrEmpty(catalog.Locale))
                {
                    items.Add(catalog.CatalogID);
                }
                else
                {
                    items.Add(catalog.CatalogID + @"\" + catalog.Locale);
                }
            });

            catListBox.DataSource = items;    //fills listbox with items

            if (iSelect >= 0 && iSelect < catListBox.Items.Count)
            {
                catListBox.SelectedIndex = iSelect;
            }

            EnableDisable();
        }
Exemplo n.º 2
0
        List <FlatCatalogListItem> _catList = null;  //List of registered VS 11 catlogs

        private void RunVSHlpViewerElevatedBtn_DropDownOpening(object sender, EventArgs e)
        {
            RunVSHlpViewerElevatedBtn.DropDownItems.Clear();
            _catList = FlatCatalogList.GetAll();
            for (int i = 0; i < _catList.Count; i++)
            {
                ToolStripItem item = RunVSHlpViewerElevatedBtn.DropDownItems.Add(_catList[i].CatalogName + " | " + _catList[i].Locale);
                item.Tag = i;
            }
        }
Exemplo n.º 3
0
        private void RunVSHlpViewerElevatedBtn_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)  //fill catalog drop down list
        {
            int i = (int)e.ClickedItem.Tag;

            _catList = FlatCatalogList.GetAll();
            if (i >= 0 && i < _catList.Count)
            {
                HlpViewer.StartReturn sRet = HlpViewer.RunAsAdmin("/catalogName", _catList[i].CatalogID, "/locale", _catList[i].Locale);
                if (sRet != HlpViewer.StartReturn.ok)
                {
                    MessageBox.Show("Error running HlpViewer.exe: " + sRet.ToString() + "\n" + HlpViewer.path);
                }
            }
        }
Exemplo n.º 4
0
 private void RunVSHlpViewerElevatedBtn_ButtonClick(object sender, EventArgs e)
 {
     _catList = FlatCatalogList.GetAll();
     if (_catList.Count > 0)
     {
         HlpViewer.StartReturn sRet = HlpViewer.RunAsAdmin("/catalogName", _catList[0].CatalogID, "/locale", _catList[0].Locale);
         if (sRet != HlpViewer.StartReturn.ok)
         {
             MessageBox.Show("Error running HlpViewer.exe: " + sRet.ToString() + "\n" + HlpViewer.path);
         }
     }
     else
     {
         MessageBox.Show("No VS 11 registered catalogs found.");
     }
 }
Exemplo n.º 5
0
        private void FillCatalogList()
        {
            _calalogList = FlatCatalogList.GetAll();
            int i = 0;

            foreach (FlatCatalogListItem catalog in _calalogList)
            {
                ToolStripMenuItem mnuItem = (ToolStripMenuItem)openCatalogDropDown.DropDownItems.Add(catalog.CatalogName + " | " + catalog.Locale, null, openCatalogDropDown_Click);
                mnuItem.AutoToolTip = true;
                mnuItem.ToolTipText = "LocalPath: " + catalog.LocationPath + Environment.NewLine
                                      + "Catalog Alias: " + catalog.CatalogID + Environment.NewLine
                                      + "Catalog Name: " + catalog.CatalogName + Environment.NewLine
                                      + "Locale: " + catalog.Locale + Environment.NewLine
                                      + "SeedFilePath: " + catalog.SeedFilePath + Environment.NewLine;
                mnuItem.Tag = i++;
                _catalogMnu.Add(mnuItem);
            }
            if (_calalogList.Count > 0)
            {
                _SelectedCatalog = 0;
            }
        }