public StructNestedStructWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name) : this() { Syntax = StructDeclarationSyntaxExtensions.ToSyntax(name, visibility); }
public StructPropertyWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, string name, MethodBodyWithCodeAnalysis getAccessor, MethodBodyWithCodeAnalysis setAccessor) : this() { List <AccessorDeclarationSyntax> accessorSyntax = new List <AccessorDeclarationSyntax>(); if (getAccessor != null) { accessorSyntax.Add(SyntaxFactory.AccessorDeclaration(SyntaxKind.GetKeyword, getAccessor.Syntax)); } if (setAccessor != null) { accessorSyntax.Add(SyntaxFactory.AccessorDeclaration(SyntaxKind.SetKeyword, setAccessor.Syntax)); } Syntax = SyntaxFactory.PropertyDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), type.Syntax, null, SyntaxFactory.Identifier(name), SyntaxFactory.AccessorList(SyntaxFactory.List(accessorSyntax))); }
public PartialStructEventWithCodeAnalysis( StructMemberVisibilityModifier visibility, DelegateReferenceWithCodeAnalysis type, string name) : this(new StructEventWithCodeAnalysis(visibility, type, name)) { }
public StructIndexerWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, IEnumerable <IndexerParameterWithCodeAnalysis> parameters, MethodBodyWithCodeAnalysis getAccessor, MethodBodyWithCodeAnalysis setAccessor) : this() { var parameterSyntax = parameters.Select(parameter => parameter.Syntax); List <AccessorDeclarationSyntax> accessorSyntax = new List <AccessorDeclarationSyntax>(); if (getAccessor != null) { accessorSyntax.Add(SyntaxFactory.AccessorDeclaration(SyntaxKind.GetKeyword, getAccessor.Syntax)); } if (setAccessor != null) { accessorSyntax.Add(SyntaxFactory.AccessorDeclaration(SyntaxKind.SetKeyword, setAccessor.Syntax)); } Syntax = SyntaxFactory.IndexerDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), type.Syntax, null, SyntaxFactory.BracketedParameterList(SyntaxFactory.SeparatedList(parameterSyntax)), SyntaxFactory.AccessorList(SyntaxFactory.List(accessorSyntax))); }
public PartialStructFieldWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, params string[] names) : this(new StructFieldWithCodeAnalysis(visibility, type, names)) { }
public StructNestedSealedClassWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name) : this() { Syntax = ClassDeclarationSyntaxExtensions.ToSyntax(name, visibility, SyntaxKind.SealedKeyword); }
public static SyntaxTokenList WithStructMemberVisibilityModifier( this SyntaxTokenList tokens, StructMemberVisibilityModifier modifier) { return(tokens.WithClassMemberVisibilityModifier( structVisibilityModifierMap.First(entry => entry.Value == modifier).Key)); }
public PartialStructConstantWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, params ConstantWithCodeAnalysis[] constants) : this(new StructConstantWithCodeAnalysis(visibility, type, constants)) { }
public StructConstantWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, string name, IExpressionWithCodeAnalysis value) : this(visibility, type, new ConstantWithCodeAnalysis(name, value)) { }
public PartialStructNestedDelegateWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis returnType, string name, IEnumerable <DelegateParameterWithCodeAnalysis> parameters) : this(new StructNestedDelegateWithCodeAnalysis(visibility, returnType, name, parameters)) { }
public PartialStructConstructorWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name, IEnumerable <ConstructorParameterWithCodeAnalysis> parameters, MethodBodyWithCodeAnalysis body) : this(new StructConstructorWithCodeAnalysis(visibility, name, parameters, body)) { }
public PartialStructIndexerWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, IEnumerable <IndexerParameterWithCodeAnalysis> parameters, MethodBodyWithCodeAnalysis getAccessor, MethodBodyWithCodeAnalysis setAccessor) : this(new StructIndexerWithCodeAnalysis(visibility, type, parameters, getAccessor, setAccessor)) { }
public PartialStructPropertyWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, string name, MethodBodyWithCodeAnalysis getAccessor, MethodBodyWithCodeAnalysis setAccessor) : this(new StructPropertyWithCodeAnalysis(visibility, type, name, getAccessor, setAccessor)) { }
public PartialStructEventPropertyWithCodeAnalysis( StructMemberVisibilityModifier visibility, DelegateReferenceWithCodeAnalysis type, string name, MethodBodyWithCodeAnalysis addAccessor, MethodBodyWithCodeAnalysis removeAccessor) : this(new StructEventPropertyWithCodeAnalysis(visibility, type, name, addAccessor, removeAccessor)) { }
public PartialStructMethodWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis returnType, string name, IEnumerable <MethodParameterWithCodeAnalysis> parameters, MethodBodyWithCodeAnalysis body) : this(new StructMethodWithCodeAnalysis(visibility, returnType, name, parameters, body)) { }
public static ClassDeclarationSyntax ToSyntax( string name, StructMemberVisibilityModifier visibility, params SyntaxKind[] modifiers) { return(ToSyntax( name, default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility).AddRange(modifiers))); }
public StructNestedAbstractPartialClassWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name) : this() { Syntax = ClassDeclarationSyntaxExtensions.ToSyntax( name, visibility, SyntaxKind.AbstractKeyword, SyntaxKind.PartialKeyword); }
public StructFieldWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, params string[] names) : this() { Syntax = SyntaxFactory.FieldDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), SyntaxFactory.VariableDeclaration(type.Syntax, SyntaxFactory.SeparatedList(names.Select(SyntaxFactory.VariableDeclarator)))); }
internal static void AddStructMemberVisibilityModifierSteps( this List <ISourceCodeBuilderStep> steps, StructMemberVisibilityModifier visibility) { if (visibility == StructMemberVisibilityModifier.None) { return; } steps.Add(new WriteStructMemberVisibilityModifier(visibility)); steps.Add(new WriteWhitespace()); }
public StructNestedEnumWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name) : this() { Syntax = SyntaxFactory.EnumDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), SyntaxFactory.Identifier(name), null, default(SeparatedSyntaxList <EnumMemberDeclarationSyntax>)); }
public StructConstantWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis type, params ConstantWithCodeAnalysis[] constants) : this() { IEnumerable <VariableDeclaratorSyntax> syntax = constants.Select(constant => constant.Syntax); Syntax = SyntaxFactory.FieldDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), SyntaxFactory.VariableDeclaration(type.Syntax, SyntaxFactory.SeparatedList(syntax))); }
public StructEventWithCodeAnalysis( StructMemberVisibilityModifier visibility, DelegateReferenceWithCodeAnalysis type, string name) : this() { VariableDeclaratorSyntax syntax = SyntaxFactory.VariableDeclarator(name); Syntax = SyntaxFactory.EventFieldDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), SyntaxFactory.VariableDeclaration(type.Syntax, SyntaxFactory.SingletonSeparatedList(syntax))); }
public StructNestedInterfaceWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name) : this() { Syntax = SyntaxFactory.InterfaceDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), SyntaxFactory.Identifier(name), null, null, default(SyntaxList <TypeParameterConstraintClauseSyntax>), default(SyntaxList <MemberDeclarationSyntax>)); }
public StructConstructorWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name, IEnumerable <ConstructorParameterWithCodeAnalysis> parameters, MethodBodyWithCodeAnalysis body) : this() { Syntax = SyntaxFactory.ConstructorDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), SyntaxFactory.Identifier(name), SyntaxFactory.ParameterList(SyntaxFactory.SeparatedList(parameters.Select(parameter => parameter.Syntax))), null, body.Syntax); }
public StructNestedDelegateWithCodeAnalysis( StructMemberVisibilityModifier visibility, ITypeReferenceWithCodeAnalysis returnType, string name, IEnumerable <DelegateParameterWithCodeAnalysis> parameters) : this() { Syntax = SyntaxFactory.DelegateDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), returnType.Syntax, SyntaxFactory.Identifier(name), null, SyntaxFactory.ParameterList(SyntaxFactory.SeparatedList(parameters.Select(parameter => parameter.Syntax))), default(SyntaxList <TypeParameterConstraintClauseSyntax>)); }
public StructEventPropertyWithCodeAnalysis( StructMemberVisibilityModifier visibility, DelegateReferenceWithCodeAnalysis type, string name, MethodBodyWithCodeAnalysis addAccessor, MethodBodyWithCodeAnalysis removeAccessor) : this() { IEnumerable <AccessorDeclarationSyntax> accessors = new AccessorDeclarationSyntax[] { SyntaxFactory.AccessorDeclaration(SyntaxKind.AddKeyword, addAccessor.Syntax), SyntaxFactory.AccessorDeclaration(SyntaxKind.RemoveKeyword, removeAccessor.Syntax) }; Syntax = SyntaxFactory.EventDeclaration( default(SyntaxList <AttributeListSyntax>), default(SyntaxTokenList).WithStructMemberVisibilityModifier(visibility), type.Syntax, null, SyntaxFactory.Identifier(name), SyntaxFactory.AccessorList(SyntaxFactory.List(accessors))); }
internal StructAccessorWithMonoCecil(IHasStructMemberVisibilityModifier parentVisibility, AccessorWithMonoCecil accessor) { this.accessor = accessor; StructMemberVisibilityModifier structVisibility = accessor.MethodDefinition.StructVisibility(); if (parentVisibility.Visibility == structVisibility) { visibility = StructAccessorVisibilityModifier.None; } else { switch (structVisibility) { case StructMemberVisibilityModifier.Internal: visibility = StructAccessorVisibilityModifier.Internal; break; case StructMemberVisibilityModifier.Private: visibility = StructAccessorVisibilityModifier.Private; break; } } }
public PartialStructNestedAbstractClassWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name) : this(new StructNestedAbstractClassWithCodeAnalysis(visibility, name)) { }
public WriteStructMemberVisibilityModifier(StructMemberVisibilityModifier modifier) { Modifier = modifier; }
public PartialStructNestedInterfaceWithCodeAnalysis( StructMemberVisibilityModifier visibility, string name) : this(new StructNestedInterfaceWithCodeAnalysis(visibility, name)) { }