Beispiel #1
0
        /// <summary>
        /// Gets the associated system icon image for the extension.
        /// </summary>
        /// <param name="ext">
        /// The file extension.
        /// </param>
        public Icon GetSystemFileTypeIcon(string ext)
        {
            //Get the icon
            try
            {
                Icon icon = SystemFileType.ReturnIcon(ext.StartsWith(".") == false ? string.Format(".{0}", ext) : ext);

                return(icon);
            }
            catch (Exception)
            {
                return(null);
                //Return nothing
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets the associated system icon image for the filter.
        /// </summary>
        /// <param name="filter">
        /// The filter to get the icon for.
        /// </param>
        public Icon GetSystemFileTypeIcon(Filters filter)
        {
            List <string> l = this.GetSystemFileTypes();

            //Get the icon
            try
            {
                string ext = this.GetFileExtension(filter);
                //Get file extension
                Icon icon = SystemFileType.ReturnIcon(ext.StartsWith(".") == false ? string.Format(".{0}", ext) : ext);

                return(icon);
            }
            catch (Exception)
            {
                return(null);
                //Return nothing
            }
        }