Ejemplo n.º 1
0
        /// <summary>
        /// Adds the port assignment data.
        /// </summary>
        /// <param name="portNumber">The port number.</param>
        /// <param name="assignmentState">State of the assignment.</param>
        internal void AddPortAssignmentData(string portNumber, FacilityAssignmentState assignmentState)
        {
            var targetPort = _fiberTerminalState.Ports.FirstOrDefault(p => p.PortNumber == portNumber);

            DomainValidation.Requires<InvalidDomainOperationException>
            (
                targetPort != null,
                string.Format("Could not update terminal port assignment data: port [{0}] not found", portNumber)
            );

            // ReSharper disable once PossibleNullReferenceException - caught by DomainValidation above
            targetPort.AssignmentState = assignmentState;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds the pair assignment data.
        /// </summary>
        /// <param name="cableNumber">The cable number.</param>
        /// <param name="pairNumber">The pair number.</param>
        /// <param name="assignmentState">State of the assignment.</param>
        internal void AddPairAssignmentData(string cableNumber, string pairNumber, FacilityAssignmentState assignmentState)
        {
            var targetPair = _copperTerminalState.Pairs.FirstOrDefault(p => p.CableNumber == cableNumber && p.PairNumber == pairNumber);

            DomainValidation.Requires<InvalidDomainOperationException>
            (
                targetPair != null,
                string.Format("Could not update terminal pair assignment data: pair [{0}] belonging to cable [{1}] not found", pairNumber, cableNumber)
            );

            // ReSharper disable once PossibleNullReferenceException - caught by DomainValidation above
            targetPair.AssignmentState = assignmentState;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FacilityAssignment"/> class.
 /// </summary>
 /// <param name="facilityAssignmentState">State of the facility assignment.</param>
 internal FacilityAssignment(FacilityAssignmentState facilityAssignmentState)
 {
     _facilityAssignmentState = facilityAssignmentState;
 }