System.Web.UI.MasterPageParser.AddDirective C# (CSharp) Method

AddDirective() private method

private AddDirective ( string directive, IDictionary atts ) : void
directive string
atts IDictionary
return void
		internal override void AddDirective (string directive, IDictionary atts)
		{
			if (String.Compare ("MasterType", directive, StringComparison.OrdinalIgnoreCase) == 0) {
				PageParserFilter pfilter = PageParserFilter;
				if (pfilter != null)
					pfilter.PreprocessDirective (directive.ToLowerInvariant (), atts);
				
				string type = GetString (atts, "TypeName", null);
				if (type != null) {
					masterType = LoadType (type);
					if (masterType == null)
						ThrowParseException ("Could not load type '" + type + "'.");
				} else {
					string path = GetString (atts, "VirtualPath", null);
					if (!String.IsNullOrEmpty (path)) {
						if (!HostingEnvironment.VirtualPathProvider.FileExists (path))
							ThrowParseFileNotFound (path);
						
						masterTypeVirtualPath = path;
						AddDependency (path);
					} else
						ThrowParseException ("The MasterType directive must have either a TypeName or a VirtualPath attribute.");
				}
				if (masterType != null)
					AddAssembly (masterType.Assembly, true);
			}
			else
				base.AddDirective (directive, atts);
		}