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; }
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); }
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); }
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},"); }
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 ""; }
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(""); }
public virtual void UpdatePropertyAccessorType() { PropertyAccessorType = ConfigHelper.Instance.Config.PropertyAccessorType; }