public SearchBar(PresentSearch <T> presentSearch, Search <T> search)
        {
            present_search = presentSearch;
            Search         = search;

            search_entry = new SearchEntry()
            {
                WidthRequest = 150,
                Visible      = true,
                EmptyMessage = "Type your query"
            };

            search_entry.Activated += (o, a) => { search_button.Activate(); };

            if ((this.GetType() == typeof(SearchBar <Location>)) ||
                (this.GetType() == typeof(SearchBar <Event>) && Search is EventsByLocationSearch))
            {
                LocationProviderManager.Register(this);
            }

            PackStart(search_entry, true, true, 2);

            search_button          = new Hyena.Widgets.ImageButton(Catalog.GetString("_Search"), Stock.Find);
            search_button.Clicked += (o, a) => PerformSearch();

            PackEnd(search_button, false, false, 2);
        }
Ejemplo n.º 2
0
        public SongKickSource() : base(AddinManager.CurrentLocalizer.GetString("SongKick"),
                                       AddinManager.CurrentLocalizer.GetString("SongKick"),
                                       sort_order,
                                       "extension-unique-id")
        {
            //Change comment in lines below to see described behaviour:
            //Properties.Set<ISourceContents> ("Nereid.SourceContents", new SongKickSourceContents ());
            Properties.Set <ISourceContents> ("Nereid.SourceContents", new LazyLoadSourceContents <SongKickSourceContents> ());

            // set logo:
            // TODO: fix that so that it works with various resolutions
            Properties.SetStringList("Icon.Name", "songkick_logo");

            LocationProviderManager.Initialize();

            Hyena.Log.Information("SongKick source has been instantiated!");
        }