示例#1
0
        private void LoadSystemImageList()
        {
            _systemImageList = new SystemImageList();

            string tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());

            Directory.CreateDirectory(tempPath);

            try
            {
                _folderIcon = _systemImageList.AddShellIcon(tempPath, 0);
            }
            finally
            {
                try
                {
                    Directory.Delete(tempPath);
                }
                catch
                {
                    // Ignore exceptions
                }
            }
        }
示例#2
0
        private void LoadSystemImageList()
        {
            _systemImageList = new SystemImageList();

            string tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());

            Directory.CreateDirectory(tempPath);

            try
            {
                _folderIcon = _systemImageList.AddShellIcon(tempPath, 0);
            }
            finally
            {
                try
                {
                    Directory.Delete(tempPath);
                }
                catch
                {
                    // Ignore exceptions
                }
            }
        }