protected virtual void CreateRouteDefinition() { routeDefinition = sourceGenerator.GenerateTypeDeclaration(@namespace, node.Name + "Route", routeDefinitions.Name); AddRouteDefinitionBaseType(); routeDefinition.Members.Add( CreateConstructor.WithParameters() .WithAttributes(MemberAttributes.Public) .WithBaseConstructorArgs(GetRouteDefinitionBaseConstructorArgs()) .Constructor); }
protected virtual CodeTypeDeclaration GenerateTypeDeclaration(string ns, string name) { CodeTypeDeclaration type = _source.GenerateTypeDeclaration(ns, name); CreateMemberFields(type); CodeConstructor constructor = _constructor = CreateServicesConstructor(); constructor.Statements.Add( new CodeAssignStatement(new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), _naming.ToMemberVariableName(_serviceIdentifier)), new CodeArgumentReferenceExpression(_naming.ToVariableName(_serviceIdentifier)))); type.Members.Add(constructor); return(type); }