예제 #1
0
        //private static MethodDeclarationSyntax AddObjectInvariantMethod(ClassDeclarationSyntax class_to_add_to)
        private static MethodDeclarationSyntax AddObjectInvariantMethod(TypeDeclarationSyntax class_to_add_to)
        {
            Contract.Ensures(Contract.Result <MethodDeclarationSyntax>() != null);

            var oima = new ObjectInvariantMethodAdder();
            //var newclass = oima.Visit(class_to_add_to) as ClassDeclarationSyntax;
            var newclass = oima.Visit(class_to_add_to) as TypeDeclarationSyntax;

            return(oima.invariantmethod);
        }
예제 #2
0
 //private static MethodDeclarationSyntax AddObjectInvariantMethod(ClassDeclarationSyntax class_to_add_to)
 private static MethodDeclarationSyntax AddObjectInvariantMethod(TypeDeclarationSyntax class_to_add_to)
 {
   Contract.Ensures(Contract.Result<MethodDeclarationSyntax>() != null);
   
   var oima = new ObjectInvariantMethodAdder();
   //var newclass = oima.Visit(class_to_add_to) as ClassDeclarationSyntax;
   var newclass = oima.Visit(class_to_add_to) as TypeDeclarationSyntax;
   return oima.invariantmethod;
 }