示例#1
0
        public string GetFullPath()
        {
            string result = string.Empty;

            MTPFileNode node = this;

            while (null != node.Parent && MTPFileNodeType.Root != node.Parent.Type)
            {
                result = Path.Combine(node.Parent.Name, result);

                node = node.Parent;
            }

            return(result);
        }
示例#2
0
        private void GetMTPFileNode(MTPFileNode root, IEnumerable <string> extensions, ref List <MTPFileNode> result)
        {
            foreach (var node in root.Childrens)
            {
                switch (node.Type)
                {
                case MTPFileNodeType.File:
                    if (extensions.Any((ext) => node.Name.EndsWith(ext, StringComparison.OrdinalIgnoreCase)))
                    {
                        result.Add(node);
                    }
                    break;

                default:
                    GetMTPFileNode(node, extensions, ref result);
                    break;
                }
            }
        }