示例#1
0
 /// <summary>
 /// Remove a ListViewLocker from the collection of ListViewLockers.
 /// </summary>
 /// <param name="lvl">The ListViewLocker that should be removed from the collection.</param>
 internal void DeleteListViewLocker(ListViewLocker lvl)
 {
     _listViewLockers.Remove(lvl);
 }
示例#2
0
 /// <summary>
 /// Add a new ListViewLocker to the collection of ListViewLockers.
 /// </summary>
 /// <param name="lvl">The new ListViewLocker that should be added.</param>
 internal void AddListViewLocker(ListViewLocker lvl)
 {
     _listViewLockers.Add(lvl);
 }
示例#3
0
 /// <summary>
 /// Add a new ListViewLocker to the collection of ListViewLockers.
 /// </summary>
 /// <param name="lvl">The new ListViewLocker that should be added.</param>
 internal void AddListViewLocker(ListViewLocker lvl)
 {
     _listViewLockers.Add(lvl);
 }
示例#4
0
 /// <summary>
 /// Remove a ListViewLocker from the collection of ListViewLockers.
 /// </summary>
 /// <param name="lvl">The ListViewLocker that should be removed from the collection.</param>
 internal void DeleteListViewLocker(ListViewLocker lvl)
 {
     _listViewLockers.Remove(lvl);
 }
示例#5
0
        /// <summary>
        /// Open a file or folder into DeadLock.
        /// </summary>
        /// <param name="path">The path to the file or folder.</param>
        private void OpenPath(string path)
        {
            if (!File.Exists(path) && !Directory.Exists(path)) return;
            if (_lvlManager.FindListViewLocker(path) != null) return;
            Language l = _languageManager.GetLanguage();
            int index = lsvItems.Items.Count;
            ListViewItem lvi = new ListViewItem { Text = path, UseItemStyleForSubItems = false, ImageIndex = index };

            lvi.SubItems.Add(l.MsgUnknown);

            Image img;
            if (File.GetAttributes(path).HasFlag(FileAttributes.Directory))
            {
                img = Properties.Resources.folder;
            }
            else
            {
                Icon ico = Icon.ExtractAssociatedIcon(path);
                img = ico?.ToBitmap() ?? Properties.Resources.file;
            }
            imgFileIcons.Images.Add(img);
            img.Dispose();

            ListViewLocker lvl = new ListViewLocker(path, _languageManager.GetLanguage());
            lvi.SubItems.Add(lvl.HasOwnership() ? l.BarItemOwnershipTrue : l.BarItemOwnershipFalse);
            lsvItems.Items.Add(lvi);

            _lvlManager.AddListViewLocker(lvl);

            lsvItems.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            lsvItems.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }