diff --git a/src/Microsoft.AspNet.Razor/Common/CommonResources.Designer.cs b/src/Microsoft.AspNet.Razor/Common/CommonResources.Designer.cs deleted file mode 100644 index 223d811cc9..0000000000 --- a/src/Microsoft.AspNet.Razor/Common/CommonResources.Designer.cs +++ /dev/null @@ -1,160 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34003 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Internal.Web.Utils -{ - using System; - using System.Reflection; - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class CommonResources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal CommonResources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNet.Razor.CommonResources", System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(CommonResources)).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Value cannot be null or an empty string.. - /// - internal static string Argument_Cannot_Be_Null_Or_Empty - { - get - { - return ResourceManager.GetString("Argument_Cannot_Be_Null_Or_Empty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be between {0} and {1}.. - /// - internal static string Argument_Must_Be_Between - { - get - { - return ResourceManager.GetString("Argument_Must_Be_Between", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be a value from the "{0}" enumeration.. - /// - internal static string Argument_Must_Be_Enum_Member - { - get - { - return ResourceManager.GetString("Argument_Must_Be_Enum_Member", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be greater than {0}.. - /// - internal static string Argument_Must_Be_GreaterThan - { - get - { - return ResourceManager.GetString("Argument_Must_Be_GreaterThan", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be greater than or equal to {0}.. - /// - internal static string Argument_Must_Be_GreaterThanOrEqualTo - { - get - { - return ResourceManager.GetString("Argument_Must_Be_GreaterThanOrEqualTo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be less than {0}.. - /// - internal static string Argument_Must_Be_LessThan - { - get - { - return ResourceManager.GetString("Argument_Must_Be_LessThan", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value must be less than or equal to {0}.. - /// - internal static string Argument_Must_Be_LessThanOrEqualTo - { - get - { - return ResourceManager.GetString("Argument_Must_Be_LessThanOrEqualTo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Value cannot be an empty string. It must either be null or a non-empty string.. - /// - internal static string Argument_Must_Be_Null_Or_Non_Empty - { - get - { - return ResourceManager.GetString("Argument_Must_Be_Null_Or_Non_Empty", resourceCulture); - } - } - } -} diff --git a/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs b/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs index 88b2ef22e4..a518b53dbf 100644 --- a/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs +++ b/src/Microsoft.AspNet.Razor/Editor/BackgroundParser.cs @@ -9,7 +9,6 @@ using System.IO; using System.Linq; using System.Threading; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Utils; @@ -191,7 +190,7 @@ namespace Microsoft.AspNet.Razor.Editor public void QueueChange(TextChange change) { - RazorEditorTrace.TraceLine(RazorResources.Trace_QueuingParse, Path.GetFileName(_fileName), change); + RazorEditorTrace.TraceLine(RazorResources.Trace_QueuingParse(Path.GetFileName(_fileName), change)); EnsureOnThread(); lock (_stateLock) { @@ -306,7 +305,7 @@ namespace Microsoft.AspNet.Razor.Editor try { - RazorEditorTrace.TraceLine(RazorResources.Trace_BackgroundThreadStart, fileNameOnly); + RazorEditorTrace.TraceLine(RazorResources.Trace_BackgroundThreadStart(fileNameOnly)); EnsureOnThread(); #if K10 @@ -319,7 +318,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.Trace_ChangesArrived(fileNameOnly, parcel.Changes.Count)); try { DocumentParseCompleteEventArgs args = null; @@ -356,9 +355,9 @@ namespace Microsoft.AspNet.Razor.Editor sw.Reset(); #endif RazorEditorTrace.TraceLine( - RazorResources.Trace_ParseComplete, + RazorResources.Trace_ParseComplete( fileNameOnly, - elapsedMs.HasValue ? elapsedMs.Value.ToString(CultureInfo.InvariantCulture) : "?"); + elapsedMs.HasValue ? elapsedMs.Value.ToString(CultureInfo.InvariantCulture) : "?")); if (results != null && !linkedCancel.IsCancellationRequested) { @@ -376,10 +375,10 @@ namespace Microsoft.AspNet.Razor.Editor sw.Reset(); #endif _currentParseTree = results.Document; - RazorEditorTrace.TraceLine(RazorResources.Trace_TreesCompared, + RazorEditorTrace.TraceLine(RazorResources.Trace_TreesCompared( fileNameOnly, elapsedMs.HasValue ? elapsedMs.Value.ToString(CultureInfo.InvariantCulture) : "?", - treeStructureChanged); + treeStructureChanged)); // Build Arguments args = new DocumentParseCompleteEventArgs() @@ -392,7 +391,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.Trace_ChangesDiscarded(fileNameOnly, allChanges.Count)); _previouslyDiscarded = allChanges; } @@ -426,7 +425,7 @@ namespace Microsoft.AspNet.Razor.Editor } else { - RazorEditorTrace.TraceLine(RazorResources.Trace_NoChangesArrived, fileNameOnly, parcel.Changes.Count); + RazorEditorTrace.TraceLine(RazorResources.Trace_NoChangesArrived(fileNameOnly)); #if NET45 // No Yield in CoreCLR @@ -444,7 +443,7 @@ namespace Microsoft.AspNet.Razor.Editor } finally { - RazorEditorTrace.TraceLine(RazorResources.Trace_BackgroundThreadShutdown, fileNameOnly); + RazorEditorTrace.TraceLine(RazorResources.Trace_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 f13707c183..d81c85bdce 100644 --- a/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs +++ b/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; using System.Globalization; -using Microsoft.AspNet.Razor.Resources; namespace Microsoft.AspNet.Razor.Editor { @@ -21,9 +20,7 @@ namespace Microsoft.AspNet.Razor.Editor #if NET45 // No Trace in CoreCLR - Trace.WriteLine(String.Format( - CultureInfo.CurrentCulture, - RazorResources.Trace_Startup, + Trace.WriteLine(RazorResources.Trace_Startup( enabled ? RazorResources.Trace_Enabled : RazorResources.Trace_Disabled)); #endif _enabled = enabled; @@ -44,9 +41,7 @@ namespace Microsoft.AspNet.Razor.Editor #if NET45 // No Trace in CoreCLR - Trace.WriteLine(String.Format( - CultureInfo.CurrentCulture, - RazorResources.Trace_Format, + Trace.WriteLine(RazorResources.Trace_Format( String.Format(CultureInfo.CurrentCulture, format, args))); #endif } diff --git a/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorContext.cs b/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorContext.cs index 2f9316989b..664a6edfd6 100644 --- a/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorContext.cs +++ b/src/Microsoft.AspNet.Razor/Generator/CodeGeneratorContext.cs @@ -10,7 +10,6 @@ using System.Linq; using System.Text; using Microsoft.AspNet.Razor.Generator.Compiler; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Utils; diff --git a/src/Microsoft.AspNet.Razor/Generator/GeneratedCodeMapping.cs b/src/Microsoft.AspNet.Razor/Generator/GeneratedCodeMapping.cs index 8dacffcf58..02dda5efb7 100644 --- a/src/Microsoft.AspNet.Razor/Generator/GeneratedCodeMapping.cs +++ b/src/Microsoft.AspNet.Razor/Generator/GeneratedCodeMapping.cs @@ -23,19 +23,19 @@ namespace Microsoft.AspNet.Razor.Generator { if (startLine < 0) { - throw new ArgumentOutOfRangeException("startLine", String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Must_Be_GreaterThanOrEqualTo, "startLine", "0")); + throw new ArgumentOutOfRangeException("startLine", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); } if (startColumn < 0) { - throw new ArgumentOutOfRangeException("startColumn", String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Must_Be_GreaterThanOrEqualTo, "startColumn", "0")); + throw new ArgumentOutOfRangeException("startColumn", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); } if (startGeneratedColumn < 0) { - throw new ArgumentOutOfRangeException("startGeneratedColumn", String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Must_Be_GreaterThanOrEqualTo, "startGeneratedColumn", "0")); + throw new ArgumentOutOfRangeException("startGeneratedColumn", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); } if (codeLength < 0) { - throw new ArgumentOutOfRangeException("codeLength", String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Must_Be_GreaterThanOrEqualTo, "codeLength", "0")); + throw new ArgumentOutOfRangeException("codeLength", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); } StartOffset = startOffset; diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs index ec0943214d..ada152c162 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs @@ -9,7 +9,6 @@ using System.Linq; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -139,13 +138,12 @@ namespace Microsoft.AspNet.Razor.Parser } else { - error = String.Format(CultureInfo.CurrentCulture, RazorResources.ErrorComponent_Character, CurrentSymbol.Content); + error = RazorResources.ErrorComponent_Character(CurrentSymbol.Content); } Context.OnError( CurrentLocation, - RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start, - error); + RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start(error)); PutCurrentBack(); Output(SpanKind.MetaCode); return; @@ -180,8 +178,7 @@ namespace Microsoft.AspNet.Razor.Parser errorReported = true; Context.OnError( CurrentLocation, - RazorResources.ParseError_MissingCharAfterHelperName, - "("); + RazorResources.ParseError_MissingCharAfterHelperName("(")); } } else @@ -220,8 +217,8 @@ namespace Microsoft.AspNet.Razor.Parser { Context.OnError( errorLocation, - RazorResources.ParseError_MissingCharAfterHelperParameters, - Language.GetSample(CSharpSymbolType.LeftBrace)); + RazorResources.ParseError_MissingCharAfterHelperParameters( + Language.GetSample(CSharpSymbolType.LeftBrace))); } } @@ -294,7 +291,7 @@ namespace Microsoft.AspNet.Razor.Parser if (nested) { - Context.OnError(CurrentLocation, String.Format(CultureInfo.CurrentCulture, RazorResources.ParseError_Sections_Cannot_Be_Nested, RazorResources.SectionExample_CS)); + Context.OnError(CurrentLocation, RazorResources.ParseError_Sections_Cannot_Be_Nested(RazorResources.SectionExample_CS)); errorReported = true; } @@ -365,8 +362,8 @@ namespace Microsoft.AspNet.Razor.Parser { editHandler.AutoCompleteString = "}"; Context.OnError(CurrentLocation, - RazorResources.ParseError_Expected_X, - Language.GetSample(CSharpSymbolType.RightBrace)); + RazorResources.ParseError_Expected_X( + Language.GetSample(CSharpSymbolType.RightBrace))); } else { @@ -392,8 +389,7 @@ namespace Microsoft.AspNet.Razor.Parser if (!At(CSharpSymbolType.LeftBrace)) { Context.OnError(CurrentLocation, - RazorResources.ParseError_Expected_X, - Language.GetSample(CSharpSymbolType.LeftBrace)); + RazorResources.ParseError_Expected_X(Language.GetSample(CSharpSymbolType.LeftBrace))); CompleteBlock(); Output(SpanKind.MetaCode); return; @@ -418,7 +414,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.ParseError_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 cbc9f9a2b9..df71990bf9 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Statements.cs @@ -7,7 +7,6 @@ using System.Globalization; using System.Linq; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -28,7 +27,7 @@ namespace Microsoft.AspNet.Razor.Parser protected virtual void ReservedDirective(bool topLevel) { - Context.OnError(CurrentLocation, String.Format(CultureInfo.CurrentCulture, RazorResources.ParseError_ReservedWord, CurrentSymbol.Content)); + Context.OnError(CurrentLocation, RazorResources.ParseError_ReservedWord(CurrentSymbol.Content)); AcceptAndMoveNext(); Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None; Span.CodeGenerator = SpanCodeGenerator.Null; @@ -319,9 +318,9 @@ namespace Microsoft.AspNet.Razor.Parser if (!At(CSharpSymbolType.LeftBrace)) { Context.OnError(CurrentLocation, - RazorResources.ParseError_SingleLine_ControlFlowStatements_Not_Allowed, - Language.GetSample(CSharpSymbolType.LeftBrace), - CurrentSymbol.Content); + RazorResources.ParseError_SingleLine_ControlFlowStatements_Not_Allowed( + Language.GetSample(CSharpSymbolType.LeftBrace), + CurrentSymbol.Content)); } // Parse the statement and then we're done @@ -510,8 +509,8 @@ namespace Microsoft.AspNet.Razor.Parser if (At(CSharpSymbolType.Keyword)) { Context.OnError(CurrentLocation, - RazorResources.ParseError_Unexpected_Keyword_After_At, - CSharpLanguageCharacteristics.GetKeyword(CurrentSymbol.Keyword.Value)); + RazorResources.ParseError_Unexpected_Keyword_After_At( + CSharpLanguageCharacteristics.GetKeyword(CurrentSymbol.Keyword.Value))); } else if (At(CSharpSymbolType.LeftBrace)) { @@ -604,7 +603,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.ParseError_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 6417f7dfc2..07a8c721c4 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs @@ -7,7 +7,6 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Tokenizer; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -256,7 +255,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.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS(CurrentSymbol.Content)); } } finally @@ -479,7 +478,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.ParseError_Expected_EndOfBlock_Before_EOF(block.Name, ")", "(")); } // If necessary, put an empty-content marker symbol here diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs index c6dc393bb2..355e710e81 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer; using Microsoft.AspNet.Razor.Tokenizer.Symbols; diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs index 077807840b..c9268a9aaa 100644 --- a/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs +++ b/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer; using Microsoft.AspNet.Razor.Tokenizer.Symbols; diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs index 28f66c4cd0..7e0609bef1 100644 --- a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs +++ b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs @@ -7,7 +7,6 @@ using System.Linq; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -666,7 +665,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.ParseError_UnfinishedTag(tag.Item1.Content)); } else { @@ -744,7 +743,7 @@ namespace Microsoft.AspNet.Razor.Parser SkipToAndParseCode(HtmlSymbolType.CloseAngle); if (!Optional(HtmlSymbolType.CloseAngle)) { - Context.OnError(tagStart, RazorResources.ParseError_UnfinishedTag, "script"); + Context.OnError(tagStart, RazorResources.ParseError_UnfinishedTag("script")); } seenEndScript = true; } @@ -781,11 +780,11 @@ namespace Microsoft.AspNet.Razor.Parser } if (currentTag != null) { - Context.OnError(currentTag.Item2, RazorResources.ParseError_MissingEndTag, currentTag.Item1.Content); + Context.OnError(currentTag.Item2, RazorResources.ParseError_MissingEndTag(currentTag.Item1.Content)); } else { - Context.OnError(tagStart, RazorResources.ParseError_UnexpectedEndTag, tagName); + Context.OnError(tagStart, RazorResources.ParseError_UnexpectedEndTag(tagName)); } return false; } @@ -800,7 +799,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.ParseError_MissingEndTag(tag.Item1.Content)); } else if (complete) { diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Document.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Document.cs index 18f648f009..aabcf08b6d 100644 --- a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Document.cs +++ b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Document.cs @@ -2,7 +2,6 @@ using System; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Tokenizer.Symbols; namespace Microsoft.AspNet.Razor.Parser diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Section.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Section.cs index 893c706e90..e47b17076f 100644 --- a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Section.cs +++ b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Section.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Tokenizer.Symbols; namespace Microsoft.AspNet.Razor.Parser diff --git a/src/Microsoft.AspNet.Razor/Parser/ParserBase.cs b/src/Microsoft.AspNet.Razor/Parser/ParserBase.cs index 94f93b0e77..ac4b93a3c1 100644 --- a/src/Microsoft.AspNet.Razor/Parser/ParserBase.cs +++ b/src/Microsoft.AspNet.Razor/Parser/ParserBase.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; namespace Microsoft.AspNet.Razor.Parser diff --git a/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs b/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs index a027968cef..8bc8f349f6 100644 --- a/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs +++ b/src/Microsoft.AspNet.Razor/Parser/ParserContext.cs @@ -8,7 +8,6 @@ using System.Globalization; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Utils; diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs index 361b0b0f13..1cd030b4b0 100644 --- a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs +++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs @@ -6,7 +6,6 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using Microsoft.AspNet.Razor.Generator; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; namespace Microsoft.AspNet.Razor.Parser.SyntaxTree diff --git a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs index ebcfd2128a..f1694d7a82 100644 --- a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs +++ b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs @@ -9,7 +9,6 @@ using System.Linq; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -73,9 +72,9 @@ namespace Microsoft.AspNet.Razor.Parser if (EndOfFile && !mode.HasFlag(BalancingModes.NoErrorOnFailure)) { Context.OnError(start, - RazorResources.ParseError_Expected_CloseBracket_Before_EOF, - Language.GetSample(left), - Language.GetSample(right)); + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( + Language.GetSample(left), + Language.GetSample(right))); } return Balance(mode, left, right, start); @@ -121,9 +120,9 @@ namespace Microsoft.AspNet.Razor.Parser if (!mode.HasFlag(BalancingModes.NoErrorOnFailure)) { Context.OnError(start, - RazorResources.ParseError_Expected_CloseBracket_Before_EOF, - Language.GetSample(left), - Language.GetSample(right)); + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( + Language.GetSample(left), + Language.GetSample(right))); } if (mode.HasFlag(BalancingModes.BacktrackOnFailure)) { @@ -333,7 +332,7 @@ namespace Microsoft.AspNet.Razor.Parser return false; } - protected internal bool Required(TSymbolType expected, bool errorIfNotFound, string errorBase) + protected internal bool Required(TSymbolType expected, bool errorIfNotFound, Func errorBase) { bool found = At(expected); if (!found && errorIfNotFound) @@ -353,13 +352,12 @@ namespace Microsoft.AspNet.Razor.Parser } else { - error = String.Format(CultureInfo.CurrentCulture, RazorResources.ErrorComponent_Character, CurrentSymbol.Content); + error = RazorResources.ErrorComponent_Character(CurrentSymbol.Content); } Context.OnError( CurrentLocation, - errorBase, - error); + errorBase(error)); } return found; } diff --git a/src/Microsoft.AspNet.Razor/Properties/CommonResources.Designer.cs b/src/Microsoft.AspNet.Razor/Properties/CommonResources.Designer.cs new file mode 100644 index 0000000000..a557be4f79 --- /dev/null +++ b/src/Microsoft.AspNet.Razor/Properties/CommonResources.Designer.cs @@ -0,0 +1,85 @@ +// + +namespace Microsoft.AspNet.Razor +{ + using System.Globalization; + using System.Reflection; + using System.Resources; + + internal static class CommonResources + { + private static readonly ResourceManager _resourceManager + = new ResourceManager("Microsoft.AspNet.Razor.CommonResources", typeof(CommonResources).GetTypeInfo().Assembly); + + /// + /// Value cannot be null or an empty string. + /// + internal static string Argument_Cannot_Be_Null_Or_Empty + { + get { 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_Between"), p0, p1); + } + + /// + /// Value must be a value from the "{0}" enumeration. + /// + internal static string Argument_Must_Be_Enum_Member(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_Enum_Member"), p0); + } + + /// + /// Value must be greater than {0}. + /// + internal static string Argument_Must_Be_GreaterThan(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_GreaterThan"), p0); + } + + /// + /// Value must be greater than or equal to {0}. + /// + internal static string Argument_Must_Be_GreaterThanOrEqualTo(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_GreaterThanOrEqualTo"), p0); + } + + /// + /// Value must be less than {0}. + /// + internal static string Argument_Must_Be_LessThan(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_LessThan"), p0); + } + + /// + /// Value must be less than or equal to {0}. + /// + internal static string Argument_Must_Be_LessThanOrEqualTo(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Argument_Must_Be_LessThanOrEqualTo"), p0); + } + + /// + /// Value cannot be an empty string. It must either be null or a non-empty string. + /// + internal static string Argument_Must_Be_Null_Or_Non_Empty + { + get { return GetString("Argument_Must_Be_Null_Or_Non_Empty"); } + } + + private static string GetString(string name) + { + string value = _resourceManager.GetString(name); + System.Diagnostics.Debug.Assert(value != null); + return value; + } + } +} diff --git a/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs b/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs new file mode 100644 index 0000000000..8b136c57bf --- /dev/null +++ b/src/Microsoft.AspNet.Razor/Properties/RazorResources.Designer.cs @@ -0,0 +1,740 @@ + +// + +namespace Microsoft.AspNet.Razor +{ + using System.Globalization; + using System.Reflection; + using System.Resources; + + internal static class RazorResources + { + private static readonly ResourceManager _resourceManager + = new ResourceManager("Microsoft.AspNet.Razor.RazorResources", typeof(RazorResources).GetTypeInfo().Assembly); + + /// + /// The active parser must 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"); } + } + + /// + /// code + /// + internal static string BlockName_Code + { + get { return GetString("BlockName_Code"); } + } + + /// + /// explicit expression + /// + internal static string BlockName_ExplicitExpression + { + get { return GetString("BlockName_ExplicitExpression"); } + } + + /// + /// The "CancelBacktrack" method can be called only while in a look-ahead process started with the "BeginLookahead" method. + /// + internal static string CancelBacktrack_Must_Be_Called_Within_Lookahead + { + get { return GetString("CancelBacktrack_Must_Be_Called_Within_Lookahead"); } + } + + /// + /// "EndBlock" was called without a matching call to "StartBlock". + /// + internal static string EndBlock_Called_Without_Matching_StartBlock + { + get { 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: + /// + /// @if(isLoggedIn) { + /// <p>Hello, @user!</p> + /// } + /// + internal static string ParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start + { + get { 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. + /// + internal static string ParseError_BlockComment_Not_Terminated + { + get { 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Expected_CloseBracket_Before_EOF"), p0, p1); + } + + /// + /// 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Expected_EndOfBlock_Before_EOF"), p0, p1, p2); + } + + /// + /// Expected "{0}". + /// + internal static string ParseError_Expected_X(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Expected_X"), p0); + } + + /// + /// Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed. + /// + internal static string ParseError_InlineMarkup_Blocks_Cannot_Be_Nested + { + get { 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/>". + /// + internal static string ParseError_MarkupBlock_Must_Start_With_Tag + { + get { 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_MissingEndTag"), p0); + } + + /// + /// 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 ParseError_MissingOpenBraceAfterSection + { + get { 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: + /// + /// @using System.Drawing; + /// @{ + /// // OK here to use types from System.Drawing in the page. + /// } + /// + internal static string ParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock + { + get { 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: + /// + /// @if(isLoggedIn) + /// <p>Hello, @user</p> + /// + /// Instead, wrap the contents of the block in "{{}}": + /// + /// @if(isLoggedIn) {{ + /// <p>Hello, @user</p> + /// }} + /// + internal static string ParseError_SingleLine_ControlFlowStatements_Not_Allowed(object p0, object p1) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_SingleLine_ControlFlowStatements_Not_Allowed"), p0, p1); + } + + /// + /// Encountered end tag "{0}" with no matching start tag. Are your start/end tags properly balanced? + /// + internal static string ParseError_UnexpectedEndTag(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_UnexpectedEndTag"), p0); + } + + /// + /// 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected_Character_At_Section_Name_Start"), p0); + } + + /// + /// "{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) + { + 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. + /// + internal static string ParseError_UnfinishedTag(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_UnfinishedTag"), p0); + } + + /// + /// 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 ParseError_Unterminated_String_Literal + { + get { return GetString("ParseError_Unterminated_String_Literal"); } + } + + /// + /// Unknown option: "{0}". + /// + internal static string ParseError_UnknownOption(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_UnknownOption"), p0); + } + + /// + /// 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_BlockNotTerminated"), p0, p1); + } + + /// + /// @section Header { ... } + /// + internal static string SectionExample_CS + { + get { return GetString("SectionExample_CS"); } + } + + /// + /// "<text>" and "</text>" tags cannot contain attributes. + /// + internal static string ParseError_TextTagCannotContainAttributes + { + get { return GetString("ParseError_TextTagCannotContainAttributes"); } + } + + /// + /// The "Imports" keyword must be followed by a namespace or a type alias on the same line. + /// + internal static string ParseError_NamespaceOrTypeAliasExpected + { + get { 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. + /// + internal static string ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS + { + get { return GetString("ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS"); } + } + + /// + /// The 'inherits' keyword must be followed by a type name on the same line. + /// + internal static string ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName + { + get { 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. + /// + internal static string ParseError_OuterTagMissingName + { + get { 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. + /// + internal static string ParseError_RazorComment_Not_Terminated + { + get { return GetString("ParseError_RazorComment_Not_Terminated"); } + } + + /// + /// "{0}" character + /// + internal static string ErrorComponent_Character(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ErrorComponent_Character"), p0); + } + + /// + /// end of file + /// + internal static string ErrorComponent_EndOfFile + { + get { return GetString("ErrorComponent_EndOfFile"); } + } + + /// + /// space or line break + /// + internal static string ErrorComponent_Whitespace + { + get { 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: "@@" + /// + internal static string ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock + { + get { 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Structure_Member_CannotBeNull"), p0, p1); + } + + /// + /// Expected a "{0}" after the helper parameters. + /// + internal static string ParseError_MissingCharAfterHelperParameters(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_MissingCharAfterHelperParameters"), p0); + } + + /// + /// Expected a "{0}" after the helper name. + /// + internal static string ParseError_MissingCharAfterHelperName(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_MissingCharAfterHelperName"), p0); + } + + /// + /// Helper parameter list is missing a closing ")". + /// + internal static string ParseError_UnterminatedHelperParameterList + { + get { return GetString("ParseError_UnterminatedHelperParameterList"); } + } + + /// + /// Helper blocks cannot be nested within each other. + /// + internal static string ParseError_Helpers_Cannot_Be_Nested + { + get { 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. + /// + internal static string Parser_Context_Not_Set + { + get { 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected_Keyword_After_At"), p0); + } + + /// + /// "{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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_ReservedWord"), p0); + } + + /// + /// 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected_Character_At_Helper_Name_Start"), p0); + } + + /// + /// Cannot resume this symbol. Only the symbol immediately preceding the current one can be resumed. + /// + internal static string Tokenizer_CannotResumeSymbolUnlessIsPrevious + { + get { return GetString("Tokenizer_CannotResumeSymbolUnlessIsPrevious"); } + } + + /// + /// Cannot finish span, there is no current block. Call StartBlock at least once before finishing a span + /// + internal static string ParserContext_NoCurrentBlock + { + get { return GetString("ParserContext_NoCurrentBlock"); } + } + + /// + /// Cannot complete the tree, there are still open blocks. + /// + internal static string ParserContext_CannotCompleteTree_OutstandingBlocks + { + get { return GetString("ParserContext_CannotCompleteTree_OutstandingBlocks"); } + } + + /// + /// Cannot complete the tree, StartBlock must be called at least once. + /// + internal static string ParserContext_CannotCompleteTree_NoRootBlock + { + get { 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 + /// + internal static string ParserContext_ParseComplete + { + get { return GetString("ParserContext_ParseComplete"); } + } + + /// + /// Block cannot be built because a Type has not been specified in the BlockBuilder + /// + internal static string Block_Type_Not_Specified + { + get { return GetString("Block_Type_Not_Specified"); } + } + + /// + /// <<character literal>> + /// + internal static string CSharpSymbol_CharacterLiteral + { + get { return GetString("CSharpSymbol_CharacterLiteral"); } + } + + /// + /// <<comment>> + /// + internal static string CSharpSymbol_Comment + { + get { return GetString("CSharpSymbol_Comment"); } + } + + /// + /// <<identifier>> + /// + internal static string CSharpSymbol_Identifier + { + get { return GetString("CSharpSymbol_Identifier"); } + } + + /// + /// <<integer literal>> + /// + internal static string CSharpSymbol_IntegerLiteral + { + get { return GetString("CSharpSymbol_IntegerLiteral"); } + } + + /// + /// <<keyword>> + /// + internal static string CSharpSymbol_Keyword + { + get { return GetString("CSharpSymbol_Keyword"); } + } + + /// + /// <<newline sequence>> + /// + internal static string CSharpSymbol_Newline + { + get { return GetString("CSharpSymbol_Newline"); } + } + + /// + /// <<real literal>> + /// + internal static string CSharpSymbol_RealLiteral + { + get { return GetString("CSharpSymbol_RealLiteral"); } + } + + /// + /// <<string literal>> + /// + internal static string CSharpSymbol_StringLiteral + { + get { return GetString("CSharpSymbol_StringLiteral"); } + } + + /// + /// <<white space>> + /// + internal static string CSharpSymbol_Whitespace + { + get { return GetString("CSharpSymbol_Whitespace"); } + } + + /// + /// <<unknown>> + /// + internal static string Symbol_Unknown + { + get { 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("TokenizerView_CannotPutBack"), p0, p1); + } + + /// + /// Unexpected "{0}" + /// + internal static string ParseError_Unexpected(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Unexpected"), p0); + } + + /// + /// 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 ParseError_Unexpected_Nested_CodeBlock + { + get { return GetString("ParseError_Unexpected_Nested_CodeBlock"); } + } + + /// + /// line break + /// + internal static string ErrorComponent_Newline + { + get { return GetString("ErrorComponent_Newline"); } + } + + /// + /// <<newline sequence>> + /// + internal static string HtmlSymbol_NewLine + { + get { return GetString("HtmlSymbol_NewLine"); } + } + + /// + /// <<razor comment>> + /// + internal static string HtmlSymbol_RazorComment + { + get { return GetString("HtmlSymbol_RazorComment"); } + } + + /// + /// <<text>> + /// + internal static string HtmlSymbol_Text + { + get { return GetString("HtmlSymbol_Text"); } + } + + /// + /// <<white space>> + /// + internal static string HtmlSymbol_WhiteSpace + { + get { return GetString("HtmlSymbol_WhiteSpace"); } + } + + /// + /// The parser provided to the ParserContext was not a Markup Parser. + /// + internal static string ParserIsNotAMarkupParser + { + get { 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 + /// + internal static string Language_Does_Not_Support_RazorComment + { + get { return GetString("Language_Does_Not_Support_RazorComment"); } + } + + /// + /// Missing value for session state directive. + /// + internal static string ParserEror_SessionDirectiveMissingValue + { + get { return GetString("ParserEror_SessionDirectiveMissingValue"); } + } + + /// + /// Cannot call CreateCodeWriter, a CodeWriter was not provided to the Create method + /// + internal static string CreateCodeWriter_NoCodeWriter + { + get { return GetString("CreateCodeWriter_NoCodeWriter"); } + } + + /// + /// [BG][{0}] Shutdown + /// + internal static string Trace_BackgroundThreadShutdown(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_BackgroundThreadShutdown"), p0); + } + + /// + /// [BG][{0}] Startup + /// + internal static string Trace_BackgroundThreadStart(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_BackgroundThreadStart"), p0); + } + + /// + /// [BG][{0}] {1} changes arrived + /// + internal static string Trace_ChangesArrived(object p0, object p1) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_ChangesArrived"), p0, p1); + } + + /// + /// [BG][{0}] Discarded {1} changes + /// + internal static string Trace_ChangesDiscarded(object p0, object p1) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_ChangesDiscarded"), p0, p1); + } + + /// + /// [BG][{0}] Collecting {1} discarded changes + /// + internal static string Trace_CollectedDiscardedChanges(object p0, object p1) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_CollectedDiscardedChanges"), p0, p1); + } + + /// + /// Disabled + /// + internal static string Trace_Disabled + { + get { 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) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_EditorProcessedChange"), p0, p1, p2, p3); + } + + /// + /// [P][{0}] Received Change: {1} + /// + internal static string Trace_EditorReceivedChange(object p0, object p1) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_EditorReceivedChange"), p0, p1); + } + + /// + /// Enabled + /// + internal static string Trace_Enabled + { + get { return GetString("Trace_Enabled"); } + } + + /// + /// [Razor] {0} + /// + internal static string Trace_Format(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_Format"), p0); + } + + /// + /// [BG][{0}] no changes arrived? + /// + internal static string Trace_NoChangesArrived(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_NoChangesArrived"), p0); + } + + /// + /// [BG][{0}] Parse Complete in {1} milliseconds + /// + internal static string Trace_ParseComplete(object p0, object p1) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_ParseComplete"), p0, p1); + } + + /// + /// [M][{0}] Queuing Parse for: {1} + /// + internal static string Trace_QueuingParse(object p0, object p1) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_QueuingParse"), p0, p1); + } + + /// + /// [Razor] Editor Tracing {0} + /// + internal static string Trace_Startup(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_Startup"), p0); + } + + /// + /// [BG][{0}] Trees Compared in {1} milliseconds. Different = {2} + /// + internal static string Trace_TreesCompared(object p0, object p1, object p2) + { + return string.Format(CultureInfo.CurrentCulture, GetString("Trace_TreesCompared"), p0, p1, p2); + } + + /// + /// Section blocks ("{0}") cannot be nested. Only one level of section blocks are allowed. + /// + internal static string ParseError_Sections_Cannot_Be_Nested(object p0) + { + return string.Format(CultureInfo.CurrentCulture, GetString("ParseError_Sections_Cannot_Be_Nested"), p0); + } + + private static string GetString(string name) + { + string value = _resourceManager.GetString(name); + System.Diagnostics.Debug.Assert(value != null); + return value; + } + } +} diff --git a/src/Microsoft.AspNet.Razor/RazorEditorParser.cs b/src/Microsoft.AspNet.Razor/RazorEditorParser.cs index 602a063b99..c9dccd1617 100644 --- a/src/Microsoft.AspNet.Razor/RazorEditorParser.cs +++ b/src/Microsoft.AspNet.Razor/RazorEditorParser.cs @@ -7,7 +7,6 @@ using System.Globalization; using System.IO; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.Internal.Web.Utils; @@ -131,11 +130,10 @@ namespace Microsoft.AspNet.Razor Stopwatch sw = new Stopwatch(); sw.Start(); #endif - RazorEditorTrace.TraceLine(RazorResources.Trace_EditorReceivedChange, Path.GetFileName(FileName), change); + RazorEditorTrace.TraceLine(RazorResources.Trace_EditorReceivedChange(Path.GetFileName(FileName), change)); if (change.NewBuffer == null) { - throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, - RazorResources.Structure_Member_CannotBeNull, + throw new ArgumentException(RazorResources.Structure_Member_CannotBeNull( "Buffer", "TextChange"), "change"); } @@ -171,7 +169,11 @@ namespace Microsoft.AspNet.Razor elapsedMs = sw.ElapsedMilliseconds; sw.Reset(); #endif - RazorEditorTrace.TraceLine(RazorResources.Trace_EditorProcessedChange, Path.GetFileName(FileName), changeString, elapsedMs.HasValue ? elapsedMs.Value.ToString(CultureInfo.InvariantCulture) : "?", result.ToString()); + RazorEditorTrace.TraceLine( + RazorResources.Trace_EditorProcessedChange( + Path.GetFileName(FileName), + changeString, elapsedMs.HasValue ? elapsedMs.Value.ToString(CultureInfo.InvariantCulture) : "?", + result.ToString())); return result; } diff --git a/src/Microsoft.AspNet.Razor/RazorResources.Designer.cs b/src/Microsoft.AspNet.Razor/RazorResources.Designer.cs deleted file mode 100644 index 6810597b86..0000000000 --- a/src/Microsoft.AspNet.Razor/RazorResources.Designer.cs +++ /dev/null @@ -1,1051 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34003 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.AspNet.Razor.Resources -{ - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class RazorResources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal RazorResources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNet.Razor.RazorResources", System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(RazorResources)).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to The active parser must the same as either the markup or code parser.. - /// - internal static string ActiveParser_Must_Be_Code_Or_Markup_Parser - { - get - { - return ResourceManager.GetString("ActiveParser_Must_Be_Code_Or_Markup_Parser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Block cannot be built because a Type has not been specified in the BlockBuilder. - /// - internal static string Block_Type_Not_Specified - { - get - { - return ResourceManager.GetString("Block_Type_Not_Specified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to code. - /// - internal static string BlockName_Code - { - get - { - return ResourceManager.GetString("BlockName_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to explicit expression. - /// - internal static string BlockName_ExplicitExpression - { - get - { - return ResourceManager.GetString("BlockName_ExplicitExpression", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The "CancelBacktrack" method can be called only while in a look-ahead process started with the "BeginLookahead" method.. - /// - internal static string CancelBacktrack_Must_Be_Called_Within_Lookahead - { - get - { - return ResourceManager.GetString("CancelBacktrack_Must_Be_Called_Within_Lookahead", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot call CreateCodeWriter, a CodeWriter was not provided to the Create method. - /// - internal static string CreateCodeWriter_NoCodeWriter - { - get - { - return ResourceManager.GetString("CreateCodeWriter_NoCodeWriter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<character literal>>. - /// - internal static string CSharpSymbol_CharacterLiteral - { - get - { - return ResourceManager.GetString("CSharpSymbol_CharacterLiteral", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<comment>>. - /// - internal static string CSharpSymbol_Comment - { - get - { - return ResourceManager.GetString("CSharpSymbol_Comment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<identifier>>. - /// - internal static string CSharpSymbol_Identifier - { - get - { - return ResourceManager.GetString("CSharpSymbol_Identifier", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<integer literal>>. - /// - internal static string CSharpSymbol_IntegerLiteral - { - get - { - return ResourceManager.GetString("CSharpSymbol_IntegerLiteral", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<keyword>>. - /// - internal static string CSharpSymbol_Keyword - { - get - { - return ResourceManager.GetString("CSharpSymbol_Keyword", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<newline sequence>>. - /// - internal static string CSharpSymbol_Newline - { - get - { - return ResourceManager.GetString("CSharpSymbol_Newline", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<real literal>>. - /// - internal static string CSharpSymbol_RealLiteral - { - get - { - return ResourceManager.GetString("CSharpSymbol_RealLiteral", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<string literal>>. - /// - internal static string CSharpSymbol_StringLiteral - { - get - { - return ResourceManager.GetString("CSharpSymbol_StringLiteral", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<white space>>. - /// - internal static string CSharpSymbol_Whitespace - { - get - { - return ResourceManager.GetString("CSharpSymbol_Whitespace", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to "EndBlock" was called without a matching call to "StartBlock".. - /// - internal static string EndBlock_Called_Without_Matching_StartBlock - { - get - { - return ResourceManager.GetString("EndBlock_Called_Without_Matching_StartBlock", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to "{0}" character. - /// - internal static string ErrorComponent_Character - { - get - { - return ResourceManager.GetString("ErrorComponent_Character", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to end of file. - /// - internal static string ErrorComponent_EndOfFile - { - get - { - return ResourceManager.GetString("ErrorComponent_EndOfFile", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to line break. - /// - internal static string ErrorComponent_Newline - { - get - { - return ResourceManager.GetString("ErrorComponent_Newline", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to space or line break. - /// - internal static string ErrorComponent_Whitespace - { - get - { - return ResourceManager.GetString("ErrorComponent_Whitespace", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<newline sequence>>. - /// - internal static string HtmlSymbol_NewLine - { - get - { - return ResourceManager.GetString("HtmlSymbol_NewLine", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<razor comment>>. - /// - internal static string HtmlSymbol_RazorComment - { - get - { - return ResourceManager.GetString("HtmlSymbol_RazorComment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<text>>. - /// - internal static string HtmlSymbol_Text - { - get - { - return ResourceManager.GetString("HtmlSymbol_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<white space>>. - /// - internal static string HtmlSymbol_WhiteSpace - { - get - { - return ResourceManager.GetString("HtmlSymbol_WhiteSpace", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 Language_Does_Not_Support_RazorComment - { - get - { - return ResourceManager.GetString("Language_Does_Not_Support_RazorComment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start - { - get - { - return ResourceManager.GetString("ParseError_AtInCode_Must_Be_Followed_By_Colon_Paren_Or_Identifier_Start", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_BlockComment_Not_Terminated - { - get - { - return ResourceManager.GetString("ParseError_BlockComment_Not_Terminated", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The "{0}" block was not terminated. All "{0}" statements must be terminated with a matching "{1}".. - /// - internal static string ParseError_BlockNotTerminated - { - get - { - return ResourceManager.GetString("ParseError_BlockNotTerminated", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An opening "{0}" is missing the corresponding closing "{1}".. - /// - internal static string ParseError_Expected_CloseBracket_Before_EOF - { - get - { - return ResourceManager.GetString("ParseError_Expected_CloseBracket_Before_EOF", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 - { - get - { - return ResourceManager.GetString("ParseError_Expected_EndOfBlock_Before_EOF", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Expected "{0}".. - /// - internal static string ParseError_Expected_X - { - get - { - return ResourceManager.GetString("ParseError_Expected_X", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Helper blocks cannot be nested within each other.. - /// - internal static string ParseError_Helpers_Cannot_Be_Nested - { - get - { - return ResourceManager.GetString("ParseError_Helpers_Cannot_Be_Nested", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The 'inherits' keyword must be followed by a type name on the same line.. - /// - internal static string ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName - { - get - { - return ResourceManager.GetString("ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed.. - /// - internal static string ParseError_InlineMarkup_Blocks_Cannot_Be_Nested - { - get - { - return ResourceManager.GetString("ParseError_InlineMarkup_Blocks_Cannot_Be_Nested", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_MarkupBlock_Must_Start_With_Tag - { - get - { - return ResourceManager.GetString("ParseError_MarkupBlock_Must_Start_With_Tag", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Expected a "{0}" after the helper name.. - /// - internal static string ParseError_MissingCharAfterHelperName - { - get - { - return ResourceManager.GetString("ParseError_MissingCharAfterHelperName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Expected a "{0}" after the helper parameters.. - /// - internal static string ParseError_MissingCharAfterHelperParameters - { - get - { - return ResourceManager.GetString("ParseError_MissingCharAfterHelperParameters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The "{0}" element was not closed. All elements must be either self-closing or have a matching end tag.. - /// - internal static string ParseError_MissingEndTag - { - get - { - return ResourceManager.GetString("ParseError_MissingEndTag", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_MissingOpenBraceAfterSection - { - get - { - return ResourceManager.GetString("ParseError_MissingOpenBraceAfterSection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock - { - get - { - return ResourceManager.GetString("ParseError_NamespaceImportAndTypeAlias_Cannot_Exist_Within_CodeBlock", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The "Imports" keyword must be followed by a namespace or a type alias on the same line.. - /// - internal static string ParseError_NamespaceOrTypeAliasExpected - { - get - { - return ResourceManager.GetString("ParseError_NamespaceOrTypeAliasExpected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_OuterTagMissingName - { - get - { - return ResourceManager.GetString("ParseError_OuterTagMissingName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_RazorComment_Not_Terminated - { - get - { - return ResourceManager.GetString("ParseError_RazorComment_Not_Terminated", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to "{0}" is a reserved word and cannot be used in implicit expressions. An explicit expression ("@()") must be used.. - /// - internal static string ParseError_ReservedWord - { - get - { - return ResourceManager.GetString("ParseError_ReservedWord", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Section blocks ("{0}") cannot be nested. Only one level of section blocks are allowed.. - /// - internal static string ParseError_Sections_Cannot_Be_Nested - { - get - { - return ResourceManager.GetString("ParseError_Sections_Cannot_Be_Nested", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_SingleLine_ControlFlowStatements_Not_Allowed - { - get - { - return ResourceManager.GetString("ParseError_SingleLine_ControlFlowStatements_Not_Allowed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to "<text>" and "</text>" tags cannot contain attributes.. - /// - internal static string ParseError_TextTagCannotContainAttributes - { - get - { - return ResourceManager.GetString("ParseError_TextTagCannotContainAttributes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unexpected "{0}". - /// - internal static string ParseError_Unexpected - { - get - { - return ResourceManager.GetString("ParseError_Unexpected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 - { - get - { - return ResourceManager.GetString("ParseError_Unexpected_Character_At_Helper_Name_Start", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 - { - get - { - return ResourceManager.GetString("ParseError_Unexpected_Character_At_Section_Name_Start", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to "{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 - { - get - { - return ResourceManager.GetString("ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock - { - get - { - return ResourceManager.GetString("ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 - { - get - { - return ResourceManager.GetString("ParseError_Unexpected_Keyword_After_At", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_Unexpected_Nested_CodeBlock - { - get - { - return ResourceManager.GetString("ParseError_Unexpected_Nested_CodeBlock", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS - { - get - { - return ResourceManager.GetString("ParseError_Unexpected_WhiteSpace_At_Start_Of_CodeBlock_CS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Encountered end tag "{0}" with no matching start tag. Are your start/end tags properly balanced?. - /// - internal static string ParseError_UnexpectedEndTag - { - get - { - return ResourceManager.GetString("ParseError_UnexpectedEndTag", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 - { - get - { - return ResourceManager.GetString("ParseError_UnfinishedTag", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown option: "{0}".. - /// - internal static string ParseError_UnknownOption - { - get - { - return ResourceManager.GetString("ParseError_UnknownOption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParseError_Unterminated_String_Literal - { - get - { - return ResourceManager.GetString("ParseError_Unterminated_String_Literal", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Helper parameter list is missing a closing ")".. - /// - internal static string ParseError_UnterminatedHelperParameterList - { - get - { - return ResourceManager.GetString("ParseError_UnterminatedHelperParameterList", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Parser was started with a null Context property. The Context property must be set BEFORE calling any methods on the parser.. - /// - internal static string Parser_Context_Not_Set - { - get - { - return ResourceManager.GetString("Parser_Context_Not_Set", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot complete the tree, StartBlock must be called at least once.. - /// - internal static string ParserContext_CannotCompleteTree_NoRootBlock - { - get - { - return ResourceManager.GetString("ParserContext_CannotCompleteTree_NoRootBlock", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot complete the tree, there are still open blocks.. - /// - internal static string ParserContext_CannotCompleteTree_OutstandingBlocks - { - get - { - return ResourceManager.GetString("ParserContext_CannotCompleteTree_OutstandingBlocks", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot finish span, there is no current block. Call StartBlock at least once before finishing a span. - /// - internal static string ParserContext_NoCurrentBlock - { - get - { - return ResourceManager.GetString("ParserContext_NoCurrentBlock", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 ParserContext_ParseComplete - { - get - { - return ResourceManager.GetString("ParserContext_ParseComplete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Missing value for session state directive.. - /// - internal static string ParserEror_SessionDirectiveMissingValue - { - get - { - return ResourceManager.GetString("ParserEror_SessionDirectiveMissingValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The parser provided to the ParserContext was not a Markup Parser.. - /// - internal static string ParserIsNotAMarkupParser - { - get - { - return ResourceManager.GetString("ParserIsNotAMarkupParser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to @section Header { ... }. - /// - internal static string SectionExample_CS - { - get - { - return ResourceManager.GetString("SectionExample_CS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The {0} property of the {1} structure cannot be null.. - /// - internal static string Structure_Member_CannotBeNull - { - get - { - return ResourceManager.GetString("Structure_Member_CannotBeNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <<unknown>>. - /// - internal static string Symbol_Unknown - { - get - { - return ResourceManager.GetString("Symbol_Unknown", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot resume this symbol. Only the symbol immediately preceding the current one can be resumed.. - /// - internal static string Tokenizer_CannotResumeSymbolUnlessIsPrevious - { - get - { - return ResourceManager.GetString("Tokenizer_CannotResumeSymbolUnlessIsPrevious", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 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 - { - get - { - return ResourceManager.GetString("TokenizerView_CannotPutBack", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [BG][{0}] Shutdown. - /// - internal static string Trace_BackgroundThreadShutdown - { - get - { - return ResourceManager.GetString("Trace_BackgroundThreadShutdown", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [BG][{0}] Startup. - /// - internal static string Trace_BackgroundThreadStart - { - get - { - return ResourceManager.GetString("Trace_BackgroundThreadStart", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [BG][{0}] {1} changes arrived. - /// - internal static string Trace_ChangesArrived - { - get - { - return ResourceManager.GetString("Trace_ChangesArrived", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [BG][{0}] Discarded {1} changes. - /// - internal static string Trace_ChangesDiscarded - { - get - { - return ResourceManager.GetString("Trace_ChangesDiscarded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [BG][{0}] Collecting {1} discarded changes. - /// - internal static string Trace_CollectedDiscardedChanges - { - get - { - return ResourceManager.GetString("Trace_CollectedDiscardedChanges", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Disabled. - /// - internal static string Trace_Disabled - { - get - { - return ResourceManager.GetString("Trace_Disabled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [P][{0}] {3} Change in {2} milliseconds: {1}. - /// - internal static string Trace_EditorProcessedChange - { - get - { - return ResourceManager.GetString("Trace_EditorProcessedChange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [P][{0}] Received Change: {1}. - /// - internal static string Trace_EditorReceivedChange - { - get - { - return ResourceManager.GetString("Trace_EditorReceivedChange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enabled. - /// - internal static string Trace_Enabled - { - get - { - return ResourceManager.GetString("Trace_Enabled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Razor] {0}. - /// - internal static string Trace_Format - { - get - { - return ResourceManager.GetString("Trace_Format", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [BG][{0}] no changes arrived?. - /// - internal static string Trace_NoChangesArrived - { - get - { - return ResourceManager.GetString("Trace_NoChangesArrived", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [BG][{0}] Parse Complete in {1} milliseconds. - /// - internal static string Trace_ParseComplete - { - get - { - return ResourceManager.GetString("Trace_ParseComplete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [M][{0}] Queuing Parse for: {1}. - /// - internal static string Trace_QueuingParse - { - get - { - return ResourceManager.GetString("Trace_QueuingParse", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Razor] Editor Tracing {0}. - /// - internal static string Trace_Startup - { - get - { - return ResourceManager.GetString("Trace_Startup", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [BG][{0}] Trees Compared in {1} milliseconds. Different = {2}. - /// - internal static string Trace_TreesCompared - { - get - { - return ResourceManager.GetString("Trace_TreesCompared", resourceCulture); - } - } - } -} diff --git a/src/Microsoft.AspNet.Razor/Text/BufferingTextReader.cs b/src/Microsoft.AspNet.Razor/Text/BufferingTextReader.cs index b2e8fa7e13..c1d5bcaa2a 100644 --- a/src/Microsoft.AspNet.Razor/Text/BufferingTextReader.cs +++ b/src/Microsoft.AspNet.Razor/Text/BufferingTextReader.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Utils; namespace Microsoft.AspNet.Razor.Text diff --git a/src/Microsoft.AspNet.Razor/Text/TextBufferReader.cs b/src/Microsoft.AspNet.Razor/Text/TextBufferReader.cs index 07616a2c23..37ea9ae8a1 100644 --- a/src/Microsoft.AspNet.Razor/Text/TextBufferReader.cs +++ b/src/Microsoft.AspNet.Razor/Text/TextBufferReader.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Utils; namespace Microsoft.AspNet.Razor.Text diff --git a/src/Microsoft.AspNet.Razor/Text/TextChange.cs b/src/Microsoft.AspNet.Razor/Text/TextChange.cs index deac9027bd..9048f8334c 100644 --- a/src/Microsoft.AspNet.Razor/Text/TextChange.cs +++ b/src/Microsoft.AspNet.Razor/Text/TextChange.cs @@ -27,19 +27,19 @@ namespace Microsoft.AspNet.Razor.Text { if (oldPosition < 0) { - throw new ArgumentOutOfRangeException("oldPosition", String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Must_Be_GreaterThanOrEqualTo, "0")); + throw new ArgumentOutOfRangeException("oldPosition", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); } if (newPosition < 0) { - throw new ArgumentOutOfRangeException("newPosition", String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Must_Be_GreaterThanOrEqualTo, "0")); + throw new ArgumentOutOfRangeException("newPosition", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); } if (oldLength < 0) { - throw new ArgumentOutOfRangeException("oldLength", String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Must_Be_GreaterThanOrEqualTo, "0")); + throw new ArgumentOutOfRangeException("oldLength", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); } if (newLength < 0) { - throw new ArgumentOutOfRangeException("newLength", String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Must_Be_GreaterThanOrEqualTo, "0")); + throw new ArgumentOutOfRangeException("newLength", CommonResources.Argument_Must_Be_GreaterThanOrEqualTo(0)); } if (oldBuffer == null) { diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/CSharpTokenizer.cs b/src/Microsoft.AspNet.Razor/Tokenizer/CSharpTokenizer.cs index c59f72e628..af0ae0da75 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/CSharpTokenizer.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/CSharpTokenizer.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Diagnostics; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs index ea0fc1b031..07bb748672 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs @@ -9,7 +9,6 @@ using System.Linq; using System.Text; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs b/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs index fb21af5c5a..c9b3e1e88c 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/TokenizerView.cs @@ -4,7 +4,6 @@ using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -43,10 +42,9 @@ namespace Microsoft.AspNet.Razor.Tokenizer { // We've already passed this symbol throw new InvalidOperationException( - String.Format(CultureInfo.CurrentCulture, - RazorResources.TokenizerView_CannotPutBack, - symbol.Start.AbsoluteIndex + symbol.Content.Length, - Source.Position)); + RazorResources.TokenizerView_CannotPutBack( + symbol.Start.AbsoluteIndex + symbol.Content.Length, + Source.Position)); } Source.Position -= symbol.Content.Length; Current = null; diff --git a/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs b/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs index ba81cb16b8..f4cfe31f30 100644 --- a/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs @@ -6,7 +6,6 @@ using System.Web.WebPages.TestUtils; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Test.Utils; using Microsoft.AspNet.Razor.Text; @@ -105,7 +104,7 @@ namespace Microsoft.AspNet.Razor.Test.Editor CreateHost(), "C:\\Foo.cshtml").CheckForStructureChanges(change), "change", - String.Format(RazorResources.Structure_Member_CannotBeNull, "Buffer", "TextChange")); + RazorResources.Structure_Member_CannotBeNull("Buffer", "TextChange")); } private static RazorEngineHost CreateHost() diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs index 01f69de471..ed9634e04f 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -29,7 +28,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp { AutoCompleteString = "}" })), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "functions", "}", "{"), + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("functions", "}", "{"), 1, 0, 1)); } @@ -50,7 +49,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = "}" }) ) ), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "helper", "}", "{"), + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("helper", "}", "{"), 1, 0, 1)); } @@ -65,7 +64,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.Any), new MarkupBlock()), new RazorError( - String.Format(RazorResources.ParseError_Expected_X, "}"), + RazorResources.ParseError_Expected_X("}"), 17, 0, 17)); } @@ -80,7 +79,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AsStatement() .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = "}" }) ), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, RazorResources.BlockName_Code, "}", "{"), + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(RazorResources.BlockName_Code, "}", "{"), 1, 0, 1)); } @@ -100,7 +99,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp { AutoCompleteString = "}" })), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "functions", "}", "{"), + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("functions", "}", "{"), 1, 0, 1)); } @@ -129,7 +128,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .With(new StatementCodeGenerator()) ) ), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "helper", "}", "{"), + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("helper", "}", "{"), 1, 0, 1)); } @@ -145,7 +144,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.Any), new MarkupBlock( Factory.Markup("\r\n

Foo

"))), - new RazorError(String.Format(RazorResources.ParseError_Expected_X, "}"), + new RazorError(RazorResources.ParseError_Expected_X("}"), 29, 1, 10)); } @@ -168,7 +167,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Span(SpanKind.Code, new CSharpSymbol(Factory.LocationTracker.CurrentLocation, String.Empty, CSharpSymbolType.Unknown)) .With(new StatementCodeGenerator()) ), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, RazorResources.BlockName_Code, "}", "{"), + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(RazorResources.BlockName_Code, "}", "{"), 1, 0, 1)); } } diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs index 5dcc16a68f..9eacb07206 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -45,8 +44,8 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp ), Factory.Code(" }").AsStatement()), new RazorError( - String.Format(RazorResources.ParseError_Unexpected_Keyword_After_At, - "if"), + RazorResources.ParseError_Unexpected_Keyword_After_At( + "if"), new SourceLocation(13, 0, 13))); } @@ -108,7 +107,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp ImplicitExpressionTest("Html.En(code()", "Html.En(code()", AcceptedCharacters.Any, new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(8, 0, 8))); } @@ -390,7 +389,7 @@ while(true);", BlockType.Statement, SpanKind.Code, acceptedCharacters: AcceptedC { const string document = "foreach(var f in Foo) { // foo bar baz"; SingleSpanBlockTest(document, document, BlockType.Statement, SpanKind.Code, - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "foreach", '}', '{'), SourceLocation.Zero)); + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("foreach", '}', '{'), SourceLocation.Zero)); } [Fact] @@ -399,7 +398,7 @@ while(true);", BlockType.Statement, SpanKind.Code, acceptedCharacters: AcceptedC const string document = "foreach(var f in Foo) { /* foo bar baz"; SingleSpanBlockTest(document, document, BlockType.Statement, SpanKind.Code, new RazorError(String.Format(RazorResources.ParseError_BlockComment_Not_Terminated), 24, 0, 24), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "foreach", '}', '{'), SourceLocation.Zero)); + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("foreach", '}', '{'), SourceLocation.Zero)); } [Fact] @@ -407,7 +406,7 @@ while(true);", BlockType.Statement, SpanKind.Code, acceptedCharacters: AcceptedC { const string document = "foreach(var f in Foo) { / foo bar baz"; SingleSpanBlockTest(document, document, BlockType.Statement, SpanKind.Code, - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "foreach", '}', '{'), SourceLocation.Zero)); + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("foreach", '}', '{'), SourceLocation.Zero)); } [Fact] diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs index bd33a35daa..6956c7fdbd 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.TestCommon; @@ -23,7 +22,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.NonWhiteSpace) ), new RazorError( - String.Format(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS, '"'), + RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS('"'), 1, 0, 1)); } @@ -48,7 +47,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .With(new AutoCompleteEditHandler(CSharpLanguageCharacteristics.Instance.TokenizeString) { AutoCompleteString = "}" }) ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( RazorResources.BlockName_Code, "}", "{"), SourceLocation.Zero)); @@ -114,7 +113,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp ), new RazorError(RazorResources.ParseError_Unexpected_EndOfFile_At_Start_Of_CodeBlock, 8, 1, 5), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, RazorResources.BlockName_Code, "}", "{"), + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(RazorResources.BlockName_Code, "}", "{"), SourceLocation.Zero)); } @@ -128,7 +127,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) .Accepts(AcceptedCharacters.NonWhiteSpace)), new RazorError( - String.Format(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS, "!"), + RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS("!"), 1, 0, 1)); } @@ -142,7 +141,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("foo bar\r\nbaz").AsExpression() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( RazorResources.BlockName_ExplicitExpression, ')', '('), new SourceLocation(0, 0, 0))); } @@ -159,7 +158,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("foo bar\r\n").AsExpression() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( RazorResources.BlockName_ExplicitExpression, ')', '('), new SourceLocation(0, 0, 0))); } @@ -174,7 +173,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) ), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(4, 0, 4))); } @@ -190,7 +189,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("Foo(Bar(Baz)\r\nBiz\r\nBoz") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) ), - new RazorError(String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + new RazorError(RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(3, 0, 3))); } @@ -208,7 +207,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("Foo(Bar(Baz)\r\nBiz\r\n") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) ), - new RazorError(String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + new RazorError(RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(3, 0, 3))); } @@ -225,7 +224,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) ), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "[", "]"), new SourceLocation(3, 0, 3))); } @@ -244,7 +243,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) ), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "[", "]"), new SourceLocation(3, 0, 3))); } @@ -259,7 +258,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code(" var foo = bar; if(foo != null) { bar(); } ").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( RazorResources.BlockName_Code, '}', '{'), SourceLocation.Zero)); } @@ -273,7 +272,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code(" var foo = bar; if(foo != null) { bar(); } ").AsFunctionsBody() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "functions", '}', '{'), SourceLocation.Zero)); } @@ -292,7 +291,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("if(foo) { baz(); } else { var foo = bar; if(foo != null) { bar(); } ").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "else", '}', '{'), new SourceLocation(19, 0, 19))); } @@ -305,7 +304,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("if(foo) { baz(); } else if { var foo = bar; if(foo != null) { bar(); } ").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "else if", '}', '{'), new SourceLocation(19, 0, 19))); } @@ -318,7 +317,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("do { var foo = bar; if(foo != null) { bar(); } ").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "do", '}', '{'), SourceLocation.Zero)); } @@ -331,7 +330,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("try { var foo = bar; if(foo != null) { bar(); } ").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "try", '}', '{'), SourceLocation.Zero)); } @@ -344,7 +343,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("try { baz(); } catch(Foo) { var foo = bar; if(foo != null) { bar(); } ").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "catch", '}', '{'), new SourceLocation(15, 0, 15))); } @@ -357,7 +356,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("try { baz(); } finally { var foo = bar; if(foo != null) { bar(); } ").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "finally", '}', '{'), new SourceLocation(15, 0, 15))); } @@ -401,7 +400,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp [Fact] public void ParseBlockRequiresControlFlowStatementsToHaveBraces() { - string expectedMessage = String.Format(RazorResources.ParseError_SingleLine_ControlFlowStatements_Not_Allowed, "{", "<"); + string expectedMessage = RazorResources.ParseError_SingleLine_ControlFlowStatements_Not_Allowed("{", "<"); ParseBlockTest("if(foo)

Bar

else if(bar)

Baz

else

Boz

", new StatementBlock( Factory.Code("if(foo) ").AsStatement(), @@ -431,7 +430,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("if(foo)) { var bar = foo; }").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_SingleLine_ControlFlowStatements_Not_Allowed, + RazorResources.ParseError_SingleLine_ControlFlowStatements_Not_Allowed( "{", ")"), new SourceLocation(7, 0, 7))); } @@ -463,7 +462,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("if(foo bar\r\n").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(2, 0, 2))); } @@ -477,7 +476,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("foreach(foo bar\r\n").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(7, 0, 7))); } @@ -491,7 +490,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("do { } while(foo bar\r\n").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(12, 0, 12))); } @@ -505,7 +504,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("using(foo bar\r\n").AsStatement() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(5, 0, 5))); } @@ -523,7 +522,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("}").AsStatement().Accepts(AcceptedCharacters.None) ), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), new SourceLocation(2, 0, 2))); } @@ -544,7 +543,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp { SingleSpanBlockTest("if(foo) { var foo = \"blah blah blah blah blah", BlockType.Statement, SpanKind.Code, new RazorError(RazorResources.ParseError_Unterminated_String_Literal, 20, 0, 20), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "if", '}', '{'), SourceLocation.Zero)); + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("if", '}', '{'), SourceLocation.Zero)); } [Fact] @@ -557,7 +556,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp + "blah", BlockType.Statement, SpanKind.Code, new RazorError(RazorResources.ParseError_Unterminated_String_Literal, 20, 0, 20), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "if", '}', '{'), SourceLocation.Zero)); + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("if", '}', '{'), SourceLocation.Zero)); } [Fact] @@ -609,7 +608,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("}").Accepts(AcceptedCharacters.None)), expectedErrors: new[] { new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, "(", ")"), + RazorResources.ParseError_Expected_CloseBracket_Before_EOF( "(", ")"), 14, 0, 14) }); @@ -618,7 +617,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp private void RunUnterminatedSimpleKeywordBlock(string keyword) { SingleSpanBlockTest(keyword + " (foo) { var foo = bar; if(foo != null) { bar(); } ", BlockType.Statement, SpanKind.Code, - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, keyword, '}', '{'), SourceLocation.Zero)); + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(keyword, '}', '{'), SourceLocation.Zero)); } } } diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpExplicitExpressionTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpExplicitExpressionTest.cs index d4806c6f81..7e4b53a6ac 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpExplicitExpressionTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpExplicitExpressionTest.cs @@ -2,7 +2,6 @@ using System; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.TestCommon; @@ -33,7 +32,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.EmptyCSharp().AsExpression() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( RazorResources.BlockName_ExplicitExpression, ")", "("), new SourceLocation(1, 0, 1))); diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpHelperTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpHelperTest.cs index 0e1e2fcc4b..f9c229bd6c 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpHelperTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpHelperTest.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.TestCommon; @@ -53,8 +52,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("}").Accepts(AcceptedCharacters.None)), Factory.EmptyHtml()), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start, + RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start( RazorResources.ErrorComponent_Newline), 7, 0, 7)); } @@ -70,9 +68,8 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("helper")), Factory.Markup("{")), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start, - String.Format(RazorResources.ErrorComponent_Character, "{")), + RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start( + RazorResources.ErrorComponent_Character("{")), 7, 0, 7)); } @@ -91,13 +88,11 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AsStatement() .AutoCompleteWith("}")))), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start, - String.Format(RazorResources.ErrorComponent_Character, "(")), + RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start( + RazorResources.ErrorComponent_Character("(")), 8, 0, 8), new RazorError( - String.Format( - RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "helper", "}", "{"), 1, 0, 1)); } @@ -113,8 +108,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("helper ").Accepts(AcceptedCharacters.None), Factory.EmptyCSharp().Hidden())), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start, + RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start( RazorResources.ErrorComponent_EndOfFile), 8, 0, 8)); } @@ -129,8 +123,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.CodeTransition(), Factory.MetaCode("helper").Accepts(AcceptedCharacters.Any))), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start, + RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start( RazorResources.ErrorComponent_EndOfFile), 7, 0, 7)); } @@ -148,8 +141,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code(" \r\n").Hidden()), Factory.Markup(@" ")), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start, + RazorResources.ParseError_Unexpected_Character_At_Helper_Name_Start( RazorResources.ErrorComponent_Newline), 30, 0, 30)); } @@ -167,7 +159,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("Foo \r\n").Hidden()), Factory.Markup(" ")), new RazorError( - String.Format(RazorResources.ParseError_MissingCharAfterHelperName, "("), + RazorResources.ParseError_MissingCharAfterHelperName("("), 15, 0, 15)); } @@ -199,7 +191,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("helper ").Accepts(AcceptedCharacters.None), Factory.Code("Foo(string foo) \r\n").Hidden())), new RazorError( - String.Format(RazorResources.ParseError_MissingCharAfterHelperParameters, "{"), + RazorResources.ParseError_MissingCharAfterHelperParameters("{"), 29, 1, 0)); } @@ -222,8 +214,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Markup("

Foo

").Accepts(AcceptedCharacters.None)), Factory.EmptyCSharp().AsStatement()))), new RazorError( - String.Format( - RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "helper", "}", "{"), 1, 0, 1)); } @@ -305,8 +296,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp expectedErrors: new[] { new RazorError( - String.Format( - RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF( "helper", "}", "{"), new SourceLocation(1, 0, 1)) }); diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpImplicitExpressionTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpImplicitExpressionTest.cs index 9e5d5de86a..f57d40ca00 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpImplicitExpressionTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpImplicitExpressionTest.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.TestCommon; @@ -49,7 +48,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AsImplicitExpression(KeywordSet) .Accepts(AcceptedCharacters.NonWhiteSpace)), new RazorError( - String.Format(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS, "/"), + RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS("/"), new SourceLocation(1, 0, 1))); } @@ -163,7 +162,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp { ImplicitExpressionTest("foo(()", "foo(()", acceptedCharacters: AcceptedCharacters.Any, - errors: new RazorError(String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, "(", ")"), new SourceLocation(4, 0, 4))); + errors: new RazorError(RazorResources.ParseError_Expected_CloseBracket_Before_EOF("(", ")"), new SourceLocation(4, 0, 4))); } [Fact] diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs index c3f4aefc23..574afd3ebc 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Tokenizer.Symbols; using Microsoft.TestCommon; @@ -82,7 +81,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code("\r\n") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords))), new RazorError( - String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, "(", ")"), + RazorResources.ParseError_Expected_CloseBracket_Before_EOF("(", ")"), 4, 0, 4)); } @@ -107,7 +106,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp CSharpSymbolType.Unknown)) .Accepts(AcceptedCharacters.Any)))), new RazorError(RazorResources.ParseError_RazorComment_Not_Terminated, 5, 0, 5), - new RazorError(String.Format(RazorResources.ParseError_Expected_CloseBracket_Before_EOF, "(", ")"), 4, 0, 4)); + new RazorError(RazorResources.ParseError_Expected_CloseBracket_Before_EOF("(", ")"), 4, 0, 4)); } [Fact] @@ -143,8 +142,8 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.None)), Factory.Markup("\r\n}")))), new RazorError(RazorResources.ParseError_TextTagCannotContainAttributes, 8, 1, 4), - new RazorError(String.Format(RazorResources.ParseError_MissingEndTag, "text"), 8, 1, 4), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, RazorResources.BlockName_Code, "}", "{"), 1, 0, 1)); + new RazorError(RazorResources.ParseError_MissingEndTag("text"), 8, 1, 4), + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(RazorResources.BlockName_Code, "}", "{"), 1, 0, 1)); } [Fact] @@ -168,7 +167,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp CSharpSymbolType.Unknown)) .Accepts(AcceptedCharacters.Any)))), new RazorError(RazorResources.ParseError_RazorComment_Not_Terminated, 2, 0, 2), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, RazorResources.BlockName_Code, "}", "{"), 1, 0, 1)); + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(RazorResources.BlockName_Code, "}", "{"), 1, 0, 1)); } } } diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpReservedWordsTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpReservedWordsTest.cs index a459a65430..668faba61b 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpReservedWordsTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpReservedWordsTest.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.TestCommon; @@ -21,7 +20,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp new DirectiveBlock( Factory.MetaCode(word).Accepts(AcceptedCharacters.None) ), - new RazorError(String.Format(RazorResources.ParseError_ReservedWord, word), SourceLocation.Zero)); + new RazorError(RazorResources.ParseError_ReservedWord(word), SourceLocation.Zero)); } [Theory] diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSectionTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSectionTest.cs index 5e35a565b3..125228b4a8 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSectionTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSectionTest.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.TestCommon; @@ -22,8 +21,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.CodeTransition(), Factory.MetaCode("section\r\n"))), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Section_Name_Start, + RazorResources.ParseError_Unexpected_Character_At_Section_Name_Start( RazorResources.ErrorComponent_EndOfFile), 10, 1, 0)); } @@ -54,8 +52,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("section \r\n")), Factory.Markup(" ")), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Section_Name_Start, + RazorResources.ParseError_Unexpected_Character_At_Section_Name_Start( RazorResources.ErrorComponent_EndOfFile), 23, 1, 4)); } @@ -85,9 +82,8 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("section ")), Factory.Markup("9 {

Foo

}")), new RazorError( - String.Format( - RazorResources.ParseError_Unexpected_Character_At_Section_Name_Start, - String.Format(RazorResources.ErrorComponent_Character, "9")), + RazorResources.ParseError_Unexpected_Character_At_Section_Name_Start( + RazorResources.ErrorComponent_Character("9")), 9, 0, 9)); } @@ -127,8 +123,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("}").Accepts(AcceptedCharacters.None)), Factory.EmptyHtml()), new RazorError( - String.Format( - RazorResources.ParseError_Sections_Cannot_Be_Nested, + RazorResources.ParseError_Sections_Cannot_Be_Nested( RazorResources.SectionExample_CS), 23, 0, 23)); } @@ -145,7 +140,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AutoCompleteWith("}", atEndOfSpan: true), new MarkupBlock())), new RazorError( - String.Format(RazorResources.ParseError_Expected_X, "}"), + RazorResources.ParseError_Expected_X("}"), 14, 0, 14)); } @@ -163,7 +158,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp // Need to provide the markup span as fragments, since the parser will split the {} into separate symbols. Factory.Markup("

Foo", "{", "}", "

")))), new RazorError( - String.Format(RazorResources.ParseError_Expected_X, "}"), + RazorResources.ParseError_Expected_X("}"), 27, 0, 27)); } diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs index ef749a554f..8dfc3e945c 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.TestCommon; @@ -151,7 +150,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Code(" { { { { } zoop").AsFunctionsBody() ), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "functions", "}", "{"), + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("functions", "}", "{"), SourceLocation.Zero)); } @@ -175,7 +174,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) .Accepts(AcceptedCharacters.NonWhiteSpace)), new RazorError( - String.Format(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS, "/"), + RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS("/"), 1, 0, 1)); } diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpTemplateTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpTemplateTest.cs index e8e6289122..0949cccbef 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpTemplateTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpTemplateTest.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpToMarkupSwitchTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpToMarkupSwitchTest.cs index ff1022118e..4c541d681d 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpToMarkupSwitchTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpToMarkupSwitchTest.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Tokenizer.Symbols; using Microsoft.TestCommon; diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpVerbatimBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpVerbatimBlockTest.cs index 749e420b29..89c9d13ec9 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpVerbatimBlockTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpVerbatimBlockTest.cs @@ -2,7 +2,6 @@ using System; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.TestCommon; @@ -44,7 +43,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp designTimeParser: true, expectedErrors: new[] { - new RazorError(String.Format(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS, "}"), new SourceLocation(2, 0, 2)) + new RazorError(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS("}"), new SourceLocation(2, 0, 2)) }); } @@ -64,7 +63,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp designTimeParser: true, expectedErrors: new[] { - new RazorError(String.Format(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS, "."), new SourceLocation(2, 0, 2)) + new RazorError(RazorResources.ParseError_Unexpected_Character_At_Start_Of_CodeBlock_CS("."), new SourceLocation(2, 0, 2)) }); } diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CsHtmlDocumentTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CsHtmlDocumentTest.cs index 99542f0dce..d359952558 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CsHtmlDocumentTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CsHtmlDocumentTest.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlBlockTest.cs index 6ec65ea8fb..b3ee752781 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlBlockTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlBlockTest.cs @@ -5,7 +5,6 @@ using Microsoft.AspNet.Razor.Editor; using Microsoft.AspNet.Razor.Generator; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; @@ -39,7 +38,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( Factory.Markup("<")))), new RazorError( - String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, RazorResources.BlockName_Code, "}", "{"), + RazorResources.ParseError_Expected_EndOfBlock_Before_EOF(RazorResources.BlockName_Code, "}", "{"), 1, 0, 1)); } @@ -67,8 +66,8 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html designTimeParser: true, expectedErrors: new[] { - new RazorError(String.Format(RazorResources.ParseError_UnexpectedEndTag, "html"), 7, 2, 0), - new RazorError(String.Format(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF, "code", "}", "{"), 1, 0, 1) + new RazorError(RazorResources.ParseError_UnexpectedEndTag("html"), 7, 2, 0), + new RazorError(RazorResources.ParseError_Expected_EndOfBlock_Before_EOF("code", "}", "{"), 1, 0, 1) }); } @@ -80,7 +79,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( Factory.Markup("< \r\n ")), designTimeParser: true, - expectedErrors: new RazorError(String.Format(RazorResources.ParseError_UnfinishedTag, String.Empty), 0, 0, 0)); + expectedErrors: new RazorError(RazorResources.ParseError_UnfinishedTag(String.Empty), 0, 0, 0)); } [Fact] @@ -217,7 +216,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html public void ParseBlockTerminatesAtEOF() { SingleSpanBlockTest("", "", BlockType.Markup, SpanKind.Markup, - new RazorError(String.Format(RazorResources.ParseError_MissingEndTag, "foo"), new SourceLocation(0, 0, 0))); + new RazorError(RazorResources.ParseError_MissingEndTag("foo"), new SourceLocation(0, 0, 0))); } [Fact] @@ -265,7 +264,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html BlockType.Markup, SpanKind.Markup, AcceptedCharacters.None, - new RazorError(String.Format(RazorResources.ParseError_MissingEndTag, "foo"), 0, 0, 0)); + new RazorError(RazorResources.ParseError_MissingEndTag("foo"), 0, 0, 0)); } @@ -360,7 +359,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( Factory.Markup("
bar baz", new MarkupBlock( Factory.Markup("
").Accepts(AcceptedCharacters.None)), - new RazorError(String.Format(RazorResources.ParseError_UnexpectedEndTag, "foo"), SourceLocation.Zero)); + new RazorError(RazorResources.ParseError_UnexpectedEndTag("foo"), SourceLocation.Zero)); } [Fact] @@ -63,7 +62,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html ParseBlockTest("

", new MarkupBlock( Factory.Markup("

").Accepts(AcceptedCharacters.None)), - new RazorError(String.Format(RazorResources.ParseError_MissingEndTag, "p"), new SourceLocation(0, 0, 0))); + new RazorError(RazorResources.ParseError_MissingEndTag("p"), new SourceLocation(0, 0, 0))); } [Fact] @@ -72,7 +71,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html ParseBlockTest("blah blah blah blah blah", new MarkupBlock( Factory.Markup("blah blah blah blah blah")), - new RazorError(String.Format(RazorResources.ParseError_MissingEndTag, "foo"), new SourceLocation(0, 0, 0))); + new RazorError(RazorResources.ParseError_MissingEndTag("foo"), new SourceLocation(0, 0, 0))); } [Fact] @@ -84,7 +83,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock(new AttributeBlockCodeGenerator("bar", new LocationTagged(" bar=", 4, 0, 4), new LocationTagged(String.Empty, 12, 0, 12)), Factory.Markup(" bar=").With(SpanCodeGenerator.Null), Factory.Markup("baz").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 9, 0, 9), new LocationTagged("baz", 9, 0, 9))))), - new RazorError(String.Format(RazorResources.ParseError_UnfinishedTag, "foo"), new SourceLocation(0, 0, 0))); + new RazorError(RazorResources.ParseError_UnfinishedTag("foo"), new SourceLocation(0, 0, 0))); } } } diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlTagsTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlTagsTest.cs index 7e64116b8b..3cdb9126dd 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlTagsTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlTagsTest.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.TestCommon; @@ -40,7 +39,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html ParseBlockTest("

Bar", new MarkupBlock( Factory.Markup("

").Accepts(AcceptedCharacters.None)), - new RazorError(String.Format(RazorResources.ParseError_MissingEndTag, "p"), 0, 0, 0)); + new RazorError(RazorResources.ParseError_MissingEndTag("p"), 0, 0, 0)); } [Fact] diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/ParserContextTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/ParserContextTest.cs index ef024268a2..db1f01745d 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/ParserContextTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/ParserContextTest.cs @@ -4,7 +4,6 @@ using System; using System.IO; using Microsoft.AspNet.Razor.Parser; using Microsoft.AspNet.Razor.Parser.SyntaxTree; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Test.Framework; using Microsoft.AspNet.Razor.Text; using Microsoft.AspNet.Razor.Tokenizer.Symbols; diff --git a/test/Microsoft.AspNet.Razor.Test/Text/LookaheadTextReaderTestBase.cs b/test/Microsoft.AspNet.Razor.Test/Text/LookaheadTextReaderTestBase.cs index 8fcea28ebb..608a06f6a3 100644 --- a/test/Microsoft.AspNet.Razor.Test/Text/LookaheadTextReaderTestBase.cs +++ b/test/Microsoft.AspNet.Razor.Test/Text/LookaheadTextReaderTestBase.cs @@ -2,7 +2,6 @@ using System; using System.Text; -using Microsoft.AspNet.Razor.Resources; using Microsoft.AspNet.Razor.Text; using Microsoft.TestCommon;