public void OpenHandle(string hostname) { try { if (fileHandle == null) { fileHandle = HandleAdapter.OpenHandle(hostname); } } catch (Exception e) { Logger.LogException("EventViewerPlugin.OpenEventLog", e); fileHandle = null; } }
public void CloseEventLog() { if (fileHandle == null) { return; } fileHandle.Dispose(); fileHandle = null; }
private void ConnectToHost() { Logger.Log("FileShareManagerPlugIn.ConnectToHost", Logger.FileShareManagerLogLevel); if (_hn.creds.Invalidated) { _container.ShowError("File Browser PlugIn cannot connect to domain due to invalid credentials"); _hn.IsConnectionSuccess = false; return; } if (!String.IsNullOrEmpty(_hn.hostName)) { if (_currentHost != _hn.hostName) { if (fileHandle != null) { fileHandle.Dispose(); fileHandle = null; } if (_pluginNode != null && !String.IsNullOrEmpty(_hn.hostName)) { OpenHandle(_hn.hostName); } _currentHost = _hn.hostName; } _hn.IsConnectionSuccess = true; } else _hn.IsConnectionSuccess = false; }