示例#1
0
        _ParamInfo[] _GetParamInfos(CodeExpressionCollection parms, CodeDomResolverScope scope = null)
        {
            var result = new _ParamInfo[parms.Count];

            for (var i = 0; i < result.Length; i++)
            {
                CodeExpression e = parms[i];
                _ParamInfo     p = default(_ParamInfo);
                p.IsOptional = false;
                p.IsRetval   = false;
                var de = e as CodeDirectionExpression;
                if (null != de)
                {
                    switch (de.Direction)
                    {
                    case FieldDirection.In:
                        break;

                    case FieldDirection.Out:
                        p.IsOut = true;
                        break;

                    case FieldDirection.Ref:
                        p.IsIn = p.IsOut = true;
                        break;
                    }
                    e = de.Expression;
                }
                p.ParameterType = _resolver.GetTypeOfExpression(e, _scope);
                result[i]       = p;
            }
            return(result);
        }
示例#2
0
        _ParamInfo[] _GetParamInfos(CodeParameterDeclarationExpressionCollection parms, CodeDomResolverScope scope = null)
        {
            var result = new _ParamInfo[parms.Count];

            for (var i = 0; i < result.Length; i++)
            {
                _ParamInfo p = default(_ParamInfo);
                p.IsOptional   = false;
                p.IsRetval     = false;
                p.Name         = parms[i].Name;
                p.DefaultValue = DBNull.Value;
                var pd = parms[i];
                switch (pd.Direction)
                {
                case FieldDirection.In:
                    break;

                case FieldDirection.Out:
                    p.IsOut = true;
                    break;

                case FieldDirection.Ref:
                    p.IsIn = p.IsOut = true;
                    break;
                }
                p.ParameterType = pd.Type;
                if (null != scope)
                {
                    p.ParameterType = _resolver.GetQualifiedType(pd.Type, scope);
                }
                result[i] = p;
            }
            return(result);
        }
示例#3
0
        _ParamInfo[] _GetParamInfos(ParameterInfo[] parms)
        {
            var result = new _ParamInfo[parms.Length];

            for (var i = 0; i < result.Length; i++)
            {
                _ParamInfo p = default(_ParamInfo);
                p.IsOptional          = parms[i].IsOptional;
                p.IsRetval            = parms[i].IsRetval;
                p.Name                = parms[i].Name;
                p.RuntimeType         = parms[i].ParameterType;
                p.IsCOMObject         = p.RuntimeType.IsCOMObject;
                p.DefaultValue        = parms[i].DefaultValue;
                p.IsDefinedParamArray = parms[i].IsDefined(typeof(ParamArrayAttribute), true);
                var pd = parms[i];
                p.ParameterType = new CodeTypeReference(parms[i].ParameterType);
                result[i]       = p;
            }
            return(result);
        }