Пример #1
0
 public MessageColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser,
                      IMessenger messenger = null, IColumnActionDispatcher actionDispatcher = null)
     : base(context, definition, config, parser, messenger, actionDispatcher)
 {
     Title = Strings.Messages;
     MessengerInstance.Register <DmMessage>(this, OnDirectMessage);
 }
Пример #2
0
        private void OnDispatcherChanged(IColumnActionDispatcher newDispatcher, IColumnActionDispatcher oldDispatcher)
        {
            if (oldDispatcher != null)
            {
                oldDispatcher.HeaderClicked -= Dispatcher_HeaderClicked;
            }

            if (newDispatcher != null)
            {
                newDispatcher.HeaderClicked += Dispatcher_HeaderClicked;
            }
        }
Пример #3
0
        protected ColumnViewModelBase(IContextEntry context, ColumnDefinition definition, IConfig config,
                                      IStreamParser parser, IMessenger messenger = null, IColumnActionDispatcher actionDispatcher = null)
            : base(messenger)
        {
            Configuration = config;
            Definition    = definition;
            Context       = context;
            Width         = definition.Width;
            IsLoading     = true;
            Items         = ItemCollection = new SmartCollection <ColumnItem>();
            Parser        = parser;
            MessengerInstance.Register <FilterUpdateMessage>(this, OnFiltersUpdated);

            ColumnConfiguration        = new ColumnConfigurationViewModel(definition);
            ColumnConfiguration.Saved += ColumnConfiguration_Saved;

            if (config.General.RealtimeStreaming)
            {
                Parser.StatusReceived        += Parser_StatusReceived;
                Parser.StatusDeleted         += Parser_ItemDeleted;
                Parser.DirectMessageDeleted  += Parser_ItemDeleted;
                Parser.DirectMessageReceived += Parser_DirectMessageReceived;
                Parser.FavoriteEventReceived += Parser_FavoriteEventReceived;
            }

            ActionDispatcher = actionDispatcher ?? new ColumnActionDispatcher();
            ActionDispatcher.HeaderClicked += ActionDispatcher_HeaderClicked;
            ActionDispatcher.BottomReached += ActionDispatcher_BottomReached;

            MaxIdFilterExpression   = s => s.MaxID == MaxId - 1;
            SinceIdFilterExpression = s => s.SinceID == SinceId;
            CountExpression         = s => s.Count == config.General.TweetFetchCount;
            SubTitle = "@" + Context.AccountName;
        }