Esempio n. 1
0
 public ThrownException CreateExceptionFor(ITypeSymbol symbolInfo, FAMIX.Method method)
 {
     FAMIX.ThrownException thrownException = this.CreateNewEntity <FAMIX.ThrownException>(typeof(FAMIX.ThrownException).FullName);
     thrownException.definingMethod = method;
     thrownException.exceptionClass = (FAMIX.Class) this.EnsureType(symbolInfo);
     return(thrownException);
 }
    public override void VisitThrowStatement(ThrowStatementSyntax node)
    {
        if (node.Expression != null)
        {
            var symbolInfo = importer.model.GetTypeInfo(node.Expression).Type;

            var exceptionClass = (FAMIX.Class)importer.EnsureType(symbolInfo);
            FAMIX.ThrownException thrownException = importer.New <FAMIX.ThrownException>();
            thrownException.definingMethod = currentMethod;
            thrownException.exceptionClass = exceptionClass;
        }
        base.VisitThrowStatement(node);
    }
Esempio n. 3
0
    public override void VisitThrowStatement(ThrowStatementSyntax node)
    {
        if (node.Expression != null)
        {
            var symbolInfo = semanticModel.GetTypeInfo(node.Expression).Type;

            var exceptionClass = importer.EnsureType(symbolInfo, typeof(FAMIX.Class));
            if (exceptionClass is FAMIX.ParameterizedType)
            {
                exceptionClass = ((ParameterizedType)exceptionClass).parameterizableClass;
            }
            FAMIX.ThrownException thrownException = importer.New <FAMIX.ThrownException>();
            thrownException.definingMethod = currentMethod;
            thrownException.exceptionClass = (FAMIX.Class)exceptionClass;
        }
        base.VisitThrowStatement(node);
    }