/// <summary> /// Creates new interface row and assigns default values /// </summary> /// <param name="segmentID">Segment id</param> /// <param name="pPrefix">prefix of the name</param> /// <returns>New <see cref="InterfacesRow"/></returns> public InterfacesRow NewInterfacesRow(long segmentID, string pPrefix) { InterfacesRow dr = NewInterfacesRow(); dr.InterfaceNum = 0; dr.SegmentId = segmentID; dr.Name = string.Format("{0}{1}Port", pPrefix, m_IdentSep); return(dr); }
/// <summary> /// Initializes a new instance of the <see cref="InterfaceParameters"/> structure. /// </summary> /// <param name="interfacesRow">The interfaces row.</param> public InterfaceParameters(InterfacesRow interfacesRow) { InactivityTime = TimeSpan.FromMilliseconds(interfacesRow.InactTime); InactivityAfterFailureTime = TimeSpan.FromMilliseconds(interfacesRow.InactTimeAFailure); Name = interfacesRow.Name; Address = (ushort)Math.Min(interfacesRow.Address, ushort.MaxValue); InterfaceNumber = (byte)Math.Min(interfacesRow.InterfaceNum, byte.MaxValue); if (InterfaceNumber > InterfaceNumberMaxValue) { throw new ArgumentOutOfRangeException("InterfaceNumber > InterfaceNumberMaxValue"); } }