private string MatchEvaluatorTags(Match m) { Type tagType = null; object tagObject = null; switch (m.Groups[RegExConstants.RE_CS_TAGS_TAGNAME].Value) { case "Assembly": tagType = typeof(TagAssembly); tagObject = new TagAssembly(); break; case "CodeTemplate": tagType = typeof(TagCodeTemplate); tagObject = new TagCodeTemplate(); break; case "Import": tagType = typeof(TagImport); tagObject = new TagImport(); break; case "Property": tagType = typeof(TagProperty); tagObject = new TagProperty(); break; case "Register": tagType = typeof(TagRegister); tagObject = new TagRegister(); break; default: tagType = null; tagObject = null; break; } // Only parse if it's a known tag if (tagType != null) { if (m.Groups[RegExConstants.RE_CS_TAGS_KEY].Captures.Count > 0) { for (int i = 0; i < m.Groups[RegExConstants.RE_CS_TAGS_KEY].Captures.Count; i++) { SetProperty(tagType, tagObject, m.Groups[RegExConstants.RE_CS_TAGS_KEY].Captures[i].Value, m.Groups[RegExConstants.RE_CS_TAGS_VALUE].Captures[i].Value); } } // Add the templateobject to the list TemplateObjectList.Add(new TemplateObject(tagType, tagObject)); } return(string.Empty); }
/// <summary> /// Initializes a new instance of the <see cref="T:NondeterministicFiniteAutomaton`3"/> class by copying the states from the given <paramref name="origin"/>. /// </summary> /// <param name="origin">The given <see cref="T:NondeterministicFiniteAutomaton`3"/> from which the data is copied, must be effective.</param> /// <remarks> /// <para>The <see cref="T:IState`2"/> instances in the given <paramref name="origin"/> are not cloned: they are the same and modifications /// to the states in the original automaton can have effects in the new automaton and vice-versa.</para> /// </remarks> /// <exception cref="ArgumentNullException">The given automaton must be effective.</exception> protected NondeterministicFiniteAutomaton(NondeterministicFiniteAutomaton <TStateTag, TEdgeTag, TCollection> origin) { if (origin == null) { throw new ArgumentNullException("origin", "Origin must be effective"); } Contract.EndContractBlock(); this.stateDictionary = ((ICloneable <TagRegister <TStateTag, IState <TStateTag, TEdgeTag>, TCollection> >)origin.stateDictionary).Clone(); this.acceptingStateDictionary = ((ICloneable <TagRegister <TStateTag, IState <TStateTag, TEdgeTag>, TCollection> >)origin.acceptingStateDictionary).Clone(); this.initialState = origin.initialState; }
static HtmlGenerator() { TagRegister.Register("nav"); TagRegister.Register("em"); TagRegister.Register("section"); }