System.Web.UI.SimpleWebHandlerParser.AddDefaultDirective C# (CSharp) Method

AddDefaultDirective() private method

private AddDefaultDirective ( ILocation location, TagAttributes attrs ) : void
location ILocation
attrs System.Web.Compilation.TagAttributes
return void
		internal virtual void AddDefaultDirective (ILocation location, TagAttributes attrs)
		{
#if NET_2_0
			CompilationSection compConfig;
#else
			CompilationConfiguration compConfig;
#endif
			compConfig = CompilationConfig;
			
			if (gotDefault)
				throw new ParseException (location, "duplicate " + DefaultDirectiveName + " directive");

			gotDefault = true;
			IDictionary attributes = attrs.GetDictionary (null);
			className = GetAndRemove (attributes, "class");
			if (className == null)
				throw new ParseException (null, "No Class attribute found.");
			
			string d = GetAndRemove (attributes, "debug");
			if (d != null) {
				debug = (String.Compare (d, "true", true, Helpers.InvariantCulture) == 0);
				if (debug == false && String.Compare (d, "false", true, Helpers.InvariantCulture) != 0)
					throw new ParseException (null, "Invalid value for Debug attribute");
			} else
				debug = compConfig.Debug;

			language = GetAndRemove (attributes, "language");
			if (language == null)
				language = compConfig.DefaultLanguage;

			GetAndRemove (attributes, "codebehind");
			if (attributes.Count > 0)
				throw new ParseException (location, "Unrecognized attribute in " +
							  DefaultDirectiveName + " directive");
		}