Skip to content

Commit b6de754

Browse files
Update StaticObject.cs
1 parent ce1116d commit b6de754

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

class/StaticObject.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,26 @@ internal static void SetValue()
1919
return;
2020

2121
CodeBehindOptions options = new CodeBehindOptions();
22+
23+
if (options.UseDefaultController)
24+
{
25+
DefaultController = options.DefaultController;
26+
27+
if (options.PutTwoUnderlinesEqualToDashForController)
28+
DefaultController = DefaultController.Replace("__", "-");
29+
if (DefaultController.StartsWith(options.IgnorePrefixController))
30+
DefaultController = DefaultController.Remove(0, options.IgnorePrefixController.Length);
31+
if (DefaultController.EndsWith(options.IgnoreSuffixController))
32+
DefaultController = DefaultController.GetTextBeforeLastValue(options.IgnoreSuffixController);
33+
34+
DefaultController = (options.AccessControllerByLowerCase || options.JustAccessControllerByLowerCase) ? DefaultController.ToLower() : DefaultController;
35+
}
36+
2237
PreventAccessDefaultAspx = options.PreventAccessDefaultAspx;
2338
ViewPath = options.ViewPath;
2439
DefaultRole = options.DefaultRole;
2540
ViewPlace = options.WebFormsViewPlace;
26-
UseDefaultController = options.UseDefaultController;
27-
DefaultController = (options.AccessControllerByLowerCase || options.JustAccessControllerByLowerCase) ? options.DefaultController.ToLower() : options.DefaultController;
41+
UseDefaultController = options.UseDefaultController;
2842
UseSectionInDefaultController = options.UseSectionInDefaultController;
2943
SetBreakForDefaultController = options.SetBreakForDefaultController;
3044

0 commit comments

Comments
 (0)