public IEnumerable <TLauncherEntry> BySearchExpression(string exp) { if (string.IsNullOrEmpty(exp)) { yield break; } TopDocs hits = null; try { var parser = new MultiFieldQueryParser(Lucene.Net.Util.Version.LUCENE_CURRENT, new string[] { "label", "description", "category" }, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_CURRENT)); parser.AllowLeadingWildcard = true; hits = reader.Search(parser.Parse(exp), 1000); } catch (Exception ex) { CoreLib.Log(ex.ToString()); } if (hits != null) { for (var i = 0; i < hits.TotalHits; i++) { yield return(new TLauncherEntry(reader.Doc(hits.ScoreDocs[i].Doc))); } } }
public Pixbuf GetIconPixBuf() { if (Environment.OSVersion.Platform == PlatformID.Unix) { var file = "/usr/share/icons/gnome/32x32/apps/" + IconName + ".png"; if (File.Exists(file)) { return(new Pixbuf(file)); } else { return(null); } } else { try { var data = IconStored; if (data == null || data.Length == 0) { return(null); } else { return(new Pixbuf(data)); } } catch (Exception ex) { CoreLib.Log(ex.ToString()); } return(null); } }
public void AddLink(string file) { try { var entry = TLauncherEntry.CreateFromFile(file); writer.AddDocument(entry.doc); } catch (Exception ex) { CoreLib.Log(ex.ToString()); } }
public static TLauncherEntry CreateFromFile(string path) { CoreLib.Log("ADD LINK: " + path); return(Factory.Current.ReadLinkFile(path)); }