示例#1
0
 static GnomePlatform()
 {
     try {
         Gio.GetDefaultForType("text/plain");
         useGio = true;
     } catch (Exception ex) {
         Console.WriteLine(ex);
     }
     //apparently Gnome.Icon needs GnomeVFS initialized even when we're using GIO.
     Gnome.Vfs.Vfs.Initialize();
 }
示例#2
0
        public override DesktopApplication GetDefaultApplication(string mimeType)
        {
            if (useGio)
            {
                return(Gio.GetDefaultForType(mimeType));
            }

            var app = Gnome.Vfs.Mime.GetDefaultApplication(mimeType);

            if (app != null)
            {
                return((DesktopApplication)Marshal.PtrToStructure(app.Handle, typeof(DesktopApplication)));
            }
            else
            {
                return(new DesktopApplication());
            }
        }