void InternalCreatePageProperty (string retType, string name, string contextProperty)
{
CodeMemberProperty property = new CodeMemberProperty ();
property.Name = name;
property.Type = new CodeTypeReference (retType);
property.Attributes = MemberAttributes.Family | MemberAttributes.Final;
CodeMethodReturnStatement ret = new CodeMethodReturnStatement ();
CodeCastExpression cast = new CodeCastExpression ();
ret.Expression = cast;
CodePropertyReferenceExpression refexp = new CodePropertyReferenceExpression ();
refexp.TargetObject = new CodePropertyReferenceExpression (new CodeThisReferenceExpression (), "Context");
refexp.PropertyName = contextProperty;
cast.TargetType = new CodeTypeReference (retType);
cast.Expression = refexp;
property.GetStatements.Add (ret);
if (partialClass == null)
mainClass.Members.Add (property);
else
partialClass.Members.Add (property);
}