public HTMLNichanChatCollectServiceEntry(
     ChatService.NichanChatService owner,
     ObservableValue <TimeSpan> resCollectInterval,
     ObservableValue <TimeSpan> threadSearchInterval,
     NichanUtils.ThreadResolver threadResolver
     ) : base(owner, resCollectInterval, threadSearchInterval, threadResolver)
 {
 }
Esempio n. 2
0
 public PastNichanChatCollectServiceEntry(
     ChatService.NichanChatService chatService,
     NichanUtils.ThreadResolver threadResolver,
     ObservableValue <TimeSpan> backTime
     )
 {
     this.Owner          = chatService;
     this.threadResolver = threadResolver;
     this.backTime       = backTime;
 }
 public DATNichanChatCollectServiceEntry(
     ChatService.NichanChatService owner,
     ObservableValue <TimeSpan> resCollectInterval,
     ObservableValue <TimeSpan> threadSearchInterval,
     NichanUtils.ThreadResolver threadResolver,
     ObservableValue <Nichan.ApiClient> nichanApiClient
     ) : base(owner, resCollectInterval, threadSearchInterval, threadResolver)
 {
     this.apiClient = nichanApiClient;
 }
 public NichanChatCollectServiceEntry(
     ChatService.NichanChatService owner,
     ObservableValue <TimeSpan> resCollectInterval, ObservableValue <TimeSpan> threadSearchInterval,
     NichanUtils.ThreadResolver threadResolver
     )
 {
     this.Owner = owner;
     this.resCollectInterval   = resCollectInterval;
     this.threadSearchInterval = threadSearchInterval;
     this.threadResolver       = threadResolver;
 }
Esempio n. 5
0
        public NichanChatService(
            NichanChatServiceSettings settings, ChannelDatabase channelDatabase,
            string threadSettingFilePath
            )
        {
            this.settings = settings;

            // 設定構造変更に伴い設定値を移行
            if (settings.HmKey != null)
            {
                settings.GochanApi.HmKey = settings.HmKey;
                settings.HmKey           = null;
            }
            if (settings.AppKey != null)
            {
                settings.GochanApi.AppKey = settings.AppKey;
                settings.AppKey           = null;
            }
            if (settings.UserId != null)
            {
                settings.GochanApi.UserId = settings.UserId;
                settings.UserId           = null;
            }
            if (settings.Password != null)
            {
                settings.GochanApi.Password = settings.Password;
                settings.Password           = null;
            }

            var boardSetting = NichanUtils.ThreadSettingFileParser.Parse(threadSettingFilePath);

            boardDatabase  = new NichanUtils.BoardDatabase(boardSetting.BoardEntries, boardSetting.ThreadMappingRuleEntries);
            threadResolver = new NichanUtils.ThreadResolver(channelDatabase, boardDatabase);

            this.resCollectInterval.Value   = settings.ThreadUpdateInterval;
            this.threadSearchInterval.Value = settings.ThreadListUpdateInterval;
            this.nichanApiClient.Value      = new Nichan.ApiClient(
                settings.GochanApi.HmKey, settings.GochanApi.AppKey,
                settings.GochanApi.UserId, settings.GochanApi.Password,
                settings.GochanApi.AuthUserAgent, settings.GochanApi.AuthX2chUA, settings.GochanApi.UserAgent
                );
            this.pastCollectServiceBackTime.Value = settings.PastCollectServiceBackTime;

            ChatCollectServiceEntries = new ChatCollectServiceEntry.IChatCollectServiceEntry[] {
                new ChatCollectServiceEntry.DATNichanChatCollectServiceEntry(this, resCollectInterval, threadSearchInterval, threadResolver, nichanApiClient),
                new ChatCollectServiceEntry.PastNichanChatCollectServiceEntry(this, threadResolver, pastCollectServiceBackTime),
            };
            ChatTrendServiceEntries = new IChatTrendServiceEntry[0];

            BoardList = boardDatabase.BoardList.Select(x => new BoardInfo(x.Title, x.Uri));
        }