Пример #1
0
        public DirectoryInfoEx(Environment.SpecialFolder shellFolder)
        {
            PIDL pidlLookup = CSIDLtoPIDL(IOTools.ShellFolderToCSIDL(shellFolder));

            try
            {
                init(pidlLookup);
                checkProperties();
            }
            finally
            {
                if (pidlLookup != null)
                {
                    pidlLookup.Free();
                }
                pidlLookup = null;
            }
        }
Пример #2
0
        public DirectoryInfoEx(Environment.SpecialFolder shellFolder)
        {
            var sf = IOTools.ShellFolderToCSIDL(shellFolder);

            if (!sf.HasValue)
            {
                throw new ArgumentException("Cannot find CSIDL from this shell folder.");
            }
            PIDL pidlLookup = CSIDLtoPIDL(sf.Value);

            try
            {
                init(pidlLookup);
                checkProperties();
            }
            finally
            {
                //if (pidlLookup != null) pidlLookup.Free();
                pidlLookup = null;
            }
        }