Exemplo n.º 1
0
        protected ColumnViewModelBase(IContextEntry context, ColumnDefinition definition, IConfig config,
                                      IStreamParser parser)
        {
            Configuration = config;
            Definition    = definition;
            Context       = context;
            Width         = definition.Width;
            IsLoading     = true;
            Statuses      = StatusCollection = new SmartCollection <StatusViewModel>();
            Parser        = parser;

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

            if (config.General.RealtimeStreaming)
            {
                Parser.FriendsReceived += Parser_FriendsReceived;
                Parser.StatusReceived  += Parser_StatusReceived;
                Parser.StatusDeleted   += Parser_StatusDeleted;
            }

            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;
        }
Exemplo n.º 2
0
        protected ColumnViewModelBase(IContextEntry context, ColumnDefinition definition, IConfig config,
                                      IStreamParser parser, IMessenger messenger = 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 = 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;
        }