示例#1
0
 public Method(string name, string type, Parameter[] parameters)
     : this(name, type)
 {
     foreach (Parameter parameter in parameters)
     {
         this.parameters.Add(parameter);
     }
 }
示例#2
0
        public void AddParameter(Parameter parameter)
        {
            foreach (Parameter p in this.parameters)
            {
                if (p.Name == parameter.Name)
                {
                    return;
                }
            }

            this.parameters.Add(parameter);
        }
示例#3
0
 public Request(string name, Parameter[] parameters)
     : base(name, Const.REQUEST, parameters)
 {
 }
示例#4
0
 public Response(string name, Parameter[] parameters)
     : base(name, Const.REPONSE, parameters)
 {
 }
示例#5
0
        public static new Parameter Parse(XmlElement parameter)
        {
            if (parameter == null)
            {
                throw new Exception("parameter can't be null!");
            }

            string type = string.Empty; 
            string direction = string.Empty;

            if (parameter.HasAttribute("Type"))
            {
                type = parameter.GetAttribute("Type");
            }
            else
            {
                throw new Exception("load hasn't type attribute!");
            }

            if (parameter.HasAttribute("Direction"))
            {
                direction = parameter.GetAttribute("Direction");
            }
            else
            {
                throw new Exception("parameter hasn't direction attribute!");
            }

            Direction enumDirection = (Direction)Enum.Parse(typeof(Direction), direction);

            Parameter result = new Parameter(enumDirection, parameter.Name, type, parameter.InnerText);

            return result;

        }