Exemplo n.º 1
0
        /// <summary>
        /// Возвращает массив элементов дерева, заполненый избранными директориями.
        /// </summary>
        /// <returns>Массив избранных директорий</returns>
        private static TreeViewButton[] MakeTreeViewButtonsForFavorites()
        {
            Dictionary <string, string> favorites = Configurator.GetDictionaryFavoritesValueRegistry();

            TreeViewButton[] items = new TreeViewButton[favorites.Count];

            int i = 0;

            foreach (var item in favorites)
            {
                items[i] = new TreeViewButton(item.Value);
                items[i].ButtonForTreeView.Content = item.Key;
                i++;
            }

            return(items);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Возвращает массив элементов дерева, заполненый логическими дисками.
        /// </summary>
        /// <returns>Массив элементов дерева</returns>
        private static TreeViewButton[] MakeTreeViewButtonsForLogicalDrives()
        {
            DriveInfo[] disks = AnalyzerFileSystem.GetAllLogicDisk();

            TreeViewButton[] items = new TreeViewButton[disks.Length];

            for (int i = 0; i < disks.Length; i++)
            {
                items[i] = new TreeViewButton(disks[i].Name)
                {
                    Width = 150
                };
                items[i].ButtonForTreeView.Content = disks[i] + disks[i].VolumeLabel;
            }

            return(items);
        }