File: AppInfo.cs

package info (click to toggle)
gtk-sharp3 2.99.3-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 25,464 kB
  • ctags: 8,843
  • sloc: xml: 308,885; cs: 38,795; sh: 11,336; perl: 1,295; makefile: 1,097; ansic: 900
file content (30 lines) | stat: -rw-r--r-- 984 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using GLib;
using System;

namespace TestGio
{
	public class TestAppInfo
	{
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestAppInfo mimetype");
				return;
			}
			GLib.GType.Init ();
//			Gtk.Application.Init ();
			Console.WriteLine ("Default Handler for {0}: {1}", args[0], AppInfoAdapter.GetDefaultForType (args[0], false).Name);
			Console.WriteLine();
			Console.WriteLine("List of all {0} handlers", args[0]);
			foreach (IAppInfo appinfo in AppInfoAdapter.GetAllForType (args[0]))
				Console.WriteLine ("\t{0}: {1} {2}", appinfo.Name, appinfo.Executable, appinfo.Description);

			IAppInfo app_info = AppInfoAdapter.GetDefaultForType ("image/jpeg", false);
			Console.WriteLine ("{0}:\t{1}", app_info.Name, app_info.Description);

			Console.WriteLine ("All installed IAppInfos:");
			foreach (IAppInfo appinfo in AppInfoAdapter.GetAll ())
				Console.WriteLine ("\t{0}: {1} ", appinfo.Name, appinfo.Executable);
		}
	}
}