/// <summary> /// CheckForReplay method implementation /// </summary> public bool Check(List <string> servernames, ReplayRecord record) { bool tempresult = false; try { lock (_lock) { tempresult = _manager.AddToReplay(record); if (tempresult) { if ((record.MustDispatch) && (servernames != null)) { foreach (string fqdn in servernames) { ReplayClient replaymanager = new ReplayClient(); try { replaymanager.Initialize(fqdn); IReplay client = replaymanager.Open(); try { record.MustDispatch = false; tempresult = client.Check(servernames, record); } catch (Exception e) { _log.WriteEntry(string.Format("Error on Check Remote Service method : {0} => {1}.", fqdn, e.Message), EventLogEntryType.Error, 1011); } finally { replaymanager.Close(client); } } catch (Exception e) { _log.WriteEntry(string.Format("Error on Check Remote Service method : {0} => {1}.", fqdn, e.Message), EventLogEntryType.Error, 1011); } } } } } } catch (Exception e) { _log.WriteEntry(string.Format("Error on Check Service method : {0}.", e.Message), EventLogEntryType.Error, 1010); } return(tempresult); }
/// <summary> /// Continue method iplementation /// </summary> public static bool Check(List <string> computers, ReplayRecord record) { ReplayClient manager = new ReplayClient(); manager.Initialize(); try { IReplay client = manager.Open(); try { return(client.Check(computers, record)); } finally { manager.Close(client); } } finally { manager.UnInitialize(); } }