コード例 #1
0
        public void Import(IEnumerable<ScanHost> hosts, ContainerInfo destinationContainer)
        {
            var deserializer = new PortScanDeserializer(hosts, _targetProtocolType);
            var connectionTreeModel = deserializer.Deserialize();

            var importedRootNode = connectionTreeModel.RootNodes.First();
            if (importedRootNode == null) return;
            var childrenToAdd = importedRootNode.Children.ToArray();
            destinationContainer.AddChildRange(childrenToAdd);
        }
コード例 #2
0
 public void OnetimeSetup()
 {
     var host = new ScanHost("10.20.30.40")
     {
         HostName = "server1.domain.com",
         SSH = true
     };
     _deserializer = new PortScanDeserializer(new [] {host}, ProtocolType.SSH2);
     _deserializer.Deserialize();
     var connectionTreeModel = _deserializer.Deserialize();
     var root = connectionTreeModel.RootNodes.First();
     _importedConnectionInfo = root.Children.First();
 }
コード例 #3
0
 public void OnetimeTeardown()
 {
     _deserializer = null;
     _importedConnectionInfo = null;
 }