コード例 #1
0
        private static IType GetQualifierExpressionType([CanBeNull] ICSharpExpression qualifierExpression, [NotNull] ICSharpTreeNode context)
        {
            if (qualifierExpression.IsThisOrBaseOrNull())
            {
                var structDeclaration = context.GetContainingTypeDeclaration() as IStructDeclaration;

                var structTypeElement = structDeclaration?.DeclaredElement;
                if (structTypeElement == null)
                {
                    return(null);
                }

                return(TypeFactory.CreateType(structTypeElement));
            }

            var expressionType = qualifierExpression.GetExpressionType();

            return(expressionType.ToIType());
        }
コード例 #2
0
        public bool IsUnder(ICSharpTreeNode node)
        {
            var store       = node.GetSettingsStore();
            var customTypes = store.EnumIndexedValues(AsyncConverterSettingsAccessor.ConfigureAwaitIgnoreAttributeTypes).ToArray();

            if (customTypes.IsNullOrEmpty())
            {
                return(false);
            }

            var containingFunctionLikeDeclarationOrClosure = node.GetContainingTypeDeclaration();

            if (containingFunctionLikeDeclarationOrClosure?.ContainsAttribute(customTypes) == true)
            {
                return(true);
            }

            return(false);
        }
コード例 #3
0
ファイル: TreeNodeBase.cs プロジェクト: igor-toporet/TestFx
 public ICSharpTypeDeclaration GetContainingTypeDeclaration()
 {
     return(_treeNode.GetContainingTypeDeclaration());
 }