make the initial traversial class
This commit is contained in:
parent
7d14ca89bb
commit
f4cade1652
@ -177,6 +177,7 @@
|
||||
<DependentUpon>RTFWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SchoolworkClass.cs" />
|
||||
<Compile Include="TraversalClass.cs" />
|
||||
<Compile Include="TrippleDESDocumentEncryption.cs" />
|
||||
<Compile Include="VLANConfig.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
59
EduNetworkBuilder/TraversalClass.cs
Normal file
59
EduNetworkBuilder/TraversalClass.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EduNetworkBuilder
|
||||
{
|
||||
public class TraversalClass
|
||||
{
|
||||
protected struct TraversalRecord
|
||||
{
|
||||
public string host;
|
||||
public TraversalTechnology WhatUsed;
|
||||
|
||||
public TraversalRecord(string Host, TraversalTechnology what)
|
||||
{
|
||||
host = Host;
|
||||
WhatUsed = what;
|
||||
}
|
||||
}
|
||||
|
||||
List<TraversalRecord> PathTaken = new List<TraversalRecord>();
|
||||
|
||||
public TraversalClass(){ }
|
||||
|
||||
public TraversalClass(TraversalClass CloneFrom)
|
||||
{
|
||||
Clone(CloneFrom, this);
|
||||
}
|
||||
|
||||
public TraversalClass Clone()
|
||||
{
|
||||
TraversalClass newClass = new TraversalClass(this);
|
||||
return newClass;
|
||||
}
|
||||
|
||||
public static void Clone(TraversalClass source, TraversalClass dest)
|
||||
{
|
||||
dest.PathTaken.AddRange(source.PathTaken);
|
||||
}
|
||||
|
||||
public void AddPath(string Host, TraversalTechnology WithWhat)
|
||||
{
|
||||
PathTaken.Add(new TraversalRecord(Host, WithWhat));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is just a debug function to print off the whole path as we find it.
|
||||
/// </summary>
|
||||
public void DumpPath()
|
||||
{
|
||||
foreach(TraversalRecord one in PathTaken)
|
||||
{
|
||||
Console.WriteLine(string.Format("{0:12} : {1:-12}",one.host, one.WhatUsed.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user