コード例 #1
0
 public DeckSearcher(
     DeckListModel deckList,
     DeckSpellchecker spellchecker,
     DeckDocumentAdapter adapter)
     : base(spellchecker, adapter)
 {
     _deckList = deckList;
 }
コード例 #2
0
ファイル: DeckSearcher.cs プロジェクト: Zelfrom/Mtgdb
 public DeckSearcher(
     DeckListModel deckListModel,
     DeckSpellchecker spellchecker,
     DeckDocumentAdapter adapter)
     : base(spellchecker, adapter)
 {
     _deckListModel       = deckListModel;
     IndexDirectoryParent = AppDir.Data.AddPath("index").AddPath("deck").AddPath("search");
 }
コード例 #3
0
        public SearchResultHighlightSubsystem(
            LayoutViewControl view,
            DeckSearchSubsystem searchSubsystem,
            DeckDocumentAdapter adapter)
        {
            _view = view;
            var keywordHighlighter = new DeckKeywordHighlighter();

            _highlightSubsystem = new SearchResultHighlighter(searchSubsystem, adapter, keywordHighlighter);
        }
コード例 #4
0
 public DeckSpellcheckerState(
     Spellchecker spellchecker,
     DeckSearcherState searcherState,
     DeckDocumentAdapter adapter,
     Func <int> maxCount,
     bool loaded) :
     base(spellchecker, searcherState, adapter, maxCount, loaded)
 {
     _models = searcherState.Models;
 }
コード例 #5
0
ファイル: DeckListControl.cs プロジェクト: NikolayXHD/Mtgdb
        public void Init(
            DeckListModel decks,
            IconRecognizer recognizer,
            DeckSearcher searcher,
            DeckDocumentAdapter adapter,
            CollectionEditorModel collection,
            UiConfigRepository uiConfigRepository,
            Control tooltipOwner,
            IApplication app)
        {
            _searcher            = searcher;
            _uiConfigRepository  = uiConfigRepository;
            _panelRename.Visible = false;

            _viewDeck.IconRecognizer = recognizer;
            _viewDeck.DataSource     = _filteredModels;

            _menuFilterByDeckMode.SetMenuValues(
                "Ignored",
                "Cards in currently open deck",
                "Cards in saved decks matching filter");

            _menuFilterByDeckMode.SelectedIndex = 0;

            _listModel    = decks;
            _collection   = collection;
            _tooltipOwner = tooltipOwner;
            _app          = app;

            _searchSubsystem = new DeckSearchSubsystem(
                this,
                _searchBar,
                uiConfigRepository,
                _searcher,
                adapter,
                _viewDeck);
            _deckSort          = new DeckSortSubsystem(_viewDeck, new DeckFields(), _searchSubsystem, _listModel);
            _layoutViewTooltip = new ViewDeckListTooltips(_tooltipOwner, _viewDeck);

            _model           = _listModel.CreateModel(Deck.Create());
            _model.IsCurrent = true;

            subscribeToEvents();

            updateSortLabel();

            if (components == null)
            {
                components = new Container();
            }

            components.Add(new SearchResultHighlightSubsystem(_viewDeck, _searchSubsystem, adapter));

            _searchSubsystem.Apply();
        }
コード例 #6
0
ファイル: DeckSearchSubsystem.cs プロジェクト: Zelfrom/Mtgdb
 public DeckSearchSubsystem(
     Control parent,
     SearchBar searchBar,
     DeckSearcher searcher,
     DeckDocumentAdapter adapter,
     params LayoutViewControl[] layoutViews)
     : base(
         parent,
         searchBar,
         searcher,
         adapter,
         layoutViews)
 {
 }
コード例 #7
0
 public DeckSearchSubsystem(
     Control parent,
     SearchBar searchBar,
     UiConfigRepository uiConfigRepository,
     DeckSearcher searcher,
     DeckDocumentAdapter adapter,
     params LayoutViewControl[] views)
     : base(
         parent,
         searchBar,
         uiConfigRepository,
         searcher,
         adapter,
         views)
 {
 }
コード例 #8
0
ファイル: DeckListControl.cs プロジェクト: mtucker6784/Mtgdb
        public void Init(
            DeckListModel decks,
            IconRecognizer recognizer,
            DeckSearcher searcher,
            DeckDocumentAdapter adapter,
            Control tooltipOwner)
        {
            _deckListModel = decks;
            _tooltipOwner  = tooltipOwner;

            _viewDeck.IconRecognizer    = recognizer;
            _viewDeck.LayoutControlType = typeof(DeckListLayout);
            _viewDeck.DataSource        = _filteredModels;

            _textBoxName.Visible = false;

            _customTooltip = new ViewDeckListTooltips(_tooltipOwner, _viewDeck);

            _searchSubsystem = new DeckSearchSubsystem(
                this,
                _textBoxSearch,
                _panelSearchIcon,
                _listBoxSuggest,
                searcher,
                _viewDeck);

            _menuFilterByDeckMode.SelectedIndex = 0;

            _viewDeck.MouseClicked     += viewDeckClicked;
            _viewDeck.RowDataLoaded    += viewDeckRowDataLoaded;
            _viewDeck.CardIndexChanged += viewScrolled;

            _textBoxName.LostFocus += nameLostFocus;
            _textBoxName.KeyDown   += nameKeyDown;

            _menuFilterByDeckMode.SelectedIndexChanged += filterByDeckModeChanged;

            _searchSubsystem.TextApplied += applySearchResult;

            _searchSubsystem.SubscribeToEvents();
            _customTooltip.SubscribeToEvents();

            _higlightSubsystem = new SearchResultHiglightSubsystem(_viewDeck, _searchSubsystem, adapter);
            _higlightSubsystem.SubscribeToEvents();
        }
