コード例 #1
0
        /// <summary>
        /// Validates the get incumbents request.
        /// </summary>
        /// <param name="parameters">The parameters.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public override bool ValidateGetIncumbentsRequest(Parameters parameters, out List <string> errorMessages)
        {
            if (!this.ValidateRequiredIncumbentType(parameters, out errorMessages))
            {
                return(false);
            }

            errorMessages = new List <string>();

            Entities.IncumbentType incumbentType = Conversion.ToIncumbentType(parameters.IncumbentType);
            if (incumbentType == Entities.IncumbentType.None)
            {
                errorMessages.Add(Constants.ErrorMessageInvalidIncumbentType);
                return(false);
            }

            if (incumbentType == Entities.IncumbentType.Fixed || incumbentType == Entities.IncumbentType.Mode_1 || incumbentType == Entities.IncumbentType.Mode_2)
            {
                return(errorMessages.Count == 0);
            }
            else
            {
                errorMessages.Add(Constants.ErrorMessageInvalidIncumbentType);
                return(false);
            }
        }
コード例 #2
0
        /// <summary>
        /// Validates the Get Device List request.
        /// </summary>
        /// <param name="parameters">The parameters.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
        public override bool ValidateGetChannelListRequest(Parameters parameters, out List <string> errorMessages)
        {
            if (!this.ValidateRequiredIncumbentType(parameters, out errorMessages))
            {
                return(false);
            }

            errorMessages = new List <string>();

            Entities.IncumbentType incumbentType = Conversion.ToIncumbentType(parameters.IncumbentType);
            if (incumbentType == Entities.IncumbentType.None)
            {
                errorMessages.Add(Constants.ErrorMessageInvalidIncumbentType);
                return(false);
            }

            var allowedIncumbentTypes = new[] { Entities.IncumbentType.Fixed, Entities.IncumbentType.Mode_1, Entities.IncumbentType.Mode_2, Entities.IncumbentType.LPAux, Entities.IncumbentType.TBAS, Entities.IncumbentType.UnlicensedLPAux };

            if (!allowedIncumbentTypes.Contains(incumbentType))
            {
                errorMessages.Add(Constants.ErrorMessageInvalidIncumbentType);
                return(false);
            }

            if (incumbentType == Entities.IncumbentType.LPAux || incumbentType == Entities.IncumbentType.UnlicensedLPAux)
            {
                if (parameters.QuadrilateralArea == null && parameters.PointsArea == null)
                {
                    errorMessages.Add(Constants.ErrorMessageLpAuxAreaRequired);
                    return(false);
                }

                if (parameters.QuadrilateralArea != null)
                {
                    foreach (var quadrilateralArea in parameters.QuadrilateralArea)
                    {
                        if (!this.AreQuadrilateralVerticesValid(quadrilateralArea))
                        {
                            errorMessages.Add(Constants.ErrorMessageLpAuxQuadAreaInvalidVertices);
                            return(false);
                        }
                    }
                }
            }
            else
            {
                if (!this.Location(parameters, out errorMessages))
                {
                    return(false);
                }
            }

            return(errorMessages.Count == 0);
        }