Beispiel #1
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;
        }
Beispiel #2
0
 public TestColumnMock(IContextEntry context, ColumnDefinition definition, IConfig config = null,
                       IStreamParser parser = null)
     : base(context, definition, config ?? DefaultConfig(), parser ?? DefaultParser())
 {
     StatusFilterExpression = s => true;
     Icon = Icon.User;
 }
Beispiel #3
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;
        }
Beispiel #4
0
 public Client(IClientManager manager, IClientChecker checker,
               IPacketParser parser, IStreamParser streamParser)
 {
     _manager      = manager;
     _checker      = checker;
     _parser       = parser;
     _streamParser = streamParser;
 }
        public DefaultHuffmanDecodingService(IPlatformService platform, IStreamParser streamParser)
        {
            Guard.IsNotNull(platform, nameof(platform));
            Guard.IsNotNull(streamParser, nameof(streamParser));

            this.platform         = platform;
            this.streamParser     = streamParser;
            this.directoriesQueue = new Queue <string>(128);
        }
        public bool Carve(long offsetLimit)
        {
            _state.Reset();
            _lastHeader = null;
            _reader.ReferenceHeaders = (_scanContext.ReferenceHeader as IDictionary <IDataPacket, IPictureState>) ?? NoDefaultHeaders;

            _streamParser = null;
            _streamParser = FindNalUnit(true);

            if ((_streamParser != null) && (_reader.ReferenceHeaders.Count >= 1))
            {
                _state.ReferenceHeaderPosition = _dataReader.Position;
                _state.ByteStreamFormat        = (_streamParser is ByteStreamParser);
            }
            return(_streamParser != null);
        }
Beispiel #7
0
 /// <summary>
 /// Runs the raw file processor on the specified files
 /// </summary>
 /// <param name="name">A name for the processor used for logging</param>
 /// <param name="sources">The raw files to be processed</param>
 /// <param name="streamProvider">Instance capable of reading the sources into a stream</param>
 /// <param name="streamParser">Instance capable of parsing the provided stream</param>
 /// <param name="processors">The data processors to process the parsed data</param>
 /// <returns>True if the operation completed without error, otherwise false</returns>
 public static bool Run(string name, IEnumerable<string> sources, IStreamProvider streamProvider, IStreamParser streamParser, params IDataProcessor[] processors)
 {
     using (var processor = new RawFileProcessor(streamProvider, streamParser, processors) { Name = name })
     {
         foreach (var zip in sources)
         {
             try
             {
                 processor.Process(zip);
             }
             catch (Exception err)
             {
                 Log.Error(err);
                 return false;
             }
         }
     }
     return true;
 }
        public ISOCountryReader(IStreamParser <T> streamParser, IValueNormalizer <T> valueNormalizer, ISourceProvider sourceProvider)
        {
            if (valueNormalizer == null)
            {
                throw new ArgumentNullException("valueNormalizer");
            }
            if (sourceProvider == null)
            {
                throw new ArgumentNullException("sourceProvider");
            }
            if (streamParser == null)
            {
                throw new ArgumentNullException("streamParser");
            }

            this.ValueNormalizer = valueNormalizer;
            this.SourceProvider  = sourceProvider;
            this.StreamParser    = streamParser;
        }
Beispiel #9
0
 public MentionsColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser)
     : base(context, definition, config, parser)
 {
     Icon  = Icon.Mentions;
     Title = Strings.Mentions;
 }
Beispiel #10
0
 protected void AddParser(IStreamParser parser, ParserKey key)
 {
     parser.FriendsReceived += Parser_FriendsReceived;
     LoadedParsers.Add(key, parser);
 }
 public ISOCountryReader(IStreamParser <T> streamParser, IValueNormalizer <T> valueNormalizer)
     : this(streamParser, valueNormalizer, new CachingWebSource())
 {
 }
 public ISOCountryReader(IStreamParser <T> streamParser, ISourceProvider sourceProvider)
     : this(streamParser, new DummyNormalizer(), sourceProvider)
 {
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RawFileProcessor"/> class
 /// </summary>
 public RawFileProcessor(IStreamProvider streamProvider, IStreamParser parser, params IDataProcessor[] processors)
 {
     _streamProvider = streamProvider;
     _parser = parser;
     _processors = processors;
 }
Beispiel #14
0
 public FavoritesColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser,
                        IMessenger messenger = null)
     : base(context, definition, config, parser, messenger)
 {
     MaxIdFilterExpressionFavorites   = s => s.MaxID == MaxId - 1;
     SinceIdFilterExpressionFavorites = s => s.SinceID == SinceId;
     Title = Strings.Favourites;
 }
