protected void OnSetNewSource(SetNewSourceEventArgs e)
 {
     if (SetNewSource != null)
     {
         SetNewSource(this, e);
     }
 }
示例#2
0
        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);
        }