Exemple #1
0
        private static MemberDeclarationSyntax GenerateInterfaceVersionProperty(Type grainType)
        {
            var property    = TypeUtils.Member((GrainReference _) => _.InterfaceVersion);
            var returnValue = SF.LiteralExpression(
                SyntaxKind.NumericLiteralExpression,
                SF.Literal(GrainInterfaceUtils.GetGrainInterfaceVersion(grainType)));

            return
                (SF.PropertyDeclaration(typeof(ushort).GetTypeSyntax(), property.Name)
                 .AddAccessorListAccessors(
                     SF.AccessorDeclaration(SyntaxKind.GetAccessorDeclaration)
                     .AddBodyStatements(SF.ReturnStatement(returnValue)))
                 .AddModifiers(SF.Token(SyntaxKind.PublicKeyword), SF.Token(SyntaxKind.OverrideKeyword)));
        }