From 9a6a3af45067756e9e42ad2bac864da2e26f6556 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 30 May 2014 10:31:49 -0700 Subject: [PATCH] Transition Microsoft.AspNet.Razor from csproj to kproj. Needed to modify some source to use new resx format. #32 --- Razor.sln | 42 +- .../{Common => }/CommonResources.resx | 0 .../Editor/BackgroundParser.cs | 16 +- .../Editor/RazorEditorTrace.cs | 4 +- .../Microsoft.AspNet.Razor.kproj | 203 +++++ .../Parser/CSharpCodeParser.Directives.cs | 20 +- .../Parser/CSharpCodeParser.Statements.cs | 8 +- .../Parser/CSharpCodeParser.cs | 4 +- .../Parser/HtmlMarkupParser.Block.cs | 10 +- .../Parser/TokenizerBackedParser.Helpers.cs | 6 +- .../Properties/CommonResources.Designer.cs | 91 +- .../Properties/RazorResources.Designer.cs | 805 +++++++++++++++++- .../RazorEditorParser.cs | 6 +- .../RazorResources.resx | 2 +- src/Microsoft.AspNet.Razor/Text/TextChange.cs | 8 +- .../Tokenizer/TokenizerView.cs | 2 +- src/Microsoft.AspNet.Razor/project.json | 13 +- 17 files changed, 1114 insertions(+), 126 deletions(-) rename src/Microsoft.AspNet.Razor/{Common => }/CommonResources.resx (100%) create mode 100644 src/Microsoft.AspNet.Razor/Microsoft.AspNet.Razor.kproj diff --git a/Razor.sln b/Razor.sln index 26af208252..1b044c3ba6 100644 --- a/Razor.sln +++ b/Razor.sln @@ -1,19 +1,15 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 +# Visual Studio 14 +VisualStudioVersion = 14.0.21722.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3C0D6505-79B3-49D0-B4C3-176F0F1836ED}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{92463391-81BE-462B-AC3C-78C6C760741F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.Razor.Test", "test\Microsoft.AspNet.Razor.Test\Microsoft.AspNet.Razor.Test.csproj", "{0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Razor", "src\Microsoft.AspNet.Razor\Microsoft.AspNet.Razor.kproj", "{EDA30434-C567-44DC-B8B6-2566A7F77163}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.TestCommon", "test\Microsoft.TestCommon\Microsoft.TestCommon.csproj", "{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.Razor.net45", "src\Microsoft.AspNet.Razor\Microsoft.AspNet.Razor.net45.csproj", "{8B129FF9-0B8F-4E0C-8DFC-0137D8550FB7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.Razor.k10", "src\Microsoft.AspNet.Razor\Microsoft.AspNet.Razor.k10.csproj", "{F5A44105-08E2-4602-8231-DAFDDC9A146E}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Razor.Test", "test\Microsoft.AspNet.Razor.Test\Microsoft.AspNet.Razor.Test.kproj", "{87C7338B-0C06-4C7B-BE75-A2368AE26797}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,30 +17,20 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}.Release|Any CPU.Build.0 = Debug|Any CPU - {FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}.Release|Any CPU.Build.0 = Debug|Any CPU - {8B129FF9-0B8F-4E0C-8DFC-0137D8550FB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B129FF9-0B8F-4E0C-8DFC-0137D8550FB7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B129FF9-0B8F-4E0C-8DFC-0137D8550FB7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B129FF9-0B8F-4E0C-8DFC-0137D8550FB7}.Release|Any CPU.Build.0 = Release|Any CPU - {F5A44105-08E2-4602-8231-DAFDDC9A146E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5A44105-08E2-4602-8231-DAFDDC9A146E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5A44105-08E2-4602-8231-DAFDDC9A146E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5A44105-08E2-4602-8231-DAFDDC9A146E}.Release|Any CPU.Build.0 = Release|Any CPU + {EDA30434-C567-44DC-B8B6-2566A7F77163}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDA30434-C567-44DC-B8B6-2566A7F77163}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDA30434-C567-44DC-B8B6-2566A7F77163}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDA30434-C567-44DC-B8B6-2566A7F77163}.Release|Any CPU.Build.0 = Release|Any CPU + {87C7338B-0C06-4C7B-BE75-A2368AE26797}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87C7338B-0C06-4C7B-BE75-A2368AE26797}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87C7338B-0C06-4C7B-BE75-A2368AE26797}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87C7338B-0C06-4C7B-BE75-A2368AE26797}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {8B129FF9-0B8F-4E0C-8DFC-0137D8550FB7} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED} - {F5A44105-08E2-4602-8231-DAFDDC9A146E} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED} - {0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE} = {92463391-81BE-462B-AC3C-78C6C760741F} - {FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0} = {92463391-81BE-462B-AC3C-78C6C760741F} + {EDA30434-C567-44DC-B8B6-2566A7F77163} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED} + {87C7338B-0C06-4C7B-BE75-A2368AE26797} = {92463391-81BE-462B-AC3C-78C6C760741F} EndGlobalSection EndGlobal diff --git a/src/Microsoft.AspNet.Razor/Common/CommonResources.resx b/src/Microsoft.AspNet.Razor/CommonResources.resx similarity index 100% rename from src/Microsoft.AspNet.Razor/Common/CommonResources.resx rename to src/Microsoft.AspNet.Razor/CommonResources.resx diff --git a/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs b/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs index db74376f05..886c996531 100644 --- a/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs +++ b/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs @@ -191,7 +191,7 @@ namespace Microsoft.AspNet.Razor.Editor public void QueueChange(TextChange change) { - RazorEditorTrace.TraceLine(RazorResources.Trace_QueuingParse(Path.GetFileName(_fileName), change)); + RazorEditorTrace.TraceLine(RazorResources.FormatTrace_QueuingParse(Path.GetFileName(_fileName), change)); EnsureOnThread(); lock (_stateLock) { @@ -306,7 +306,7 @@ namespace Microsoft.AspNet.Razor.Editor try { - RazorEditorTrace.TraceLine(RazorResources.Trace_BackgroundThreadStart(fileNameOnly)); + RazorEditorTrace.TraceLine(RazorResources.FormatTrace_BackgroundThreadStart(fileNameOnly)); EnsureOnThread(); #if K10 @@ -319,7 +319,7 @@ namespace Microsoft.AspNet.Razor.Editor WorkParcel parcel = _main.GetParcel(); if (parcel.Changes.Any()) { - RazorEditorTrace.TraceLine(RazorResources.Trace_ChangesArrived(fileNameOnly, parcel.Changes.Count)); + RazorEditorTrace.TraceLine(RazorResources.FormatTrace_ChangesArrived(fileNameOnly, parcel.Changes.Count)); try { DocumentParseCompleteEventArgs args = null; @@ -356,7 +356,7 @@ namespace Microsoft.AspNet.Razor.Editor sw.Reset(); #endif RazorEditorTrace.TraceLine( - RazorResources.Trace_ParseComplete( + RazorResources.FormatTrace_ParseComplete( fileNameOnly, elapsedMs.HasValue ? elapsedMs.Value.ToString(CultureInfo.InvariantCulture) : "?")); @@ -376,7 +376,7 @@ namespace Microsoft.AspNet.Razor.Editor sw.Reset(); #endif _currentParseTree = results.Document; - RazorEditorTrace.TraceLine(RazorResources.Trace_TreesCompared( + RazorEditorTrace.TraceLine(RazorResources.FormatTrace_TreesCompared( fileNameOnly, elapsedMs.HasValue ? elapsedMs.Value.ToString(CultureInfo.InvariantCulture) : "?", treeStructureChanged)); @@ -392,7 +392,7 @@ namespace Microsoft.AspNet.Razor.Editor else { // Parse completed but we were cancelled in the mean time. Add these to the discarded changes set - RazorEditorTrace.TraceLine(RazorResources.Trace_ChangesDiscarded(fileNameOnly, allChanges.Count)); + RazorEditorTrace.TraceLine(RazorResources.FormatTrace_ChangesDiscarded(fileNameOnly, allChanges.Count)); _previouslyDiscarded = allChanges; } @@ -426,7 +426,7 @@ namespace Microsoft.AspNet.Razor.Editor } else { - RazorEditorTrace.TraceLine(RazorResources.Trace_NoChangesArrived(fileNameOnly)); + RazorEditorTrace.TraceLine(RazorResources.FormatTrace_NoChangesArrived(fileNameOnly)); #if NET45 // No Yield in CoreCLR @@ -444,7 +444,7 @@ namespace Microsoft.AspNet.Razor.Editor } finally { - RazorEditorTrace.TraceLine(RazorResources.Trace_BackgroundThreadShutdown(fileNameOnly)); + RazorEditorTrace.TraceLine(RazorResources.FormatTrace_BackgroundThreadShutdown(fileNameOnly)); // Clean up main thread resources _main.Dispose(); diff --git a/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs b/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs index c71b0f52a5..e420f070e9 100644 --- a/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs +++ b/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Razor.Editor #if NET45 // No Trace in CoreCLR - Trace.WriteLine(RazorResources.Trace_Startup( + Trace.WriteLine(RazorResources.FormatTrace_Startup( enabled ? RazorResources.Trace_Enabled : RazorResources.Trace_Disabled)); #endif _enabled = enabled; @@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Razor.Editor #if NET45 // No Trace in CoreCLR - Trace.WriteLine(RazorResources.Trace_Format( + Trace.WriteLine(RazorResources.FormatTrace_Format( String.Format(CultureInfo.CurrentCulture, format, args))); #endif } diff --git a/src/Microsoft.AspNet.Razor/Microsoft.AspNet.Razor.kproj b/src/Microsoft.AspNet.Razor/Microsoft.AspNet.Razor.kproj new file mode 100644 index 0000000000..66b00a0f73 --- /dev/null +++ b/src/Microsoft.AspNet.Razor/Microsoft.AspNet.Razor.kproj @@ -0,0 +1,203 @@ + + + + 12.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + Debug + AnyCPU + + + + eda30434-c567-44dc-b8b6-2566a7f77163 + Library + + + ConsoleDebugger + + + WebDebugger + + + + + 2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs index 3ef76c8468..5fba093cce 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs @@ -139,12 +139,12 @@ namespace Microsoft.AspNet.Razor.Parser } else { - error = RazorResources.ErrorComponent_Character(CurrentSymbol.Content); + error = RazorResources.FormatErrorComponent_Character(CurrentSymbol.Content); } Context.OnError( CurrentLocation, - RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start(error)); + RazorResources.FormatParseError_Unexpected_Character_At_Helper_Name_Start(error)); PutCurrentBack(); Output(SpanKind.MetaCode); return; @@ -161,7 +161,7 @@ namespace Microsoft.AspNet.Razor.Parser AcceptWhile(IsSpacingToken(includeNewLines: false, includeComments: true)); // Don't accept newlines. // Expecting an identifier (helper name) - bool errorReported = !Required(CSharpSymbolType.Identifier, errorIfNotFound: true, errorBase: RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start); + bool errorReported = !Required(CSharpSymbolType.Identifier, errorIfNotFound: true, errorBase: RazorResources.FormatParseError_Unexpected_Character_At_Helper_Name_Start); if (!errorReported) { Assert(CSharpSymbolType.Identifier); @@ -179,7 +179,7 @@ namespace Microsoft.AspNet.Razor.Parser errorReported = true; Context.OnError( CurrentLocation, - RazorResources.ParseError_MissingCharAfterHelperName("(")); + RazorResources.FormatParseError_MissingCharAfterHelperName("(")); } } else @@ -218,7 +218,7 @@ namespace Microsoft.AspNet.Razor.Parser { Context.OnError( errorLocation, - RazorResources.ParseError_MissingCharAfterHelperParameters( + RazorResources.FormatParseError_MissingCharAfterHelperParameters( Language.GetSample(CSharpSymbolType.LeftBrace))); } } @@ -292,7 +292,7 @@ namespace Microsoft.AspNet.Razor.Parser if (nested) { - Context.OnError(CurrentLocation, RazorResources.ParseError_Sections_Cannot_Be_Nested(RazorResources.SectionExample_CS)); + Context.OnError(CurrentLocation, RazorResources.FormatParseError_Sections_Cannot_Be_Nested(RazorResources.SectionExample_CS)); errorReported = true; } @@ -302,7 +302,7 @@ namespace Microsoft.AspNet.Razor.Parser string sectionName = String.Empty; if (!Required(CSharpSymbolType.Identifier, errorIfNotFound: true, - errorBase: RazorResources.ParseError_Unexpected_Character_At_Section_Name_Start)) + errorBase: RazorResources.FormatParseError_Unexpected_Character_At_Section_Name_Start)) { if (!errorReported) { @@ -363,7 +363,7 @@ namespace Microsoft.AspNet.Razor.Parser { editHandler.AutoCompleteString = "}"; Context.OnError(CurrentLocation, - RazorResources.ParseError_Expected_X( + RazorResources.FormatParseError_Expected_X( Language.GetSample(CSharpSymbolType.RightBrace))); } else @@ -390,7 +390,7 @@ namespace Microsoft.AspNet.Razor.Parser if (!At(CSharpSymbolType.LeftBrace)) { Context.OnError(CurrentLocation, - RazorResources.ParseError_Expected_X(Language.GetSample(CSharpSymbolType.LeftBrace))); + RazorResources.FormatParseError_Expected_X(Language.GetSample(CSharpSymbolType.LeftBrace))); CompleteBlock(); Output(SpanKind.MetaCode); return; @@ -415,7 +415,7 @@ namespace Microsoft.AspNet.Razor.Parser if (!At(CSharpSymbolType.RightBrace)) { editHandler.AutoCompleteString = "}"; - Context.OnError(block.Start, RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(block.Name, "}", "{")); + Context.OnError(block.Start, RazorResources.FormatParseError_Expected_EndOfBlock_Before_EOF(block.Name, "}", "{")); CompleteBlock(); Output(SpanKind.Code); } diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs index 8503f1c485..727db76246 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs @@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Razor.Parser protected virtual void ReservedDirective(bool topLevel) { - Context.OnError(CurrentLocation, RazorResources.ParseError_ReservedWord(CurrentSymbol.Content)); + Context.OnError(CurrentLocation, RazorResources.FormatParseError_ReservedWord(CurrentSymbol.Content)); AcceptAndMoveNext(); Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None; Span.CodeGenerator = SpanCodeGenerator.Null; @@ -319,7 +319,7 @@ namespace Microsoft.AspNet.Razor.Parser if (!At(CSharpSymbolType.LeftBrace)) { Context.OnError(CurrentLocation, - RazorResources.ParseError_SingleLine_ControlFlowStatements_Not_Allowed( + RazorResources.FormatParseError_SingleLine_ControlFlowStatements_Not_Allowed( Language.GetSample(CSharpSymbolType.LeftBrace), CurrentSymbol.Content)); } @@ -510,7 +510,7 @@ namespace Microsoft.AspNet.Razor.Parser if (At(CSharpSymbolType.Keyword)) { Context.OnError(CurrentLocation, - RazorResources.ParseError_Unexpected_Keyword_After_At( + RazorResources.FormatParseError_Unexpected_Keyword_After_At( CSharpLanguageCharacteristics.GetKeyword(CurrentSymbol.Keyword.Value))); } else if (At(CSharpSymbolType.LeftBrace)) @@ -604,7 +604,7 @@ namespace Microsoft.AspNet.Razor.Parser if (EndOfFile) { - Context.OnError(block.Start, RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(block.Name, '}', '{')); + Context.OnError(block.Start, RazorResources.FormatParseError_Expected_EndOfBlock_Before_EOF(block.Name, '}', '{')); } else if (acceptTerminatingBrace) { diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs index c1684adfb5..6534f3e863 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs @@ -264,7 +264,7 @@ namespace Microsoft.AspNet.Razor.Parser } else { - Context.OnError(CurrentLocation, RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS(CurrentSymbol.Content)); + Context.OnError(CurrentLocation, RazorResources.FormatParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS(CurrentSymbol.Content)); } } finally @@ -501,7 +501,7 @@ namespace Microsoft.AspNet.Razor.Parser if (!success) { AcceptUntil(CSharpSymbolType.LessThan); - Context.OnError(block.Start, RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(block.Name, ")", "(")); + Context.OnError(block.Start, RazorResources.FormatParseError_Expected_EndOfBlock_Before_EOF(block.Name, ")", "(")); } // If necessary, put an empty-content marker symbol here diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs index 38fae4a09f..bf911945b7 100644 --- a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs +++ b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs @@ -666,7 +666,7 @@ namespace Microsoft.AspNet.Razor.Parser bool seenClose = Optional(HtmlSymbolType.CloseAngle); if (!seenClose) { - Context.OnError(tag.Item2, RazorResources.ParseError_UnfinishedTag(tag.Item1.Content)); + Context.OnError(tag.Item2, RazorResources.FormatParseError_UnfinishedTag(tag.Item1.Content)); } else { @@ -744,7 +744,7 @@ namespace Microsoft.AspNet.Razor.Parser SkipToAndParseCode(HtmlSymbolType.CloseAngle); if (!Optional(HtmlSymbolType.CloseAngle)) { - Context.OnError(tagStart, RazorResources.ParseError_UnfinishedTag("script")); + Context.OnError(tagStart, RazorResources.FormatParseError_UnfinishedTag("script")); } seenEndScript = true; } @@ -781,11 +781,11 @@ namespace Microsoft.AspNet.Razor.Parser } if (currentTag != null) { - Context.OnError(currentTag.Item2, RazorResources.ParseError_MissingEndTag(currentTag.Item1.Content)); + Context.OnError(currentTag.Item2, RazorResources.FormatParseError_MissingEndTag(currentTag.Item1.Content)); } else { - Context.OnError(tagStart, RazorResources.ParseError_UnexpectedEndTag(tagName)); + Context.OnError(tagStart, RazorResources.FormatParseError_UnexpectedEndTag(tagName)); } return false; } @@ -800,7 +800,7 @@ namespace Microsoft.AspNet.Razor.Parser tags.Pop(); } Tuple tag = tags.Pop(); - Context.OnError(tag.Item2, RazorResources.ParseError_MissingEndTag(tag.Item1.Content)); + Context.OnError(tag.Item2, RazorResources.FormatParseError_MissingEndTag(tag.Item1.Content)); } else if (complete) { diff --git a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs index b61dbe744e..0b64ac082c 100644 --- a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs +++ b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs @@ -73,7 +73,7 @@ namespace Microsoft.AspNet.Razor.Parser if (EndOfFile && !mode.HasFlag(BalancingModes.NoErrorOnFailure)) { Context.OnError(start, - RazorResources.ParseError_Expected_CloseBracket_Before_EOF( + RazorResources.FormatParseError_Expected_CloseBracket_Before_EOF( Language.GetSample(left), Language.GetSample(right))); } @@ -121,7 +121,7 @@ namespace Microsoft.AspNet.Razor.Parser if (!mode.HasFlag(BalancingModes.NoErrorOnFailure)) { Context.OnError(start, - RazorResources.ParseError_Expected_CloseBracket_Before_EOF( + RazorResources.FormatParseError_Expected_CloseBracket_Before_EOF( Language.GetSample(left), Language.GetSample(right))); } @@ -353,7 +353,7 @@ namespace Microsoft.AspNet.Razor.Parser } else { - error = RazorResources.ErrorComponent_Character(CurrentSymbol.Content); + error = RazorResources.FormatErrorComponent_Character(CurrentSymbol.Content); } Context.OnError( diff --git a/src/Microsoft.AspNet.Razor/Properties/CommonResources.Designer.cs b/src/Microsoft.AspNet.Razor/Properties/CommonResources.Designer.cs index a557be4f79..1f6d8c3a18 100644 --- a/src/Microsoft.AspNet.Razor/Properties/CommonResources.Designer.cs +++ b/src/Microsoft.AspNet.Razor/Properties/CommonResources.Designer.cs @@ -1,5 +1,4 @@ // - namespace Microsoft.AspNet.Razor { using System.Globalization; @@ -19,10 +18,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("Argument_Cannot_Be_Null_Or_Empty"); } } + /// + /// Value cannot be null or an empty string. + /// + internal static string FormatArgument_Cannot_Be_Null_Or_Empty() + { + return GetString("Argument_Cannot_Be_Null_Or_Empty"); + } + /// /// Value must be between {0} and {1}. /// - internal static string Argument_Must_Be_Between(object p0, object p1) + internal static string Argument_Must_Be_Between + { + get { return GetString("Argument_Must_Be_Between"); } + } + + /// + /// Value must be between {0} and {1}. + /// + internal static string FormatArgument_Must_Be_Between(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_Between"), p0, p1); } @@ -30,7 +45,15 @@ namespace Microsoft.AspNet.Razor /// /// Value must be a value from the "{0}" enumeration. /// - internal static string Argument_Must_Be_Enum_Member(object p0) + internal static string Argument_Must_Be_Enum_Member + { + get { return GetString("Argument_Must_Be_Enum_Member"); } + } + + /// + /// Value must be a value from the "{0}" enumeration. + /// + internal static string FormatArgument_Must_Be_Enum_Member(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_Enum_Member"), p0); } @@ -38,7 +61,15 @@ namespace Microsoft.AspNet.Razor /// /// Value must be greater than {0}. /// - internal static string Argument_Must_Be_GreaterThan(object p0) + internal static string Argument_Must_Be_GreaterThan + { + get { return GetString("Argument_Must_Be_GreaterThan"); } + } + + /// + /// Value must be greater than {0}. + /// + internal static string FormatArgument_Must_Be_GreaterThan(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_GreaterThan"), p0); } @@ -46,7 +77,15 @@ namespace Microsoft.AspNet.Razor /// /// Value must be greater than or equal to {0}. /// - internal static string Argument_Must_Be_GreaterThanOrEqualTo(object p0) + internal static string Argument_Must_Be_GreaterThanOrEqualTo + { + get { return GetString("Argument_Must_Be_GreaterThanOrEqualTo"); } + } + + /// + /// Value must be greater than or equal to {0}. + /// + internal static string FormatArgument_Must_Be_GreaterThanOrEqualTo(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_GreaterThanOrEqualTo"), p0); } @@ -54,7 +93,15 @@ namespace Microsoft.AspNet.Razor /// /// Value must be less than {0}. /// - internal static string Argument_Must_Be_LessThan(object p0) + internal static string Argument_Must_Be_LessThan + { + get { return GetString("Argument_Must_Be_LessThan"); } + } + + /// + /// Value must be less than {0}. + /// + internal static string FormatArgument_Must_Be_LessThan(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_LessThan"), p0); } @@ -62,7 +109,15 @@ namespace Microsoft.AspNet.Razor /// /// Value must be less than or equal to {0}. /// - internal static string Argument_Must_Be_LessThanOrEqualTo(object p0) + internal static string Argument_Must_Be_LessThanOrEqualTo + { + get { return GetString("Argument_Must_Be_LessThanOrEqualTo"); } + } + + /// + /// Value must be less than or equal to {0}. + /// + internal static string FormatArgument_Must_Be_LessThanOrEqualTo(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_LessThanOrEqualTo"), p0); } @@ -75,10 +130,28 @@ namespace Microsoft.AspNet.Razor get { return GetString("Argument_Must_Be_Null_Or_Non_Empty"); } } - private static string GetString(string name) + /// + /// Value cannot be an empty string. It must either be null or a non-empty string. + /// + internal static string FormatArgument_Must_Be_Null_Or_Non_Empty() { - string value = _resourceManager.GetString(name); + return GetString("Argument_Must_Be_Null_Or_Non_Empty"); + } + + private static string GetString(string name, params string[] formatterNames) + { + var value = _resourceManager.GetString(name); + System.Diagnostics.Debug.Assert(value != null); + + if (formatterNames != null) + { + for (var i = 0; i < formatterNames.Length; i++) + { + value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}"); + } + } + return value; } } diff --git a/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs b/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs index e2347f5ec9..262c5924cf 100644 --- a/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs +++ b/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs @@ -1,5 +1,4 @@ // - namespace Microsoft.AspNet.Razor { using System.Globalization; @@ -12,13 +11,21 @@ namespace Microsoft.AspNet.Razor = new ResourceManager("Microsoft.AspNet.Razor.RazorResources", typeof(RazorResources).GetTypeInfo().Assembly); /// - /// The active parser must the same as either the markup or code parser. + /// The active parser must be the same as either the markup or code parser. /// internal static string ActiveParser_Must_Be_Code_Or_Markup_Parser { get { return GetString("ActiveParser_Must_Be_Code_Or_Markup_Parser"); } } + /// + /// The active parser must be the same as either the markup or code parser. + /// + internal static string FormatActiveParser_Must_Be_Code_Or_Markup_Parser() + { + return GetString("ActiveParser_Must_Be_Code_Or_Markup_Parser"); + } + /// /// code /// @@ -27,6 +34,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("BlockName_Code"); } } + /// + /// code + /// + internal static string FormatBlockName_Code() + { + return GetString("BlockName_Code"); + } + /// /// explicit expression /// @@ -35,6 +50,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("BlockName_ExplicitExpression"); } } + /// + /// explicit expression + /// + internal static string FormatBlockName_ExplicitExpression() + { + return GetString("BlockName_ExplicitExpression"); + } + /// /// The "CancelBacktrack" method can be called only while in a look-ahead process started with the "BeginLookahead" method. /// @@ -43,6 +66,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CancelBacktrack_Must_Be_Called_Within_Lookahead"); } } + /// + /// The "CancelBacktrack" method can be called only while in a look-ahead process started with the "BeginLookahead" method. + /// + internal static string FormatCancelBacktrack_Must_Be_Called_Within_Lookahead() + { + return GetString("CancelBacktrack_Must_Be_Called_Within_Lookahead"); + } + /// /// "EndBlock" was called without a matching call to "StartBlock". /// @@ -51,6 +82,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("EndBlock_Called_Without_Matching_StartBlock"); } } + /// + /// "EndBlock" was called without a matching call to "StartBlock". + /// + internal static string FormatEndBlock_Called_Without_Matching_StartBlock() + { + return GetString("EndBlock_Called_Without_Matching_StartBlock"); + } + /// /// The "@" character must be followed by a ":", "(", or a C# identifier. If you intended to switch to markup, use an HTML start tag, for example: /// @@ -63,6 +102,18 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start"); } } + /// + /// The "@" character must be followed by a ":", "(", or a C# identifier. If you intended to switch to markup, use an HTML start tag, for example: + /// + /// @if(isLoggedIn) { + /// <p>Hello, @user!</p> + /// } + /// + internal static string FormatParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start() + { + return GetString("ParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start"); + } + /// /// End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence. /// @@ -71,10 +122,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_BlockComment_Not_Terminated"); } } + /// + /// End of file was reached before the end of the block comment. All comments started with "/*" sequence must be terminated with a matching "*/" sequence. + /// + internal static string FormatParseError_BlockComment_Not_Terminated() + { + return GetString("ParseError_BlockComment_Not_Terminated"); + } + /// /// An opening "{0}" is missing the corresponding closing "{1}". /// - internal static string ParseError_Expected_CloseBracket_Before_EOF(object p0, object p1) + internal static string ParseError_Expected_CloseBracket_Before_EOF + { + get { return GetString("ParseError_Expected_CloseBracket_Before_EOF"); } + } + + /// + /// An opening "{0}" is missing the corresponding closing "{1}". + /// + internal static string FormatParseError_Expected_CloseBracket_Before_EOF(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Expected_CloseBracket_Before_EOF"), p0, p1); } @@ -82,7 +149,15 @@ namespace Microsoft.AspNet.Razor /// /// The {0} block is missing a closing "{1}" character. Make sure you have a matching "{1}" character for all the "{2}" characters within this block, and that none of the "{1}" characters are being interpreted as markup. /// - internal static string ParseError_Expected_EndOfBlock_Before_EOF(object p0, object p1, object p2) + internal static string ParseError_Expected_EndOfBlock_Before_EOF + { + get { return GetString("ParseError_Expected_EndOfBlock_Before_EOF"); } + } + + /// + /// The {0} block is missing a closing "{1}" character. Make sure you have a matching "{1}" character for all the "{2}" characters within this block, and that none of the "{1}" characters are being interpreted as markup. + /// + internal static string FormatParseError_Expected_EndOfBlock_Before_EOF(object p0, object p1, object p2) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Expected_EndOfBlock_Before_EOF"), p0, p1, p2); } @@ -90,7 +165,15 @@ namespace Microsoft.AspNet.Razor /// /// Expected "{0}". /// - internal static string ParseError_Expected_X(object p0) + internal static string ParseError_Expected_X + { + get { return GetString("ParseError_Expected_X"); } + } + + /// + /// Expected "{0}". + /// + internal static string FormatParseError_Expected_X(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Expected_X"), p0); } @@ -103,6 +186,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_InlineMarkup_Blocks_Cannot_Be_Nested"); } } + /// + /// Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed. + /// + internal static string FormatParseError_InlineMarkup_Blocks_Cannot_Be_Nested() + { + return GetString("ParseError_InlineMarkup_Blocks_Cannot_Be_Nested"); + } + /// /// Markup in a code block must start with a tag and all start tags must be matched with end tags. Do not use unclosed tags like "<br>". Instead use self-closing tags like "<br/>". /// @@ -111,10 +202,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_MarkupBlock_Must_Start_With_Tag"); } } + /// + /// Markup in a code block must start with a tag and all start tags must be matched with end tags. Do not use unclosed tags like "<br>". Instead use self-closing tags like "<br/>". + /// + internal static string FormatParseError_MarkupBlock_Must_Start_With_Tag() + { + return GetString("ParseError_MarkupBlock_Must_Start_With_Tag"); + } + /// /// The "{0}" element was not closed. All elements must be either self-closing or have a matching end tag. /// - internal static string ParseError_MissingEndTag(object p0) + internal static string ParseError_MissingEndTag + { + get { return GetString("ParseError_MissingEndTag"); } + } + + /// + /// The "{0}" element was not closed. All elements must be either self-closing or have a matching end tag. + /// + internal static string FormatParseError_MissingEndTag(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_MissingEndTag"), p0); } @@ -131,6 +238,18 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_MissingOpenBraceAfterSection"); } } + /// + /// Sections cannot be empty. The "@section" keyword must be followed by a block of markup surrounded by "{}". For example: + /// + /// @section Sidebar { + /// <!-- Markup and text goes here --> + /// } + /// + internal static string FormatParseError_MissingOpenBraceAfterSection() + { + return GetString("ParseError_MissingOpenBraceAfterSection"); + } + /// /// Namespace imports and type aliases cannot be placed within code blocks. They must immediately follow an "@" character in markup. It is recommended that you put them at the top of the page, as in the following example: /// @@ -144,6 +263,19 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock"); } } + /// + /// Namespace imports and type aliases cannot be placed within code blocks. They must immediately follow an "@" character in markup. It is recommended that you put them at the top of the page, as in the following example: + /// + /// @using System.Drawing; + /// @{ + /// // OK here to use types from System.Drawing in the page. + /// } + /// + internal static string FormatParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock() + { + return GetString("ParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock"); + } + /// /// Expected a "{0}" but found a "{1}". Block statements must be enclosed in "{{" and "}}". You cannot use single-statement control-flow statements in CSHTML pages. For example, the following is not allowed: /// @@ -156,7 +288,24 @@ namespace Microsoft.AspNet.Razor /// <p>Hello, @user</p> /// }} /// - internal static string ParseError_SingleLine_ControlFlowStatements_Not_Allowed(object p0, object p1) + internal static string ParseError_SingleLine_ControlFlowStatements_Not_Allowed + { + get { return GetString("ParseError_SingleLine_ControlFlowStatements_Not_Allowed"); } + } + + /// + /// Expected a "{0}" but found a "{1}". Block statements must be enclosed in "{{" and "}}". You cannot use single-statement control-flow statements in CSHTML pages. For example, the following is not allowed: + /// + /// @if(isLoggedIn) + /// <p>Hello, @user</p> + /// + /// Instead, wrap the contents of the block in "{{}}": + /// + /// @if(isLoggedIn) {{ + /// <p>Hello, @user</p> + /// }} + /// + internal static string FormatParseError_SingleLine_ControlFlowStatements_Not_Allowed(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_SingleLine_ControlFlowStatements_Not_Allowed"), p0, p1); } @@ -164,7 +313,15 @@ namespace Microsoft.AspNet.Razor /// /// Encountered end tag "{0}" with no matching start tag. Are your start/end tags properly balanced? /// - internal static string ParseError_UnexpectedEndTag(object p0) + internal static string ParseError_UnexpectedEndTag + { + get { return GetString("ParseError_UnexpectedEndTag"); } + } + + /// + /// Encountered end tag "{0}" with no matching start tag. Are your start/end tags properly balanced? + /// + internal static string FormatParseError_UnexpectedEndTag(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_UnexpectedEndTag"), p0); } @@ -172,7 +329,15 @@ namespace Microsoft.AspNet.Razor /// /// Unexpected {0} after section keyword. Section names must start with an "_" or alphabetic character, and the remaining characters must be either "_" or alphanumeric. /// - internal static string ParseError_Unexpected_Character_At_Section_Name_Start(object p0) + internal static string ParseError_Unexpected_Character_At_Section_Name_Start + { + get { return GetString("ParseError_Unexpected_Character_At_Section_Name_Start"); } + } + + /// + /// Unexpected {0} after section keyword. Section names must start with an "_" or alphabetic character, and the remaining characters must be either "_" or alphanumeric. + /// + internal static string FormatParseError_Unexpected_Character_At_Section_Name_Start(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected_Character_At_Section_Name_Start"), p0); } @@ -180,15 +345,31 @@ namespace Microsoft.AspNet.Razor /// /// "{0}" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{{" are valid. /// - internal static string ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS(object p0) + internal static string ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS + { + get { return GetString("ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS"); } + } + + /// + /// "{0}" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{{" are valid. + /// + internal static string FormatParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS"), p0); } /// - /// End of file or an unexpected character was reached before the "{0}" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "<" HTML entity. + /// End of file or an unexpected character was reached before the "{0}" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "&lt;" HTML entity. /// - internal static string ParseError_UnfinishedTag(object p0) + internal static string ParseError_UnfinishedTag + { + get { return GetString("ParseError_UnfinishedTag"); } + } + + /// + /// End of file or an unexpected character was reached before the "{0}" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "&lt;" HTML entity. + /// + internal static string FormatParseError_UnfinishedTag(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_UnfinishedTag"), p0); } @@ -201,10 +382,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_Unterminated_String_Literal"); } } + /// + /// Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines. + /// + internal static string FormatParseError_Unterminated_String_Literal() + { + return GetString("ParseError_Unterminated_String_Literal"); + } + /// /// Unknown option: "{0}". /// - internal static string ParseError_UnknownOption(object p0) + internal static string ParseError_UnknownOption + { + get { return GetString("ParseError_UnknownOption"); } + } + + /// + /// Unknown option: "{0}". + /// + internal static string FormatParseError_UnknownOption(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_UnknownOption"), p0); } @@ -212,7 +409,15 @@ namespace Microsoft.AspNet.Razor /// /// The "{0}" block was not terminated. All "{0}" statements must be terminated with a matching "{1}". /// - internal static string ParseError_BlockNotTerminated(object p0, object p1) + internal static string ParseError_BlockNotTerminated + { + get { return GetString("ParseError_BlockNotTerminated"); } + } + + /// + /// The "{0}" block was not terminated. All "{0}" statements must be terminated with a matching "{1}". + /// + internal static string FormatParseError_BlockNotTerminated(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_BlockNotTerminated"), p0, p1); } @@ -225,6 +430,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("SectionExample_CS"); } } + /// + /// @section Header { ... } + /// + internal static string FormatSectionExample_CS() + { + return GetString("SectionExample_CS"); + } + /// /// "<text>" and "</text>" tags cannot contain attributes. /// @@ -233,6 +446,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_TextTagCannotContainAttributes"); } } + /// + /// "<text>" and "</text>" tags cannot contain attributes. + /// + internal static string FormatParseError_TextTagCannotContainAttributes() + { + return GetString("ParseError_TextTagCannotContainAttributes"); + } + /// /// The "Imports" keyword must be followed by a namespace or a type alias on the same line. /// @@ -241,6 +462,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_NamespaceOrTypeAliasExpected"); } } + /// + /// The "Imports" keyword must be followed by a namespace or a type alias on the same line. + /// + internal static string FormatParseError_NamespaceOrTypeAliasExpected() + { + return GetString("ParseError_NamespaceOrTypeAliasExpected"); + } + /// /// A space or line break was encountered after the "@" character. Only valid identifiers, keywords, comments, "(" and "{" are valid at the start of a code block and they must occur immediately following "@" with no space in between. /// @@ -249,6 +478,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS"); } } + /// + /// A space or line break was encountered after the "@" character. Only valid identifiers, keywords, comments, "(" and "{" are valid at the start of a code block and they must occur immediately following "@" with no space in between. + /// + internal static string FormatParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS() + { + return GetString("ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS"); + } + /// /// The 'inherits' keyword must be followed by a type name on the same line. /// @@ -257,6 +494,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName"); } } + /// + /// The 'inherits' keyword must be followed by a type name on the same line. + /// + internal static string FormatParseError_InheritsKeyword_Must_Be_Followed_By_TypeName() + { + return GetString("ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName"); + } + /// /// Outer tag is missing a name. The first character of a markup block must be an HTML tag with a valid name. /// @@ -265,6 +510,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_OuterTagMissingName"); } } + /// + /// Outer tag is missing a name. The first character of a markup block must be an HTML tag with a valid name. + /// + internal static string FormatParseError_OuterTagMissingName() + { + return GetString("ParseError_OuterTagMissingName"); + } + /// /// End of file was reached before the end of the block comment. All comments that start with the "@*" sequence must be terminated with a matching "*@" sequence. /// @@ -273,10 +526,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_RazorComment_Not_Terminated"); } } + /// + /// End of file was reached before the end of the block comment. All comments that start with the "@*" sequence must be terminated with a matching "*@" sequence. + /// + internal static string FormatParseError_RazorComment_Not_Terminated() + { + return GetString("ParseError_RazorComment_Not_Terminated"); + } + /// /// "{0}" character /// - internal static string ErrorComponent_Character(object p0) + internal static string ErrorComponent_Character + { + get { return GetString("ErrorComponent_Character"); } + } + + /// + /// "{0}" character + /// + internal static string FormatErrorComponent_Character(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ErrorComponent_Character"), p0); } @@ -289,6 +558,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ErrorComponent_EndOfFile"); } } + /// + /// end of file + /// + internal static string FormatErrorComponent_EndOfFile() + { + return GetString("ErrorComponent_EndOfFile"); + } + /// /// space or line break /// @@ -297,6 +574,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ErrorComponent_Whitespace"); } } + /// + /// space or line break + /// + internal static string FormatErrorComponent_Whitespace() + { + return GetString("ErrorComponent_Whitespace"); + } + /// /// End-of-file was found after the "@" character. "@" must be followed by a valid code block. If you want to output an "@", escape it using the sequence: "@@" /// @@ -305,10 +590,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock"); } } + /// + /// End-of-file was found after the "@" character. "@" must be followed by a valid code block. If you want to output an "@", escape it using the sequence: "@@" + /// + internal static string FormatParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock() + { + return GetString("ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock"); + } + /// /// The {0} property of the {1} structure cannot be null. /// - internal static string Structure_Member_CannotBeNull(object p0, object p1) + internal static string Structure_Member_CannotBeNull + { + get { return GetString("Structure_Member_CannotBeNull"); } + } + + /// + /// The {0} property of the {1} structure cannot be null. + /// + internal static string FormatStructure_Member_CannotBeNull(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("Structure_Member_CannotBeNull"), p0, p1); } @@ -316,7 +617,15 @@ namespace Microsoft.AspNet.Razor /// /// Expected a "{0}" after the helper parameters. /// - internal static string ParseError_MissingCharAfterHelperParameters(object p0) + internal static string ParseError_MissingCharAfterHelperParameters + { + get { return GetString("ParseError_MissingCharAfterHelperParameters"); } + } + + /// + /// Expected a "{0}" after the helper parameters. + /// + internal static string FormatParseError_MissingCharAfterHelperParameters(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_MissingCharAfterHelperParameters"), p0); } @@ -324,7 +633,15 @@ namespace Microsoft.AspNet.Razor /// /// Expected a "{0}" after the helper name. /// - internal static string ParseError_MissingCharAfterHelperName(object p0) + internal static string ParseError_MissingCharAfterHelperName + { + get { return GetString("ParseError_MissingCharAfterHelperName"); } + } + + /// + /// Expected a "{0}" after the helper name. + /// + internal static string FormatParseError_MissingCharAfterHelperName(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_MissingCharAfterHelperName"), p0); } @@ -337,6 +654,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_UnterminatedHelperParameterList"); } } + /// + /// Helper parameter list is missing a closing ")". + /// + internal static string FormatParseError_UnterminatedHelperParameterList() + { + return GetString("ParseError_UnterminatedHelperParameterList"); + } + /// /// Helper blocks cannot be nested within each other. /// @@ -345,6 +670,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_Helpers_Cannot_Be_Nested"); } } + /// + /// Helper blocks cannot be nested within each other. + /// + internal static string FormatParseError_Helpers_Cannot_Be_Nested() + { + return GetString("ParseError_Helpers_Cannot_Be_Nested"); + } + /// /// Parser was started with a null Context property. The Context property must be set BEFORE calling any methods on the parser. /// @@ -353,10 +686,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("Parser_Context_Not_Set"); } } + /// + /// Parser was started with a null Context property. The Context property must be set BEFORE calling any methods on the parser. + /// + internal static string FormatParser_Context_Not_Set() + { + return GetString("Parser_Context_Not_Set"); + } + /// /// Unexpected "{0}" keyword after "@" character. Once inside code, you do not need to prefix constructs like "{0}" with "@". /// - internal static string ParseError_Unexpected_Keyword_After_At(object p0) + internal static string ParseError_Unexpected_Keyword_After_At + { + get { return GetString("ParseError_Unexpected_Keyword_After_At"); } + } + + /// + /// Unexpected "{0}" keyword after "@" character. Once inside code, you do not need to prefix constructs like "{0}" with "@". + /// + internal static string FormatParseError_Unexpected_Keyword_After_At(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected_Keyword_After_At"), p0); } @@ -364,7 +713,15 @@ namespace Microsoft.AspNet.Razor /// /// "{0}" is a reserved word and cannot be used in implicit expressions. An explicit expression ("@()") must be used. /// - internal static string ParseError_ReservedWord(object p0) + internal static string ParseError_ReservedWord + { + get { return GetString("ParseError_ReservedWord"); } + } + + /// + /// "{0}" is a reserved word and cannot be used in implicit expressions. An explicit expression ("@()") must be used. + /// + internal static string FormatParseError_ReservedWord(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_ReservedWord"), p0); } @@ -372,7 +729,15 @@ namespace Microsoft.AspNet.Razor /// /// Unexpected {0} after helper keyword. All helpers must have a name which starts with an "_" or alphabetic character. The remaining characters must be either "_" or alphanumeric. /// - internal static string ParseError_Unexpected_Character_At_Helper_Name_Start(object p0) + internal static string ParseError_Unexpected_Character_At_Helper_Name_Start + { + get { return GetString("ParseError_Unexpected_Character_At_Helper_Name_Start"); } + } + + /// + /// Unexpected {0} after helper keyword. All helpers must have a name which starts with an "_" or alphabetic character. The remaining characters must be either "_" or alphanumeric. + /// + internal static string FormatParseError_Unexpected_Character_At_Helper_Name_Start(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected_Character_At_Helper_Name_Start"), p0); } @@ -385,6 +750,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("Tokenizer_CannotResumeSymbolUnlessIsPrevious"); } } + /// + /// Cannot resume this symbol. Only the symbol immediately preceding the current one can be resumed. + /// + internal static string FormatTokenizer_CannotResumeSymbolUnlessIsPrevious() + { + return GetString("Tokenizer_CannotResumeSymbolUnlessIsPrevious"); + } + /// /// Cannot finish span, there is no current block. Call StartBlock at least once before finishing a span /// @@ -393,6 +766,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParserContext_NoCurrentBlock"); } } + /// + /// Cannot finish span, there is no current block. Call StartBlock at least once before finishing a span + /// + internal static string FormatParserContext_NoCurrentBlock() + { + return GetString("ParserContext_NoCurrentBlock"); + } + /// /// Cannot complete the tree, there are still open blocks. /// @@ -401,6 +782,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParserContext_CannotCompleteTree_OutstandingBlocks"); } } + /// + /// Cannot complete the tree, there are still open blocks. + /// + internal static string FormatParserContext_CannotCompleteTree_OutstandingBlocks() + { + return GetString("ParserContext_CannotCompleteTree_OutstandingBlocks"); + } + /// /// Cannot complete the tree, StartBlock must be called at least once. /// @@ -409,6 +798,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParserContext_CannotCompleteTree_NoRootBlock"); } } + /// + /// Cannot complete the tree, StartBlock must be called at least once. + /// + internal static string FormatParserContext_CannotCompleteTree_NoRootBlock() + { + return GetString("ParserContext_CannotCompleteTree_NoRootBlock"); + } + /// /// Cannot complete action, the parser has finished. Only CompleteParse can be called to extract the final parser results after the parser has finished /// @@ -417,6 +814,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParserContext_ParseComplete"); } } + /// + /// Cannot complete action, the parser has finished. Only CompleteParse can be called to extract the final parser results after the parser has finished + /// + internal static string FormatParserContext_ParseComplete() + { + return GetString("ParserContext_ParseComplete"); + } + /// /// Block cannot be built because a Type has not been specified in the BlockBuilder /// @@ -425,6 +830,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("Block_Type_Not_Specified"); } } + /// + /// Block cannot be built because a Type has not been specified in the BlockBuilder + /// + internal static string FormatBlock_Type_Not_Specified() + { + return GetString("Block_Type_Not_Specified"); + } + /// /// <<character literal>> /// @@ -433,6 +846,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_CharacterLiteral"); } } + /// + /// <<character literal>> + /// + internal static string FormatCSharpSymbol_CharacterLiteral() + { + return GetString("CSharpSymbol_CharacterLiteral"); + } + /// /// <<comment>> /// @@ -441,6 +862,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_Comment"); } } + /// + /// <<comment>> + /// + internal static string FormatCSharpSymbol_Comment() + { + return GetString("CSharpSymbol_Comment"); + } + /// /// <<identifier>> /// @@ -449,6 +878,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_Identifier"); } } + /// + /// <<identifier>> + /// + internal static string FormatCSharpSymbol_Identifier() + { + return GetString("CSharpSymbol_Identifier"); + } + /// /// <<integer literal>> /// @@ -457,6 +894,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_IntegerLiteral"); } } + /// + /// <<integer literal>> + /// + internal static string FormatCSharpSymbol_IntegerLiteral() + { + return GetString("CSharpSymbol_IntegerLiteral"); + } + /// /// <<keyword>> /// @@ -465,6 +910,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_Keyword"); } } + /// + /// <<keyword>> + /// + internal static string FormatCSharpSymbol_Keyword() + { + return GetString("CSharpSymbol_Keyword"); + } + /// /// <<newline sequence>> /// @@ -473,6 +926,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_Newline"); } } + /// + /// <<newline sequence>> + /// + internal static string FormatCSharpSymbol_Newline() + { + return GetString("CSharpSymbol_Newline"); + } + /// /// <<real literal>> /// @@ -481,6 +942,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_RealLiteral"); } } + /// + /// <<real literal>> + /// + internal static string FormatCSharpSymbol_RealLiteral() + { + return GetString("CSharpSymbol_RealLiteral"); + } + /// /// <<string literal>> /// @@ -489,6 +958,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_StringLiteral"); } } + /// + /// <<string literal>> + /// + internal static string FormatCSharpSymbol_StringLiteral() + { + return GetString("CSharpSymbol_StringLiteral"); + } + /// /// <<white space>> /// @@ -497,6 +974,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("CSharpSymbol_Whitespace"); } } + /// + /// <<white space>> + /// + internal static string FormatCSharpSymbol_Whitespace() + { + return GetString("CSharpSymbol_Whitespace"); + } + /// /// <<unknown>> /// @@ -505,10 +990,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("Symbol_Unknown"); } } + /// + /// <<unknown>> + /// + internal static string FormatSymbol_Unknown() + { + return GetString("Symbol_Unknown"); + } + /// /// In order to put a symbol back, it must have been the symbol which ended at the current position. The specified symbol ends at {0}, but the current position is {1} /// - internal static string TokenizerView_CannotPutBack(object p0, object p1) + internal static string TokenizerView_CannotPutBack + { + get { return GetString("TokenizerView_CannotPutBack"); } + } + + /// + /// In order to put a symbol back, it must have been the symbol which ended at the current position. The specified symbol ends at {0}, but the current position is {1} + /// + internal static string FormatTokenizerView_CannotPutBack(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("TokenizerView_CannotPutBack"), p0, p1); } @@ -516,7 +1017,15 @@ namespace Microsoft.AspNet.Razor /// /// Unexpected "{0}" /// - internal static string ParseError_Unexpected(object p0) + internal static string ParseError_Unexpected + { + get { return GetString("ParseError_Unexpected"); } + } + + /// + /// Unexpected "{0}" + /// + internal static string FormatParseError_Unexpected(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected"), p0); } @@ -529,6 +1038,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParseError_Unexpected_Nested_CodeBlock"); } } + /// + /// Unexpected "{" after "@" character. Once inside the body of a code block (@if {}, @{}, etc.) you do not need to use "@{" to switch to code. + /// + internal static string FormatParseError_Unexpected_Nested_CodeBlock() + { + return GetString("ParseError_Unexpected_Nested_CodeBlock"); + } + /// /// line break /// @@ -537,6 +1054,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ErrorComponent_Newline"); } } + /// + /// line break + /// + internal static string FormatErrorComponent_Newline() + { + return GetString("ErrorComponent_Newline"); + } + /// /// <<newline sequence>> /// @@ -545,6 +1070,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("HtmlSymbol_NewLine"); } } + /// + /// <<newline sequence>> + /// + internal static string FormatHtmlSymbol_NewLine() + { + return GetString("HtmlSymbol_NewLine"); + } + /// /// <<razor comment>> /// @@ -553,6 +1086,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("HtmlSymbol_RazorComment"); } } + /// + /// <<razor comment>> + /// + internal static string FormatHtmlSymbol_RazorComment() + { + return GetString("HtmlSymbol_RazorComment"); + } + /// /// <<text>> /// @@ -561,6 +1102,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("HtmlSymbol_Text"); } } + /// + /// <<text>> + /// + internal static string FormatHtmlSymbol_Text() + { + return GetString("HtmlSymbol_Text"); + } + /// /// <<white space>> /// @@ -569,6 +1118,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("HtmlSymbol_WhiteSpace"); } } + /// + /// <<white space>> + /// + internal static string FormatHtmlSymbol_WhiteSpace() + { + return GetString("HtmlSymbol_WhiteSpace"); + } + /// /// The parser provided to the ParserContext was not a Markup Parser. /// @@ -577,6 +1134,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParserIsNotAMarkupParser"); } } + /// + /// The parser provided to the ParserContext was not a Markup Parser. + /// + internal static string FormatParserIsNotAMarkupParser() + { + return GetString("ParserIsNotAMarkupParser"); + } + /// /// Cannot use built-in RazorComment handler, language characteristics does not define the CommentStart, CommentStar and CommentBody known symbol types or parser does not override TokenizerBackedParser.OutputSpanBeforeRazorComment /// @@ -585,6 +1150,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("Language_Does_Not_Support_RazorComment"); } } + /// + /// Cannot use built-in RazorComment handler, language characteristics does not define the CommentStart, CommentStar and CommentBody known symbol types or parser does not override TokenizerBackedParser.OutputSpanBeforeRazorComment + /// + internal static string FormatLanguage_Does_Not_Support_RazorComment() + { + return GetString("Language_Does_Not_Support_RazorComment"); + } + /// /// Missing value for session state directive. /// @@ -593,6 +1166,14 @@ namespace Microsoft.AspNet.Razor get { return GetString("ParserEror_SessionDirectiveMissingValue"); } } + /// + /// Missing value for session state directive. + /// + internal static string FormatParserEror_SessionDirectiveMissingValue() + { + return GetString("ParserEror_SessionDirectiveMissingValue"); + } + /// /// Cannot call CreateCodeWriter, a CodeWriter was not provided to the Create method /// @@ -601,10 +1182,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("CreateCodeWriter_NoCodeWriter"); } } + /// + /// Cannot call CreateCodeWriter, a CodeWriter was not provided to the Create method + /// + internal static string FormatCreateCodeWriter_NoCodeWriter() + { + return GetString("CreateCodeWriter_NoCodeWriter"); + } + /// /// [BG][{0}] Shutdown /// - internal static string Trace_BackgroundThreadShutdown(object p0) + internal static string Trace_BackgroundThreadShutdown + { + get { return GetString("Trace_BackgroundThreadShutdown"); } + } + + /// + /// [BG][{0}] Shutdown + /// + internal static string FormatTrace_BackgroundThreadShutdown(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_BackgroundThreadShutdown"), p0); } @@ -612,7 +1209,15 @@ namespace Microsoft.AspNet.Razor /// /// [BG][{0}] Startup /// - internal static string Trace_BackgroundThreadStart(object p0) + internal static string Trace_BackgroundThreadStart + { + get { return GetString("Trace_BackgroundThreadStart"); } + } + + /// + /// [BG][{0}] Startup + /// + internal static string FormatTrace_BackgroundThreadStart(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_BackgroundThreadStart"), p0); } @@ -620,7 +1225,15 @@ namespace Microsoft.AspNet.Razor /// /// [BG][{0}] {1} changes arrived /// - internal static string Trace_ChangesArrived(object p0, object p1) + internal static string Trace_ChangesArrived + { + get { return GetString("Trace_ChangesArrived"); } + } + + /// + /// [BG][{0}] {1} changes arrived + /// + internal static string FormatTrace_ChangesArrived(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_ChangesArrived"), p0, p1); } @@ -628,7 +1241,15 @@ namespace Microsoft.AspNet.Razor /// /// [BG][{0}] Discarded {1} changes /// - internal static string Trace_ChangesDiscarded(object p0, object p1) + internal static string Trace_ChangesDiscarded + { + get { return GetString("Trace_ChangesDiscarded"); } + } + + /// + /// [BG][{0}] Discarded {1} changes + /// + internal static string FormatTrace_ChangesDiscarded(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_ChangesDiscarded"), p0, p1); } @@ -636,7 +1257,15 @@ namespace Microsoft.AspNet.Razor /// /// [BG][{0}] Collecting {1} discarded changes /// - internal static string Trace_CollectedDiscardedChanges(object p0, object p1) + internal static string Trace_CollectedDiscardedChanges + { + get { return GetString("Trace_CollectedDiscardedChanges"); } + } + + /// + /// [BG][{0}] Collecting {1} discarded changes + /// + internal static string FormatTrace_CollectedDiscardedChanges(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_CollectedDiscardedChanges"), p0, p1); } @@ -649,10 +1278,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("Trace_Disabled"); } } + /// + /// Disabled + /// + internal static string FormatTrace_Disabled() + { + return GetString("Trace_Disabled"); + } + /// /// [P][{0}] {3} Change in {2} milliseconds: {1} /// - internal static string Trace_EditorProcessedChange(object p0, object p1, object p2, object p3) + internal static string Trace_EditorProcessedChange + { + get { return GetString("Trace_EditorProcessedChange"); } + } + + /// + /// [P][{0}] {3} Change in {2} milliseconds: {1} + /// + internal static string FormatTrace_EditorProcessedChange(object p0, object p1, object p2, object p3) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_EditorProcessedChange"), p0, p1, p2, p3); } @@ -660,7 +1305,15 @@ namespace Microsoft.AspNet.Razor /// /// [P][{0}] Received Change: {1} /// - internal static string Trace_EditorReceivedChange(object p0, object p1) + internal static string Trace_EditorReceivedChange + { + get { return GetString("Trace_EditorReceivedChange"); } + } + + /// + /// [P][{0}] Received Change: {1} + /// + internal static string FormatTrace_EditorReceivedChange(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_EditorReceivedChange"), p0, p1); } @@ -673,10 +1326,26 @@ namespace Microsoft.AspNet.Razor get { return GetString("Trace_Enabled"); } } + /// + /// Enabled + /// + internal static string FormatTrace_Enabled() + { + return GetString("Trace_Enabled"); + } + /// /// [Razor] {0} /// - internal static string Trace_Format(object p0) + internal static string Trace_Format + { + get { return GetString("Trace_Format"); } + } + + /// + /// [Razor] {0} + /// + internal static string FormatTrace_Format(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_Format"), p0); } @@ -684,7 +1353,15 @@ namespace Microsoft.AspNet.Razor /// /// [BG][{0}] no changes arrived? /// - internal static string Trace_NoChangesArrived(object p0) + internal static string Trace_NoChangesArrived + { + get { return GetString("Trace_NoChangesArrived"); } + } + + /// + /// [BG][{0}] no changes arrived? + /// + internal static string FormatTrace_NoChangesArrived(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_NoChangesArrived"), p0); } @@ -692,7 +1369,15 @@ namespace Microsoft.AspNet.Razor /// /// [BG][{0}] Parse Complete in {1} milliseconds /// - internal static string Trace_ParseComplete(object p0, object p1) + internal static string Trace_ParseComplete + { + get { return GetString("Trace_ParseComplete"); } + } + + /// + /// [BG][{0}] Parse Complete in {1} milliseconds + /// + internal static string FormatTrace_ParseComplete(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_ParseComplete"), p0, p1); } @@ -700,7 +1385,15 @@ namespace Microsoft.AspNet.Razor /// /// [M][{0}] Queuing Parse for: {1} /// - internal static string Trace_QueuingParse(object p0, object p1) + internal static string Trace_QueuingParse + { + get { return GetString("Trace_QueuingParse"); } + } + + /// + /// [M][{0}] Queuing Parse for: {1} + /// + internal static string FormatTrace_QueuingParse(object p0, object p1) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_QueuingParse"), p0, p1); } @@ -708,7 +1401,15 @@ namespace Microsoft.AspNet.Razor /// /// [Razor] Editor Tracing {0} /// - internal static string Trace_Startup(object p0) + internal static string Trace_Startup + { + get { return GetString("Trace_Startup"); } + } + + /// + /// [Razor] Editor Tracing {0} + /// + internal static string FormatTrace_Startup(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_Startup"), p0); } @@ -716,7 +1417,15 @@ namespace Microsoft.AspNet.Razor /// /// [BG][{0}] Trees Compared in {1} milliseconds. Different = {2} /// - internal static string Trace_TreesCompared(object p0, object p1, object p2) + internal static string Trace_TreesCompared + { + get { return GetString("Trace_TreesCompared"); } + } + + /// + /// [BG][{0}] Trees Compared in {1} milliseconds. Different = {2} + /// + internal static string FormatTrace_TreesCompared(object p0, object p1, object p2) { return string.Format(CultureInfo.CurrentCulture, GetString("Trace_TreesCompared"), p0, p1, p2); } @@ -724,15 +1433,33 @@ namespace Microsoft.AspNet.Razor /// /// Section blocks ("{0}") cannot be nested. Only one level of section blocks are allowed. /// - internal static string ParseError_Sections_Cannot_Be_Nested(object p0) + internal static string ParseError_Sections_Cannot_Be_Nested + { + get { return GetString("ParseError_Sections_Cannot_Be_Nested"); } + } + + /// + /// Section blocks ("{0}") cannot be nested. Only one level of section blocks are allowed. + /// + internal static string FormatParseError_Sections_Cannot_Be_Nested(object p0) { return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Sections_Cannot_Be_Nested"), p0); } - private static string GetString(string name) + private static string GetString(string name, params string[] formatterNames) { - string value = _resourceManager.GetString(name); + var value = _resourceManager.GetString(name); + System.Diagnostics.Debug.Assert(value != null); + + if (formatterNames != null) + { + for (var i = 0; i < formatterNames.Length; i++) + { + value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}"); + } + } + return value; } } diff --git a/src/Microsoft.AspNet.Razor/RazorEditorParser.cs b/src/Microsoft.AspNet.Razor/RazorEditorParser.cs index 8be19af572..6c748c6c40 100644 --- a/src/Microsoft.AspNet.Razor/RazorEditorParser.cs +++ b/src/Microsoft.AspNet.Razor/RazorEditorParser.cs @@ -131,10 +131,10 @@ namespace Microsoft.AspNet.Razor Stopwatch sw = new Stopwatch(); sw.Start(); #endif - RazorEditorTrace.TraceLine(RazorResources.Trace_EditorReceivedChange(Path.GetFileName(FileName), change)); + RazorEditorTrace.TraceLine(RazorResources.FormatTrace_EditorReceivedChange(Path.GetFileName(FileName), change)); if (change.NewBuffer == null) { - throw new ArgumentException(RazorResources.Structure_Member_CannotBeNull( + throw new ArgumentException(RazorResources.FormatStructure_Member_CannotBeNull( "Buffer", "TextChange"), "change"); } @@ -171,7 +171,7 @@ namespace Microsoft.AspNet.Razor sw.Reset(); #endif RazorEditorTrace.TraceLine( - RazorResources.Trace_EditorProcessedChange( + RazorResources.FormatTrace_EditorProcessedChange( Path.GetFileName(FileName), changeString, elapsedMs.HasValue ? elapsedMs.Value.ToString(CultureInfo.InvariantCulture) : "?", result.ToString())); diff --git a/src/Microsoft.AspNet.Razor/RazorResources.resx b/src/Microsoft.AspNet.Razor/RazorResources.resx index e47ac95da6..9e3fe702f6 100644 --- a/src/Microsoft.AspNet.Razor/RazorResources.resx +++ b/src/Microsoft.AspNet.Razor/RazorResources.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - The active parser must the same as either the markup or code parser. + The active parser must be the same as either the markup or code parser. code diff --git a/src/Microsoft.AspNet.Razor/Text/TextChange.cs b/src/Microsoft.AspNet.Razor/Text/TextChange.cs index 067ab91104..1945423dc8 100644 --- a/src/Microsoft.AspNet.Razor/Text/TextChange.cs +++ b/src/Microsoft.AspNet.Razor/Text/TextChange.cs @@ -28,19 +28,19 @@ namespace Microsoft.AspNet.Razor.Text { if (oldPosition < 0) { - throw new ArgumentOutOfRangeException("oldPosition", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); + throw new ArgumentOutOfRangeException("oldPosition", CommonResources.FormatArgument_Must_Be_GreaterThanOrEqualTo(0)); } if (newPosition < 0) { - throw new ArgumentOutOfRangeException("newPosition", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); + throw new ArgumentOutOfRangeException("newPosition", CommonResources.FormatArgument_Must_Be_GreaterThanOrEqualTo(0)); } if (oldLength < 0) { - throw new ArgumentOutOfRangeException("oldLength", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); + throw new ArgumentOutOfRangeException("oldLength", CommonResources.FormatArgument_Must_Be_GreaterThanOrEqualTo(0)); } if (newLength < 0) { - throw new ArgumentOutOfRangeException("newLength", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); + throw new ArgumentOutOfRangeException("newLength", CommonResources.FormatArgument_Must_Be_GreaterThanOrEqualTo(0)); } if (oldBuffer == null) { diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs b/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs index 0c9f536f84..0015ea48e3 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Razor.Tokenizer { // We've already passed this symbol throw new InvalidOperationException( - RazorResources.TokenizerView_CannotPutBack( + RazorResources.FormatTokenizerView_CannotPutBack( symbol.Start.AbsoluteIndex + symbol.Content.Length, Source.Position)); } diff --git a/src/Microsoft.AspNet.Razor/project.json b/src/Microsoft.AspNet.Razor/project.json index 59d8cbf203..8c160459bb 100644 --- a/src/Microsoft.AspNet.Razor/project.json +++ b/src/Microsoft.AspNet.Razor/project.json @@ -1,9 +1,6 @@ { - "version": "0.1-alpha-*", - "configurations": { - "net45": {}, - "k10": { - "dependencies": { + "version": "0.1-alpha-*", + "dependencies": { "System.Collections": "4.0.0.0", "System.Diagnostics.Debug": "4.0.10.0", "System.Diagnostics.Tools": "4.0.0.0", @@ -19,7 +16,9 @@ "System.Threading": "4.0.0.0", "System.Threading.Tasks": "4.0.10.0", "System.Threading.Thread": "4.0.0.0" - } + }, + "configurations": { + "net45": { }, + "k10": { } } - } } \ No newline at end of file