private void HandleMappingError(SharedDirectoryMapperConfig config, IEventWriter eventWriter, MapperException ex) { String prefix = "Mapping of " + config.Label + " "; eventWriter.LogEvent(prefix + "STDOUT: " + ex.Process.StandardOutput.ReadToEnd(), EventLogEntryType.Information); eventWriter.LogEvent(prefix + "STDERR: " + ex.Process.StandardError.ReadToEnd(), EventLogEntryType.Information); throw new ExtensionException(Descriptor.Id, DisplayName + ": " + prefix + "failed", ex); }
public override void Configure(ServiceDescriptor descriptor, XmlNode node) { XmlNodeList?mapNodes = XmlHelper.SingleNode(node, "mapping", false) !.SelectNodes("map"); if (mapNodes != null) { for (int i = 0; i < mapNodes.Count; i++) { if (mapNodes[i] is XmlElement mapElement) { var config = SharedDirectoryMapperConfig.FromXml(mapElement); _entries.Add(config); } } } }
public override void Configure(ServiceDescriptor descriptor, XmlNode node) { var nodes = XmlHelper.SingleNode(node, "mapping", false).SelectNodes("map"); if (nodes != null) { foreach (XmlNode mapNode in nodes) { var mapElement = mapNode as XmlElement; if (mapElement != null) { var config = SharedDirectoryMapperConfig.FromXml(mapElement); _entries.Add(config); } } } }
private void HandleMappingError(SharedDirectoryMapperConfig config, MapperException ex) { Logger.Error("Mapping of " + config.Label + " failed. STDOUT: " + ex.Process.StandardOutput.ReadToEnd() + " \r\nSTDERR: " + ex.Process.StandardError.ReadToEnd(), ex); throw new ExtensionException(Descriptor.Id, DisplayName + ": Mapping of " + config.Label + "failed", ex); }
public SharedDirectoryMapper(bool enableMapping, string directoryUNC, string driveLabel) { SharedDirectoryMapperConfig config = new SharedDirectoryMapperConfig(enableMapping, driveLabel, directoryUNC); _entries.Add(config); }