Esempio n. 1
0
        public void Initialize(IContent[] articles)
        {
            var path = new UserFolderPath();

            var fileSystemNode = new FileSystemNode(path.FullPath);

            _collectionView.Add(new CollectionItem(new TabView(fileSystemNode)
            {
                IsDeletable = false, OnSelected = OnTabSelected
            }, new HorizontalSeparatorView()), animated: false);

            var collectionItems = new List <CollectionItem>();

            for (int i = 0; i < articles.Length; i++)
            {
                var article = articles[i];

                collectionItems.Add(new CollectionItem(new TabView(article, i)
                {
                    OnSelected = OnTabSelected, IsDefaultTab = false
                }, new HorizontalSeparatorView()));
            }

            _collectionView.AddRangeWithoutAnimation(collectionItems.ToArray());
        }
Esempio n. 2
0
        private void Initialize()
        {
            BackgroundColor   = UIColor.White;
            Layer.BorderWidth = 1;
            Layer.BorderColor = UIColor.LightGray.CGColor;

            _scheme = new HotKeyScheme(
                new HotKey(Key.Escape, Hide),
                new HotKey(Key.Enter, ApplySelected),
                new HotKey(Key.ArrowDown, SelectNext),
                new HotKey(Key.ArrowUp, SelectPrev),

                new HotKey(new Key("h"), () => TapOn(0)),
                new HotKey(new Key("j"), () => TapOn(1)),
                new HotKey(new Key("k"), () => TapOn(2)),
                new HotKey(new Key("l"), () => TapOn(3)),
                new HotKey(new Key(";"), () => TapOn(4)));

            var items = _spellChecker.Guesses.Select(suggestion =>
            {
                var collectionItem = new CollectionItem(
                    new SuggestionItemView(suggestion)
                {
                    OnSelected = ItemSelected
                },
                    new HorizontalSeparatorView()
                    );

                return(collectionItem);
            }).ToArray();

            _items = new CollectionItem[]
            {
                new CollectionItem(
                    new SuggestionItemView(AddToDict)
                {
                    OnSelected = ItemSelected
                },
                    new HorizontalSeparatorView()
                    ),
            }
            .And(items)
            .ToArray();

            _suggestionsView = new CollectionView();
            _suggestionsView.IsOrderingEnabled = false;
            _suggestionsView.AddRangeWithoutAnimation(_items);

            Add(_suggestionsView);

            _suggestionsView.Select(_items.SecondOrFirst());
        }
Esempio n. 3
0
        private void Initialize()
        {
            _filePaths = new CollectionView();
            Add(_filePaths);

            _filePaths.AddRangeWithoutAnimation(new CollectionItem(new FileSystemNodeView(_root, path => Selected(path), _disableScheme, _enableScheme), new HorizontalSeparatorView()));

            Layout = () =>
            {
                _filePaths.ChangeSize(Frame.Width, Frame.Height);
                _filePaths.ChangePosition(0, 0);
            };

            Layout();
        }