public Data_Net__02ScreenshotRequest ReadOne(NiceSystemInfo niceSystem, string fileName, IMyLog log) { try { WithAndWithoutUnderline ww = new WithAndWithoutUnderline( FolderNames.GetFolder(niceSystem, MyFolders.ASP_QueuedMessages_), fileName); Data_Net__02ScreenshotRequest o = null; Stream stream = OpenFile.ForRead(ww.Existing, false, false, log); if (stream == null) { return(null); } using (BinaryReader br = new BinaryReader(stream)) { ASPTrayBase ox = ASPTrayBase.ReadOne(br); if (ox.GetEnumType() == ASPTrayBase.eASPtrayType.ScreenShotRequest) { o = (Data_Net__02ScreenshotRequest)ox; } } return(o); } catch (SystemException se) { log.Error("*** SystemException ***"); log.Error(se.Message); } return(null); }
public Data_Net__00NormalMessage ReadOne(NiceSystemInfo niceSystem, string fileName, Data_Net__00NormalMessage.eLocation location, IMyLog log) { try { WithAndWithoutUnderline ww = new WithAndWithoutUnderline( FolderNames.GetFolder(niceSystem, eLocationToMyFolder(location)), fileName); Data_Net__00NormalMessage o = null; Stream stream = OpenFile.ForRead(ww.Existing, false, false, log); if (stream == null) { return(null); } using (BinaryReader br = new BinaryReader(stream)) { ASPTrayBase ox = ASPTrayBase.ReadOne(br); if (ox.GetEnumType() == ASPTrayBase.eASPtrayType.NormalMessage) { o = (Data_Net__00NormalMessage)ox; } } return(o); } catch (SystemException se) { log.Error("*** SystemException ***"); log.Error(se.Message); } return(null); }
public void ForEach(NiceSystemInfo niceSystem, IMyLog log, dProcess_Data_Net__02ScreenshotRequest cb) { try { foreach (var f1 in Directory.GetFiles(FolderNames.GetFolder(niceSystem, MyFolders.ASP_QueuedMessages_))) { if (!ASPTrayBase.s_MsgFile_IsOld(f1)) { ASPTrayBase d1 = ASPTrayBase.ReadOne(f1, log); if ((d1 != null) && (d1.GetEnumType() == ASPTrayBase.eASPtrayType.ScreenShotRequest)) { cb((Data_Net__02ScreenshotRequest)d1); } } } } catch (SystemException se) { log.Error("*** SystemException ***"); log.Error(se.Message); } }
private void forEach(NiceSystemInfo niceSystem, DateTime newerThan, string containsUser, MyFolders folder, IMyLog log, dProcess_Data_Net__00NormalMessage cb) { foreach (var f1 in Directory.GetFiles(FolderNames.GetFolder(niceSystem, folder))) { if ((containsUser != null) && (!f1.Contains(containsUser))) { // wrong user continue; } DateTime fileTime = ASPTrayBase.s_MsgFile_GetDateTimeOfMessageFile(f1); if (fileTime >= newerThan) { if (!ASPTrayBase.s_MsgFile_IsOld(f1)) { ASPTrayBase d1 = ASPTrayBase.ReadOne(f1, log); if ((d1 != null) && (d1.GetEnumType() == ASPTrayBase.eASPtrayType.NormalMessage)) { cb((Data_Net__00NormalMessage)d1); } } } } }