Example #1
0
        public LocalDrives()
        {
            List <SelectableDirectory> driveList = new List <SelectableDirectory>();

            try
            {
                DriveInfo[] drives = DriveInfo.GetDrives();
                foreach (DriveInfo d in drives)
                {
                    if (d.DriveType == DriveType.Fixed && d.IsReady)
                    {
                        SelectableDirectory sd = new SelectableDirectory(d);
                        driveList.Add(sd);
                        sd.PropertyChanged += new PropertyChangedEventHandler(sd_PropertyChanged);
                    }
                }
            }
            catch (SecurityException) { } // This will fail in an XBap

            m_drives = new ReadOnlyCollection <SelectableDirectory>(driveList);
        }
Example #2
0
        public LocalDrives()
        {
            List<SelectableDirectory> driveList = new List<SelectableDirectory>();

            try
            {
                DriveInfo[] drives = DriveInfo.GetDrives();
                foreach (DriveInfo d in drives)
                {
                    if (d.DriveType == DriveType.Fixed && d.IsReady)
                    {
                        SelectableDirectory sd = new SelectableDirectory(d);
                        driveList.Add(sd);
                        sd.PropertyChanged += new PropertyChangedEventHandler(sd_PropertyChanged);
                    }
                }
            }
            catch (SecurityException) { } // This will fail in an XBap

            m_drives = new ReadOnlyCollection<SelectableDirectory>(driveList);
        }