protected override Uri PostAddHook(Indexable indexable, IndexerAddedReceipt receipt) { base.PostAddHook(indexable, receipt); if (indexable_text_cache.ContainsKey(indexable.Uri)) { string text = (string)indexable_text_cache [indexable.Uri]; TextCache.UserCache.WriteFromString(indexable.Uri, text); indexable_text_cache.Remove(indexable.Uri); } return(indexable.Uri); }
protected override Uri PostAddHook(Indexable indexable, IndexerAddedReceipt receipt) { FileInfo meta_file = indexable.LocalState ["MetaFile"] as FileInfo; if (meta_file == null) { return(indexable.Uri); } meta_file.Delete(); lock (pending_files) pending_files.Remove(indexable.ContentUri.LocalPath); return(indexable.Uri); }
override protected Uri PostAddHook(Indexable indexable, IndexerAddedReceipt receipt) { base.PostAddHook(indexable, receipt); // Store the note's text in the text cache. // By doing this in the PostAddHook, we ensure that // the TextCache is not modified until we are // sure that the note was actually indexed. string text; text = (string)note_text_cache [indexable.Uri]; // If text == null, this is equivalent to // calling Delete (receipt.Uri) TextCache.UserCache.WriteFromString(indexable.Uri, text); note_text_cache.Remove(indexable.Uri); return(indexable.Uri); }