示例#1
0
 private void GetRequiredParameters()
 {
     List<string> listPassed = PassAllowedParametersToBase();
     if ((listPassed != null) && (listPassed.Count > 0))
     {
         if (listPassed.Count > allowedParameters.Count)
         {
             HandlerError newError = new HandlerError(HandlerErrorTypes.RequiredMoreThanAllowed);
             HandleError(newError);
         }
         else
         {
             foreach (string item in listPassed)
             {
                 if (item == null)
                 {
                     HandlerError newError = new HandlerError(HandlerErrorTypes.RequiredTypeNull);
                     HandleError(newError);
                 }
                 else if (NameListContains(item, requiredParameters))
                 {
                     HandlerError newError = new HandlerError(HandlerErrorTypes.DuplicateRequiredType);
                     HandleError(newError);
                 }
                 else if (!NameListContains(item, allowedParameters))
                 {
                     HandlerError newError = new HandlerError(HandlerErrorTypes.RequiredNotAllowed);
                     HandleError(newError);
                 }
                 else
                 {
                     requiredParameters.Add(item);
                 }
             }
         }
     }
 }
示例#2
0
        private void CreateNewParameter(string namePassed, string textPassed)
        {
            ParameterBase newParameter = null;

            if (customParameterDefinitions.Count > 0)
            {
                newParameter = CreateNewCustomDefinedParameter(namePassed, textPassed);
            }
            if (newParameter == null)
            {
                newParameter = CreateNewDefaultParameter(namePassed, textPassed);
            }

            if (newParameter == null)
            {
                HandlerError newError = new HandlerError(HandlerErrorTypes.ParameterNotFound);
                HandleError(newError);
            }
            else
            {
                parameters.Add(newParameter);
            }
        }