bin/projects/dbatools/dbatools/Discovery/DbaPortReport.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
using System;
using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sqlcollaborative.Dbatools.Discovery { /// <summary> /// We tried to connect to a port, how did it go? /// </summary> [Serializable] public class DbaPortReport { /// <summary> /// The name of the computer connected to /// </summary> public string ComputerName; /// <summary> /// The number of the port we tried to connect to. /// </summary> public int Port; /// <summary> /// Whether the port was open /// </summary> public bool IsOpen; /// <summary> /// Creates an empty report (serialization uses this) /// </summary> public DbaPortReport() { } /// <summary> /// Creates a filled in report /// </summary> /// <param name="ComputerName">The name of the computer connected to</param> /// <param name="Port">The port we tried to connect to</param> /// <param name="IsOpen">Whether things worked out</param> public DbaPortReport(string ComputerName, int Port, bool IsOpen) { this.ComputerName = ComputerName; this.Port = Port; this.IsOpen = IsOpen; } /// <summary> /// Displays port connection reports in a user friendly manner /// </summary> /// <returns></returns> public override string ToString() { return String.Format("{0}:{1} - {2}", ComputerName, Port, IsOpen); } } } |