コード例 #1
0
ファイル: ScriptPathNode.cs プロジェクト: smallfoxx/simplex
        public override IEnumerable <IPathNode> GetNodeChildren(PowerShell.Provider.PathNodeProcessors.IProviderContext context)
        {
            var list = new List <IPathNode>(base.GetNodeChildren(context));

            var results = _script.Invoke(context).ToList();

            UpdateProperties(context, results);

            var psoResults = results.ConvertAll(CreateNode);

            list.AddRange(psoResults);

            return(list);
        }
コード例 #2
0
        public override IEnumerable <IPathNode> ResolvePath(PowerShell.Provider.PathNodeProcessors.IProviderContext context, string path)
        {
            context.WriteDebug(String.Format("Resolving path [{0}] drive [{1}]", path, context.Drive));
            string filePath = Regex.Replace(path, @"^[^::]+::", String.Empty);

            if (null != context.Drive && !String.IsNullOrEmpty(context.Drive.Root))
            {
                var re      = new Regex("^.*(" + Regex.Escape(context.Drive.Root) + ")(.*)$", RegexOptions.IgnoreCase);
                var matches = re.Match(path);
                filePath = matches.Groups[1].Value;
                path     = matches.Groups[2].Value;;
            }
            _rootPathNode = new ProjectRootPathNode(filePath);

            return(base.ResolvePath(context, path));
        }
コード例 #3
0
ファイル: FolderPathNode.cs プロジェクト: smallfoxx/simplex
 public override IEnumerable <IPathNode> GetNodeChildren(PowerShell.Provider.PathNodeProcessors.IProviderContext context)
 {
     return(_folder.Children.ToList().ConvertAll(a => ItemPathNode.Create(_drive, a)));
 }