2 using System
.Collections
;
3 using System
.Diagnostics
;
6 namespace Search
.Tiles
{
8 public class CAppletActivator
: TileActivator
{
10 public CAppletActivator () : base ()
12 AddSupportedFlavor (new HitFlavor (null, null, "application/x-desktop"));
15 public override Tile
BuildTile (Beagle
.Hit hit
, Beagle
.Query query
)
17 return new CApplet (hit
, query
);
20 public override bool Validate (Beagle
.Hit hit
)
22 if (! base.Validate (hit
))
25 ICollection categories
= hit
.GetProperties ("fixme:Categories");
27 if (categories
== null || categories
.Count
< 1)
30 foreach (string cat
in categories
) {
31 if (cat
== "Settings") {
41 public class CApplet
: Application
{
43 public CApplet (Beagle
.Hit hit
, Beagle
.Query query
) : base (hit
, query
) {}
45 public override void Open ()
47 Process p
= new Process ();
48 p
.StartInfo
.UseShellExecute
= true;
49 p
.StartInfo
.FileName
= Hit
["fixme:Exec"];
53 } catch (Exception e
) {
54 Console
.WriteLine ("Unable to run {0}: {1}", p
.StartInfo
.FileName
, e
.Message
);