private void _asyncClient_MessageRecieved(object sender, CommunicationObject communicationObject = null) { if (communicationObject.ActionType == CommunicationActionType.MessageRecieved) { NLogger.LogDebugToHdd($"Client: Answer received. Pipe name: \"{_pipeName}\"", MainSettings.Constants.PIPES_LOGGER_NAME); _isMessageRecieved = true; } else { if (communicationObject.Tag != null && (bool)(communicationObject.Tag)) { NLogger.LogDebugToHdd($"Client: Message recieved with sending answer: \"{communicationObject.ActionType.ToString()}\". Pipe name: \"{_pipeName}\"", MainSettings.Constants.PIPES_LOGGER_NAME); SendAsyncMessage(new CommunicationObject { ActionType = CommunicationActionType.MessageRecieved }); NLogger.LogDebugToHdd($"Client: Answer sended. Pipe name: \"{_pipeName}\"", MainSettings.Constants.PIPES_LOGGER_NAME); } else { NLogger.LogDebugToHdd($"Client: Message recieved: \"{communicationObject.ActionType.ToString()}\". Pipe name: \"{_pipeName}\"", MainSettings.Constants.PIPES_LOGGER_NAME); } var res = AsyncPipesAction(communicationObject); if (!res.IsComplete) { NLogger.LogErrorToBaseAndHdd(MainSettings.MainSqlSettings.ComputerId, res.Message); } } }
public static void StartAll() { if (_workloadAnalyzer != null) { return; } try { _workloadAnalyzer = new WorkloadAnalyzer(); _workloadAnalyzer.OnWorkloadAllSave += _workloadAnalyzer_OnWorkloadAllSave; _workloadAnalyzer.Start(); } catch (Exception ex) { NLogger.LogErrorToBaseAndHdd(MainSettings.MainSqlSettings.ComputerId, ex.ToString(), MainSettings.Constants.MAGIC_UPDATER); } }