Fwd: : /codegenerator/trunk/Castle.Tools.CodeGenerator/Services/

1 view
Skip to first unread message

Jacob Lewallen

unread,
Mar 22, 2007, 1:45:25 AM3/22/07
to castle-pro...@googlegroups.com
Make sure your controller class is partial.

jacob

---------- Forwarded message ----------
From: s...@castleproject.org
Date: Mar 21, 4:36 pm
Subject: : /codegenerator/trunk/Castle.Tools.CodeGenerator/Services/
To: Castle Project Commits


User: chriso
Date: 2007/03/21 09:36 PM

Modified:
/codegenerator/trunk/Castle.Tools.CodeGenerator/Services/
ControllerVisitor.cs

Log:
Added some logging to tell why a controller might not have any code
generated for it.

File Changes:

Directory: /codegenerator/trunk/Castle.Tools.CodeGenerator/Services/
====================================================================

File [modified]: ControllerVisitor.cs
Delta lines: +18 -1
===================================================================
--- codegenerator/trunk/Castle.Tools.CodeGenerator/Services/ControllerVisitor.cs
2007-03-18 16:28:33 UTC (rev 133)
+++ codegenerator/trunk/Castle.Tools.CodeGenerator/Services/ControllerVisitor.cs
2007-03-22 00:35:57 UTC (rev 134)
@@ -92,8 +92,25 @@
#region Protected Methods
protected virtual bool IsController(TypeDeclaration typeDeclaration)
{
- return
+ bool isController =
typeDeclaration.Name.EndsWith("Controller") &&
(typeDeclaration.Modifier & Modifier.Partial) == Modifier.Partial;
+
+ if(!isController)
+ {
+ if( (typeDeclaration.Modifier & Modifier.Partial) !=
Modifier.Partial)
+ {
+ _logger.LogInfo("Controller Source for " +
typeDeclaration.Name +
+ " will not be included in the
generated sitemap because it is not a partial type");
+ }
+ if( !typeDeclaration.Name.EndsWith("Controller"))
+ {
+ _logger.LogInfo("Controller source for " +
typeDeclaration.Name +
+ " will not be included in the
generated site map because its type name does not end with
controller");
+
+ }
+ }
+
+ return isController;
}

protected virtual string GetArea(TypeDeclaration typeDeclaration)

Reply all
Reply to author
Forward
0 new messages