Exemplo n.º 1
0
        public MessageListViewModel(IMessageListView view, IApplicationController appc)
            : base(view, appc)
        {
            Parser = new ParserEngine();

            _browseLimit = App.UserSettings.BrowseLimit;

            Messages = new SelectableItemCollection <MessageInfo>();
            BindingOperations.EnableCollectionSynchronization(Messages, _syncLock);

            Progress = new RangeProgress();

            Filter = new BrowseFilter();

            BuildCommands();


            AvailableConverters = new List <LabelValuePair <IByteCharConverter> >
            {
                new LabelValuePair <IByteCharConverter> {
                    Label = "CP-1252", Value = new DefaultByteCharConverter()
                },
                new LabelValuePair <IByteCharConverter> {
                    Label = "EBCDIC", Value = new EbcdicByteCharConverter()
                }
            };

            _currentConverter = AvailableConverters[0].Value;

            StatusInfoViewModel = new MessageListStatusInfo(this);
        }
Exemplo n.º 2
0
        private async void SetupFilter()
        {
            var statusess = await statusService.GetAllAsync();

            var categoriess = await categoryService.GetAllAsync();

            var tags = await tagService.GetAllAsync();

            BrowseFilter = new BrowseFilter
            {
                Categories = JsonConvert.SerializeObject(categoriess.Select(x => x.Category)),
                Statuses   = JsonConvert.SerializeObject(statusess.Select(x => x.Status)),
                Tags       = JsonConvert.SerializeObject(tags.Select(x => x.Tag))
            };
        }