Exemple #1
0
        private static string calculateResponse(TypeSyntax type, SemanticModel model)
        {
            var typeSymbol = model.GetSymbolInfo(type).Symbol as ITypeSymbol;

            if (typeSymbol != null)
            {
                return(ResponseVisitor.Get(typeSymbol, "response"));
            }

            return(string.Empty);
        }
Exemple #2
0
        private void addProperty(ITypeSymbol type, string name)
        {
            _data.Push(name);
            try
            {
                var typeInstantiation = ResponseVisitor.Get(type, currentData());
                if (typeInstantiation == null)
                {
                    Success = false;
                    return;
                }

                _result.AppendLine($"{name} = {typeInstantiation},");
            }
            finally
            {
                _data.Pop();
            }
        }