public ShellNamespaceFolderIdListEnumerator(IShellNamespaceFolder shellNamespaceFolder, SHCONTF grfFlags, uint index)
        {
            //  todo: The flags should be a type in the sharpshell domain, not the shell.
            //  todo the flags might change how we have to do this.
            //  Store the extension for the folder we're enuerating.
            this.shellNamespaceFolder = shellNamespaceFolder;

            this.currentIndex = index;
            this.flags = grfFlags;
            //  Map the flags.
            //  TODO: more to be done here.
            _shellNamespaceEnumerationFlags = 0;
            if (grfFlags.HasFlag(SHCONTF.SHCONTF_FOLDERS))
                _shellNamespaceEnumerationFlags |= ShellNamespaceEnumerationFlags.Folders;
            if (grfFlags.HasFlag(SHCONTF.SHCONTF_NONFOLDERS))
                _shellNamespaceEnumerationFlags |= ShellNamespaceEnumerationFlags.Items;
        }
Esempio n. 2
0
        public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
        {
            if (options.HasFlag(SHCONTF.SHCONTF_FOLDERS))
            {
                foreach (var folder in Folder.Folders)
                {
                    yield return(new ArchiveFolderShellFolder(this, folder));
                }
            }

            if (options.HasFlag(SHCONTF.SHCONTF_NONFOLDERS))
            {
                foreach (var file in Folder.Files)
                {
                    yield return(new ArchiveFileShellItem(this, file));
                }
            }
        }
Esempio n. 3
0
        public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
        {
            if (!options.HasFlag(SHCONTF.SHCONTF_FOLDERS))
            {
                return(Enumerable.Empty <ShellItem>());
            }

            return(_deviceClassFolders.Values);
        }
        public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
        {
            if (!options.HasFlag(SHCONTF.SHCONTF_NONFOLDERS))
            {
                return(Enumerable.Empty <ShellItem>());
            }

            return(_items.Values);
        }
        public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
        {
            // add folders
            // note in this sample we only add folders up to two levels
            var maxLevels = 2;

            if (options.HasFlag(SHCONTF.SHCONTF_FOLDERS) && Level <= maxLevels)
            {
                var maxFolders = 2;
                for (var i = 0; i < maxFolders; i++)
                {
                    yield return(new SimpleFolder(this, "Virtual Folder " + Level + "." + i));
                }
            }

            // add items
            if (options.HasFlag(SHCONTF.SHCONTF_NONFOLDERS))
            {
                var maxItems = 2;
                if (ShowImages)
                {
                    maxItems *= 2;
                    var i = 0;
                    for (; i < maxItems / 2; i++)
                    {
                        yield return(new SimpleItem(this, "Virtual Item #" + i + ".txt"));
                    }

                    for (; i < maxItems; i++)
                    {
                        var imgKey = (ulong)(Level * 10 + i);
                        yield return(new SimplePngItem(this, "Virtual Image Key#" + imgKey + ".png", imgKey));
                    }
                }
                else
                {
                    for (var i = 0; i < maxItems; i++)
                    {
                        yield return(new SimpleItem(this, "Virtual Item #" + i + ".txt"));
                    }
                }
            }
        }
Esempio n. 6
0
        public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
        {
            // shell is asking for folders, use Xml elements as folder
            if (options.HasFlag(SHCONTF.SHCONTF_FOLDERS))
            {
                foreach (var child in Element.ChildNodes.OfType <XmlElement>())
                {
                    yield return(new XmlElementShellFolder(this, child));
                }
            }

            // shell is asking for non folders (items), use Xml attributes as items
            if (options.HasFlag(SHCONTF.SHCONTF_NONFOLDERS))
            {
                foreach (var att in Element.Attributes.OfType <XmlAttribute>())
                {
                    yield return(new XmlAttributeShellItem(this, att));
                }
            }
        }
        public ShellNamespaceFolderIdListEnumerator(IShellNamespaceFolder shellNamespaceFolder, SHCONTF grfFlags, uint index)
        {
            //  todo: The flags should be a type in the sharpshell domain, not the shell.
            //  todo the flags might change how we have to do this.
            //  Store the extension for the folder we're enuerating.
            this.shellNamespaceFolder = shellNamespaceFolder;

            this.currentIndex = index;
            this.flags        = grfFlags;
            //  Map the flags.
            //  TODO: more to be done here.
            _shellNamespaceEnumerationFlags = 0;
            if (grfFlags.HasFlag(SHCONTF.SHCONTF_FOLDERS))
            {
                _shellNamespaceEnumerationFlags |= ShellNamespaceEnumerationFlags.Folders;
            }
            if (grfFlags.HasFlag(SHCONTF.SHCONTF_NONFOLDERS))
            {
                _shellNamespaceEnumerationFlags |= ShellNamespaceEnumerationFlags.Items;
            }
        }
Esempio n. 8
0
 public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
 {
     foreach (var item in EnumItems(Folder.Id, options.HasFlag(SHCONTF.SHCONTF_FOLDERS), options.HasFlag(SHCONTF.SHCONTF_NONFOLDERS)))
     {
         if (item.Type == AGMTools.ItemType.Folder)
         {
             yield return(new WebShellFolder(this, item));
         }
         else
         {
             yield return(new WebShellItem(this, item));
         }
     }
 }
Esempio n. 9
0
        public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
        {
            // add folders
            // only add folders up to two levels
            if (options.HasFlag(SHCONTF.SHCONTF_FOLDERS) && Level < 3)
            {
                var max = 2;
                for (int i = 0; i < max; i++)
                {
                    yield return(new SimpleFolder(this, "Virtual Folder " + Level + "." + i));
                }
            }

            // add items
            if (options.HasFlag(SHCONTF.SHCONTF_NONFOLDERS))
            {
                var max = 2;
                for (int i = 0; i < max; i++)
                {
                    yield return(new SimpleItem(this, "Virtual Item #" + i + ".txt"));
                }
            }
        }
Esempio n. 10
0
 public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
 {
     // our sample drive root's id always Guid.Empty
     foreach (var item in WebShellFolder.EnumItems(Guid.Empty, options.HasFlag(SHCONTF.SHCONTF_FOLDERS), options.HasFlag(SHCONTF.SHCONTF_NONFOLDERS)))
     {
         if (item.Type == Api.ItemType.Folder)
         {
             yield return(new WebShellFolder(this, item));
         }
         else
         {
             yield return(new WebShellItem(this, item));
         }
     }
 }
Esempio n. 11
0
        public override IEnumerable <ShellItem> EnumItems(SHCONTF options)
        {
            // we have no folder to show
            if (!options.HasFlag(SHCONTF.SHCONTF_NONFOLDERS))
            {
                yield break;
            }

            // show 5 virtual & physical files
            for (int i = 0; i < 5; i++)
            {
                yield return(new VirtualAndPhysicalShellItem(this, "virtual and physical item " + i));
            }

            // show 5 virtual files
            for (int i = 0; i < 5; i++)
            {
                yield return(new VirtualShellItem(this, "virtual item " + i + ".txt"));
            }
        }