Beispiel #15
0
 public StaticColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser,
                     IMessenger messenger = null)
     : base(context, definition, config, parser, messenger)
 {
 }
Beispiel #16
0
 public MessageColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser,
                      IMessenger messenger = null)
     : base(context, definition, config, parser, messenger)
 {
     MessengerInstance.Register <DmMessage>(this, OnDirectMessage);
 }
Beispiel #17
0
 // TODO: Implement joined timelines for multiple contexts
 public TimelineColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser)
     : base(context, definition, config, parser)
 {
     Title = Strings.Timeline;
 }
Beispiel #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RawFileProcessor"/> class
 /// </summary>
 public RawFileProcessor(IStreamProvider streamProvider, IStreamParser parser, params IDataProcessor[] processors)
 {
     _streamProvider = streamProvider;
     _parser         = parser;
     _processors     = processors;
 }
Beispiel #19
0
        public ScheduleColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser,
                              IScheduler scheduler, IMessenger messenger = null)
            : base(context, definition, config, parser, messenger)
        {
            Scheduler = scheduler;
            Title     = Strings.Schedule;

            Scheduler.JobListUpdated += Scheduler_JobListUpdated;
        }
Beispiel #20
0
 public void InjectStream(ulong id, IStreamParser parser)
 {
     LoadedParsers.Add(new ParserKey(id, LinqToTwitter.StreamingType.User), parser);
 }
 public void InjectStream(ulong id, IStreamParser parser)
 {
     AddParser(parser, new ParserKey(id, StreamingType.User));
 }
 public TextyOrgUaWaterService()
 {
     //default parser
     _parser = new TextyOrgUaWaterServiceParser();
 }
Beispiel #23
0
 public ISOCountryReader(IStreamParser <T> streamParser, IValueNormalizer <T> valueNormalizer, ISourceProvider sourceProvider)
 {
     ValueNormalizer = valueNormalizer ?? throw new ArgumentNullException("valueNormalizer");
     SourceProvider  = sourceProvider ?? throw new ArgumentNullException("sourceProvider");
     StreamParser    = streamParser ?? throw new ArgumentNullException("streamParser");
 }
 public TextyOrgUaWaterService(IStreamParser <TextyOrgUaWaterRow> parser)
 {
     _parser = parser;
 }
 public ISOCountryReader(IStreamParser <T> streamParser)
     : this(streamParser, new DummyNormalizer())
 {
 }
Beispiel #26
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);
 }
Beispiel #27
0
 public TestColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser)
     : base(context, definition, config, parser)
 {
     StatusFilterExpression = s => true;
     Icon = Icon.User;
 }
Beispiel #28
0
 /// <summary>
 /// Runs the raw file processor on the specified files
 /// </summary>
 /// <param name="name">A name for the processor used for logging</param>
 /// <param name="sources">The raw files to be processed</param>
 /// <param name="streamProvider">Instance capable of reading the sources into a stream</param>
 /// <param name="streamParser">Instance capable of parsing the provided stream</param>
 /// <param name="processors">The data processors to process the parsed data</param>
 /// <returns>True if the operation completed without error, otherwise false</returns>
 public static bool Run(string name, IEnumerable <string> sources, IStreamProvider streamProvider, IStreamParser streamParser, params IDataProcessor[] processors)
 {
     using (var processor = new RawFileProcessor(streamProvider, streamParser, processors)
     {
         Name = name
     })
     {
         foreach (var zip in sources)
         {
             try
             {
                 processor.Process(zip);
             }
             catch (Exception err)
             {
                 Log.Error(err);
                 return(false);
             }
         }
     }
     return(true);
 }
Beispiel #29
0
 public UserColumn(IContextEntry context, ColumnDefinition definition, IConfig config, IStreamParser parser)
     : base(context, definition, config, parser)
 {
     UserId   = definition.TargetAccounts.First();
     SubTitle = "";
 }
Beispiel #30
0
 public TestUserColumn(IContextEntry context = null, ColumnDefinition definition = null, IConfig config = null, IStreamParser parser = null)
     : base(context ?? DefaultContext(), definition ?? DefaultDefinition(), config ?? DefaultConfig(), parser ?? DefaultParser())
 {
 }
Beispiel #31
0
 public TestColumn(IContextEntry context = null, IConfig config = null, IStreamParser parser = null)
     : base(
         context ?? DefaultContext(), new ColumnDefinition(ColumnType.Mentions), config ?? DefaultConfig(),
         parser ?? DefaultParser())
 {
 }