Exemple #1
0
        /// <summary>
        /// Creates a new <see cref="SystemFileType"/> object from the given extension with the specified parameters.
        /// </summary>
        /// <param name="ext">The file extension.</param>
        /// <param name="parent">The parent <see cref="AllSystemFileTypes"/> object.</param>
        /// <param name="size">The default icon size.</param>
        /// <returns></returns>
        public static SystemFileType FromExtension(string ext, AllSystemFileTypes parent = null, StandardIcons size = StandardIcons.Icon48)
        {
            var c = new SystemFileType(ext);

            if (parent is object)
            {
                c.Parent = parent;
            }
            var assoc = NativeShell.EnumFileHandlers(ext);

            if (assoc is null || assoc.Count() == 0)
            {
                return(null);
            }
            c.Populate(assoc, size);
            if (c.Handlers.Count == 0)
            {
                return(null);
            }
            else
            {
                return(c);
            }
        }
Exemple #2
0
 internal SystemFileType(AllSystemFileTypes p, string ext)
 {
     _Parent = p;
     _Ext    = ext;
 }
Exemple #3
0
 internal UIHandler(IAssocHandler handler, AllSystemFileTypes parent)
 {
     _Parent = parent;
     Refresh(handler);
 }