private void ProcessDirective(string directiveName, IDictionary<string, string> attribs, int lineNumber)
{
if (String.IsNullOrEmpty(directiveName))
{
return;
}
switch (directiveName.ToLowerInvariant())
{
case "page":
case "control":
{
this.JbstName = attribs.ContainsKey("name") ?
EcmaScriptIdentifier.EnsureValidIdentifier(attribs["name"], true) :
null;
if (attribs.ContainsKey("AutoMarkup"))
{
try
{
this.AutoMarkup = (AutoMarkupType)Enum.Parse(typeof(AutoMarkupType), attribs["AutoMarkup"], true);
}
catch
{
throw new ArgumentException("\""+attribs["AutoMarkup"]+"\" is an invalid value for AutoMarkup.");
}
}
else
{
this.AutoMarkup = AutoMarkupType.None;
}
string package = attribs.ContainsKey("import") ? attribs["import"] : null;
if (!String.IsNullOrEmpty(package))
{
string[] packages = package.Split(ImportDelim, StringSplitOptions.RemoveEmptyEntries);
this.Imports.AddRange(packages);
}
break;
}
case "import":
{
string package = attribs.ContainsKey("namespace") ? attribs["namespace"] : null;
if (!String.IsNullOrEmpty(package))
{
this.Imports.Add(package);
}
break;
}
default:
{
// not implemented
break;
}
}
}