Beispiel #1
0
        public override IEnumerable <Item> Perform(IEnumerable <Item> items, IEnumerable <Item> modifierItems)
        {
            Regex timestamps = new Regex(TimeStampRegexp, RegexOptions.Compiled);

            string         text;
            string         tags = "";
            IQuoteProvider quoteProvider;

            text = (items.First() as ITextItem).Text;
            text = timestamps.Replace(text, "\n");

            Console.Error.WriteLine(text);

            foreach (Item tag in modifierItems)
            {
                tags += tag is QuoteTagItem
                                        ? (tag as QuoteTagItem).Name
                                        : (tag as ITextItem).Text;

                tags += " ";
            }

            quoteProvider = string.IsNullOrEmpty(tags)
                                ? QuoteProviderFactory.GetProviderFromPreferences(text)
                                : QuoteProviderFactory.GetProviderFromPreferences(text, tags);

            string url = Quote.PostUsing(quoteProvider);

            AddUnknownTags(tags, quoteProvider);

            yield return(new BookmarkItem(url, url));
        }
Beispiel #2
0
        public override IEnumerable <Item> DynamicModifierItemsForItem(Item item)
        {
            IQuoteProvider quoteProvider = QuoteProviderFactory.GetProviderFromPreferences();

            return(quoteProvider.SavedTags.Cast <Item> ());
        }