Ejemplo n.º 1
0
 public ExtendedProperty(string uid, KeyValuePair <string, JToken> keyValuePair, int depth)
 {
     //this.depth = depth;
     this.Uid          = uid + "_" + keyValuePair.Key;
     this.KeyValuePair = keyValuePair;
     UpdateNameByNamingConventionsType();
     this.type            = DartHelper.ConverDartType(keyValuePair.Value.Type);
     PropertyAccessorType = ConfigHelper.Instance.Config.PropertyAccessorType;
 }
Ejemplo n.º 2
0
        public static AccessorDeclarationSyntax PropertyAccessor(
            PropertyAccessorType type)
        {
            AccessorDeclarationSyntax node = SyntaxFactory.AccessorDeclaration(type == PropertyAccessorType.Get ? SyntaxKind.GetAccessorDeclaration : SyntaxKind.SetAccessorDeclaration, (BlockSyntax)null).WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)).AppendWhitespace <AccessorDeclarationSyntax>();

            if (type == PropertyAccessorType.Get)
            {
                node = node.PrependWhitespace <AccessorDeclarationSyntax>();
            }
            return(node);
        }
Ejemplo n.º 3
0
        public static AccessorDeclarationSyntax PropertyAccessor(PropertyAccessorType type)
        {
            var syntaxKind = type == PropertyAccessorType.Get ? SyntaxKind.GetAccessorDeclaration : SyntaxKind.SetAccessorDeclaration;

            var accessor = SyntaxFactory.AccessorDeclaration(syntaxKind).WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)).AppendWhitespace();

            if (type == PropertyAccessorType.Get)
            {
                accessor = accessor.PrependWhitespace();
            }

            return(accessor);
        }
Ejemplo n.º 4
0
        public static String FactorySetString(PropertyAccessorType type)
        {
            switch (type)
            {
            case PropertyAccessorType.None:
            case PropertyAccessorType.Final:
                return("this.{0},");

            case PropertyAccessorType.Get:
            case PropertyAccessorType.GetSet:
                return("{0} {1},");
            }
            return("this.{0},");
        }
Ejemplo n.º 5
0
 public static String PropertyS(PropertyAccessorType type)
 {
     switch (type)
     {
         case PropertyAccessorType.None:
             return PropertyString;
         case PropertyAccessorType.Final:
             return PropertyStringFinal;
         case PropertyAccessorType.Get:
             return PropertyStringGet;
         case PropertyAccessorType.GetSet:
             return PropertyStringGetSet;
     }
     return "";
 }
Ejemplo n.º 6
0
        public static String PropertyS(PropertyAccessorType type)
        {
            switch (type)
            {
            case PropertyAccessorType.None:
                return(PropertyString);

            case PropertyAccessorType.Final:
                return(PropertyStringFinal);

            case PropertyAccessorType.Get:
                return(PropertyStringGet);

            case PropertyAccessorType.GetSet:
                return(PropertyStringGetSet);
            }
            return("");
        }
Ejemplo n.º 7
0
 public virtual void UpdatePropertyAccessorType()
 {
     PropertyAccessorType = ConfigHelper.Instance.Config.PropertyAccessorType;
 }