private GatheringPointsInfo CreateGatheringPointsInfo(ParserTypeInfo parserInfo, string alias, string bcrip, string logPath) { var gatherInfo = new GatheringPointsInfo(parserInfo); if (gatherInfo != null) { gatherInfo.AgentIp = GetIpAddress().ToString(); gatherInfo.Alias = alias; gatherInfo.BcrIp = bcrip; gatherInfo.LogFolder = logPath; gatherInfo.Line = alias; gatherInfo.NO = (GetMaxNO() + 1).ToString(); } return(gatherInfo); }
private TaskInfo CreateTaskInfo(string filter, GatheringPointsInfo gInfo, WatcherType type = WatcherType.NONE) { try { var taskInfo = new TaskInfo(); if (gInfo != null && ConfigInfo != null) { taskInfo.Filter = filter; taskInfo.Index = gInfo.NO; } taskInfo.Watcher = WatcherFactory.CreateWatcher(gInfo, ConfigInfo, FtpInfo, SetFilter(filter), type); taskInfo.ProcessingTask = new Task(StartProcessing, taskInfo, TaskCreationOptions.LongRunning); return(taskInfo); } catch (Exception ex) { AppEvents.Instance.OnUpdateScreen("Error : " + ex.Message); return(null); } }