public ControlRegisterDirective (DirectiveNode node) : base (node) { TagName = (string) node.Attributes ["TagName"]; Src = (string) node.Attributes ["Src"]; }
public override void Visit (DirectiveNode node) { var atts = node.Attributes; switch (node.Name.ToLowerInvariant ()) { case "page": SetSubtype (WebSubtype.WebForm, node); if (atts == null) return; info.MasterPageFile = atts ["masterpagefile"] as string; break; case "control": SetSubtype (WebSubtype.WebControl, node); break; case "webservice": SetSubtype (WebSubtype.WebService, node); break; case "webhandler": SetSubtype (WebSubtype.WebHandler, node); break; case "application": SetSubtype (WebSubtype.Global, node); break; case "master": SetSubtype (WebSubtype.MasterPage, node); break; case "mastertype": if (info.MasterPageTypeVPath != null || info.MasterPageTypeName != null) { Add (ErrorType.Error, node, "Unexpected second mastertype directive", node.Name); return; } if (atts == null) return; info.MasterPageTypeName = atts["typename"] as string; info.MasterPageTypeVPath = atts["virtualpath"] as string; if (string.IsNullOrEmpty (info.MasterPageTypeName) == string.IsNullOrEmpty (info.MasterPageTypeVPath)) Add (ErrorType.Error, node, "Mastertype directive must have non-empty 'typename' or 'virtualpath' attribute"); break; case "register": if (atts == null) return; if (atts ["TagPrefix"] != null) { if ((atts ["TagName"] != null) && (atts ["Src"] != null)) info.registeredTags.Add (new ControlRegisterDirective (node)); else if ((atts ["Namespace"] != null) && (atts ["Assembly"] != null)) info.registeredTags.Add (new AssemblyRegisterDirective (node)); } break; case "assembly": if (atts == null) return; var assembly = new AssemblyDirective (atts ["name"] as string, atts ["src"] as string); if (assembly.IsValid ()) info.assemblies.Add (assembly); else Add (ErrorType.Error, node, "Assembly directive must have non-empty 'name' or 'src' attribute"); break; case "import": if (atts == null) return; var ns = atts ["namespace"] as string; if (!string.IsNullOrEmpty (ns)) info.imports.Add (ns); else Add (ErrorType.Error, node, "Import directive must have non-empty 'namespace' attribute"); break; case "implements": if (atts == null) return; var interf = atts ["interface"] as string; if (!string.IsNullOrEmpty (interf)) info.implements.Add (interf); else Add (ErrorType.Error, node, "Implements directive must have non-empty 'interface' attribute"); break; default: break; } }
public RegisterDirective (DirectiveNode node) { TagPrefix = (string) node.Attributes ["TagPrefix"]; }
public AssemblyRegisterDirective (DirectiveNode node) : base (node) { Namespace = (string) node.Attributes ["Namespace"]; Assembly = (string) node.Attributes ["Assembly"]; }
void SetSubtype (WebSubtype type, DirectiveNode node) { if (info.Subtype != WebSubtype.None) { Add (ErrorType.Error, node, "Unexpected directive {0}", node.Name); return; } info.Subtype = type; if (node.Attributes == null) return; info.InheritedClass = node.Attributes ["inherits"] as string; if (info.ClassName == null) info.ClassName = node.Attributes ["classname"] as string; info.CodeBehindFile = node.Attributes ["codebehind"] as string; info.Language = node.Attributes ["language"] as string; info.CodeFile = node.Attributes ["codefile"] as string; }
public override void Visit (DirectiveNode node) { switch (node.Name.ToLowerInvariant ()) { case "page": case "control": case "master": case "register": Node = node; return; } }
public virtual void Visit(DirectiveNode node) { }
public virtual void Visit (DirectiveNode node) { }
public override void Visit (DirectiveNode node) { debugString.Append ('\t', indent); debugString.Append (node.ToString ()); debugString.AppendLine (); }