-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPanelCommandBrowseFileStreams.cs
More file actions
75 lines (64 loc) · 2.13 KB
/
Copy pathPanelCommandBrowseFileStreams.cs
File metadata and controls
75 lines (64 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using netCommander.FileSystemEx;
using System.IO;
namespace netCommander
{
public class PanelCommandBrowseFileStreams : PanelCommandBase
{
public PanelCommandBrowseFileStreams()
{
ToolStripMenuItem menu = new ToolStripMenuItem();
menu.ShortcutKeys = Keys.Control | Keys.D;
menu.ShowShortcutKeys = true;
menu.Text = "File streams";
CommandMenu = menu;
}
protected override void internal_command_proc()
{
QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();
OnQueryCurrentPanel(e);
if (e.FocusedIndex < 0)
{
return;
}
DirectoryList dl_list = (DirectoryList)e.ItemCollection;
if (dl_list.GetItemDisplayNameLong(e.FocusedIndex) == "..")
{
return;
}
//check volume caps
string root_path = Path.GetPathRoot(dl_list.DirectoryPath);
VolumeInfo vi = new VolumeInfo(root_path);
if ((vi.FileSystemFlags & VolumeCaps.NamedStreams) != VolumeCaps.NamedStreams)
{
Messages.ShowMessage
(string.Format
("File system on drive {0} not support named streams",
root_path));
return;
}
StreamList new_source = new StreamList
(Path.Combine(dl_list.DirectoryPath, dl_list.GetItemDisplayNameLong(e.FocusedIndex)),
false,
0,
false);
try
{
new_source.Refill();
}
catch (Exception ex)
{
Messages.ShowException(ex);
return;
}
SetNewSourceEventArgs e_new_source = new SetNewSourceEventArgs
(new_source,
false,
string.Empty);
OnSetNewSource(e_new_source);
}
}
}