コード例 #9
0
 public DeckSearchSubsystem(
     Control parent,
     RichTextBox findEditor,
     Panel panelSearchIcon,
     ListBox listBoxSuggest,
     DeckSearcher searcher,
     DeckDocumentAdapter adapter,
     params LayoutViewControl[] layoutViews)
     : base(
         parent,
         findEditor,
         panelSearchIcon,
         listBoxSuggest,
         searcher,
         adapter,
         layoutViews)
 {
 }
コード例 #10
0
ファイル: DeckSpellchecker.cs プロジェクト: rajeshwarn/Mtgdb
 public DeckSpellchecker(DeckDocumentAdapter adapter)
     : base(adapter)
 {
     IndexDirectoryParent = AppDir.Data.AddPath("index").AddPath("deck").AddPath("suggest");
 }
コード例 #11
0
ファイル: DeckQueryParser.cs プロジェクト: rajeshwarn/Mtgdb
 public DeckQueryParser(MtgAnalyzer analyzer, DeckDocumentAdapter adapter)
     : base(analyzer, adapter, CardLocalization.DefaultLanguage)
 {
 }
コード例 #12
0
 public DeckSearcherState(DeckDocumentAdapter adapter, IReadOnlyList <DeckModel> models)
     : base(adapter)
 {
     Models = models;
 }
コード例 #13
0
ファイル: DeckListControl.cs プロジェクト: rajeshwarn/Mtgdb
        public void Init(
            DeckListModel decks,
            IconRecognizer recognizer,
            DeckSearcher searcher,
            DeckDocumentAdapter adapter,
            CollectionEditorModel collection,
            Control tooltipOwner)
        {
            _listModel       = decks;
            _tooltipOwner    = tooltipOwner;
            _collection      = collection;
            searcher.Loaded += indexLoaded;

            _viewDeck.IconRecognizer    = recognizer;
            _viewDeck.LayoutControlType = typeof(DeckListLayout);
            _viewDeck.DataSource        = _filteredModels;

            var iBeamIcon    = Resources.text_selection_24.ResizeDpi();
            var iBeamHotSpot = new Size(iBeamIcon.Width / 2, iBeamIcon.Height / 2);

            _textSelectionCursor = CursorHelper.CreateCursor(iBeamIcon, iBeamHotSpot);

            _textBoxName.Visible = false;

            _layoutViewTooltip = new ViewDeckListTooltips(_tooltipOwner, _viewDeck);

            _searchSubsystem = new DeckSearchSubsystem(
                this,
                _textBoxSearch,
                _panelSearchIcon,
                _listBoxSuggest,
                searcher,
                adapter,
                _viewDeck);

            _searchSubsystem.TextApplied += searchTextApplied;
            _searchSubsystem.SubscribeToEvents();

            _menuFilterByDeckMode.SelectedIndex = 0;

            _viewDeck.MouseClicked     += viewDeckClicked;
            _viewDeck.RowDataLoaded    += viewDeckRowDataLoaded;
            _viewDeck.CardIndexChanged += viewScrolled;

            _textBoxName.LostFocus += nameLostFocus;
            _textBoxName.KeyDown   += nameKeyDown;

            _menuFilterByDeckMode.SelectedIndexChanged += filterByDeckModeChanged;

            _layoutViewTooltip.SubscribeToEvents();

            _highlightSubsystem = new SearchResultHighlightSubsystem(_viewDeck, _searchSubsystem, adapter);
            _highlightSubsystem.SubscribeToEvents();

            _viewDeck.MouseMove += deckMouseMove;

            _deckSort              = new DeckSortSubsystem(_viewDeck, new DeckFields(), _searchSubsystem, _listModel);
            _deckSort.SortChanged += sortChanged;
            _deckSort.SubscribeToEvents();

            _model           = _listModel.CreateModel(Deck.Create());
            _model.IsCurrent = true;

            if (_listModel.IsLoaded)
            {
                listModelLoaded();
            }
            else
            {
                _listModel.Loaded += listModelLoaded;
            }

            searcher.Loaded += searcherLoaded;

            if (searcher.IsLoaded)
            {
                _searchSubsystem.Apply();
            }

            updateSortLabel();
        }