11using System.Collections.Generic;
21 internal static class PropertyDefinitionExtractor
30 public static ExtractedPropertyDefinition ExtractPropertyDefinition(DefinitionExtractionContext extractionContext, PropertyDeclarationSyntax propertyDeclaration)
32 ExtractedPropertyDefinition propertyDefinition =
new ExtractedPropertyDefinition();
34 propertyDefinition.PropertyName = GetPropertyName(extractionContext, propertyDeclaration);
35 propertyDefinition.TypeDefinition.TypeName = GetPropertyTypeName(extractionContext, propertyDeclaration);
36 propertyDefinition.TypeDefinition.TypeNamespace = extractionContext.GetTypeNamespace(propertyDeclaration.Type);
37 propertyDefinition.TypeDefinition.IsAutoSerializable = extractionContext.IsTypeAutoSerializable(propertyDeclaration.Type);
38 propertyDefinition.TypeDefinition.ImplementsIMobileObject = extractionContext.DoesTypeImplementIMobileObject(propertyDeclaration.Type);
40 return propertyDefinition;
43 #region Private Helper Methods
51 private static string GetPropertyName(DefinitionExtractionContext extractionContext, PropertyDeclarationSyntax propertyDeclaration)
53 return propertyDeclaration.Identifier.ValueText;
62 private static string GetPropertyTypeName(DefinitionExtractionContext extractionContext, PropertyDeclarationSyntax propertyDeclaration)
64 return propertyDeclaration.Type.ToString();