/// <summary> /// 監視なしで、単一のログファイルを読み込む。 /// </summary> /// <param name="instDir"></param> /// <param name="date"></param> /// <param name="receiver"></param> public static void CheckWholeFile(string instDir, DateTime date, TwLogReceiver receiver) { string logfile = String.Format(@"{0}\ChatLog\TWChatLog_{1}.html", instDir, date.ToString("yyyy_MM_dd")); if (!File.Exists(logfile)) { return; } using (FileStream stream = new FileStream(logfile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (TextReader sr = new StreamReader(stream, Encoding.GetEncoding("Shift-JIS"))) { string line; while ((line = sr.ReadLine()) != null) { TwChatLog log = TwChatLog.createChatLog(date.ToString("yyyy/MM/dd"), line); if (log == null) { continue; } receiver.Receive(log); } } } }
public TwManager(TwLogReceiver receiver) { this.Receiver = receiver; this.ResolveTwInstallDirectory(); }
public TwLogWatcher(string InstDir, TwLogReceiver Receiver) { this.LogDir = $"{InstDir}\\ChatLog"; this.Receiver = Receiver; }