Stores configuration entries for SharedDirectoryMapper extension.
Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
        public SharedDirectoryMapper(bool enableMapping, string directoryUNC, string driveLabel)
        {
            SharedDirectoryMapperConfig config = new SharedDirectoryMapperConfig(enableMapping, driveLabel, directoryUNC);

            _entries.Add(config);
        }
Ejemplo n.º 6
0
 public SharedDirectoryMapper(bool enableMapping, string directoryUNC, string driveLabel)
 {
     SharedDirectoryMapperConfig config = new SharedDirectoryMapperConfig(enableMapping, driveLabel, directoryUNC);
     _entries.Add(config);
 }
Ejemplo n.º 7
0
 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);
 }