Ejemplo n.º 1
0
        public override void Initialize()
        {
            if (_initialized)
            {
                return;
            }
            _initialized = true;

            Links.Clear();
            if (AddAllLink)
            {
                Links.Add(new Link {
                    DisplayName = UiStrings.FiltersLinkAll,
                    Source      = _source
                });
            }

            foreach (var link in from x in ValuesStorage.GetStringList(KeyGroup)
                     where !string.IsNullOrWhiteSpace(x)
                     select new LinkInput(_source, x))
            {
                Links.Add(link);
                link.PropertyChanged += Link_PropertyChanged;
                link.Close           += OnLinkClose;
            }

            var rightLink = new LinkInputEmpty(Source);

            Links.Add(rightLink);
            rightLink.NewLink += OnNewLink;

            RecentlyClosedQueue.AddRange(ValuesStorage.GetStringList(KeyRecentlyClosed));
            LoadSelected();
        }
Ejemplo n.º 2
0
        public override void Initialize() {
            if (_initialized) return;
            _initialized = true;

            Links.Clear();
            Links.Add(new Link {
                DisplayName = UiStrings.FiltersLinkAll,
                Source = _source
            });

            foreach (var link in from x in ValuesStorage.GetStringList(KeyGroup)
                                 where !string.IsNullOrWhiteSpace(x)
                                 select new LinkInput(_source, x)) {
                Links.Add(link);
                link.PropertyChanged += Link_PropertyChanged;
                link.Close += Link_Close;
            }

            var source = ValuesStorage.GetString(KeySelected);
            _selectedLink = Links.FirstOrDefault(x => x.DisplayName == source) ?? Links.FirstOrDefault();

            var rightLink = new LinkInputEmpty(Source);
            Links.Add(rightLink);
            rightLink.NewLink += Link_NewLink;

            RecentlyClosedQueue.AddRange(ValuesStorage.GetStringList(KeyRecentlyClosed));
        }