Пример #1
0
        public SyntaxProperty(PropertyInfo property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            DeclaringType = SyntaxType.GetType(property.DeclaringType);
            Name          = property.Name;
            PropertyType  = property.PropertyType;
        }
Пример #2
0
        public bool IsAssignableFrom(SyntaxType type)
        {
            while (type != null)
            {
                if (type == this)
                    return true;

                type = type.BaseType;
            }

            return false;
        }
Пример #3
0
        public bool IsAssignableFrom(SyntaxType type)
        {
            while (type != null)
            {
                if (type == this)
                {
                    return(true);
                }

                type = type.BaseType;
            }

            return(false);
        }
Пример #4
0
        public SyntaxMethod(MethodInfo method)
            : this()
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            ReturnType = SyntaxType.GetType(method.ReturnType);
            Name       = method.Name;

            foreach (var parameter in method.GetParameters())
            {
                Parameters.Add(new SyntaxParameter(parameter));
            }
        }
Пример #5
0
        private static SyntaxType GetAwaitType()
        {
            if (_awaitType == null)
            {
                _awaitType = new SyntaxType
                {
                    Name = "AwaitExpressionSyntax",
                    BaseType = SyntaxType.GetType(typeof(ExpressionSyntax))
                };

                _awaitType.Properties.Add(new SyntaxProperty
                {
                    DeclaringType = _awaitType,
                    Name = "Expression",
                    PropertyType = typeof(ExpressionSyntax)
                });
            }

            return _awaitType;
        }