public override void OnInterceptorEntryDefinition(InterceptorEntryDefinition interceptor) { Push(Document.CreateNode(XmlNodeType.Element, "interceptor", null)); XmlAttribute att = Document.CreateAttribute("key"); att.Value = interceptor.Key; Current.Attributes.Append(att); SerializeTypeReference(interceptor.TypeReference); Pop(); }
private void LoadInterceptors() { XmlNodeList interceptors = _node.SelectNodes("interceptors/interceptor"); foreach (XmlNode node in interceptors) { String key = GetRequiredAttribute(node, "key"); InterceptorEntryDefinition inter = new InterceptorEntryDefinition(key, LexicalInfo.Empty); inter.TypeReference = CreateTypeReference(node); Configuration.Interceptors.Add(inter); } }
public void ParsingInterceptorDeclaration() { AspectParser parser = CreateParser( "interceptors \r\n" + "[" + "\"customer\" : Interceptor" + "]"); EngineConfiguration conf = parser.Parse(); Assert.IsNotNull(conf); Assert.IsNotNull(conf.Interceptors); Assert.AreEqual(1, conf.Interceptors.Count); InterceptorEntryDefinition def = conf.Interceptors[0]; Assert.IsNotNull(def); Assert.AreEqual("customer", def.Key); Assert.AreEqual(TargetTypeEnum.Type, def.TypeReference.TargetType); Assert.AreEqual("Interceptor", def.TypeReference.TypeName); }
public void ParsingInterceptorDeclarations() { AspectParser parser = CreateParser( "interceptors \r\n" + "[" + " \"key1\" : Namespace.Interceptor1 in MyAssembly;" + " \"key2\" : Namespace.Interceptor2 in MyAssembly;" + " \"key3\" : Namespace.Interceptor3 in MyAssembly" + "]"); EngineConfiguration conf = parser.Parse(); Assert.IsNotNull(conf); Assert.IsNotNull(conf.Interceptors); Assert.AreEqual(3, conf.Interceptors.Count); InterceptorEntryDefinition def = conf.Interceptors[0]; Assert.IsNotNull(def); Assert.AreEqual("key1", def.Key); Assert.AreEqual(TargetTypeEnum.Type, def.TypeReference.TargetType); Assert.AreEqual("Namespace.Interceptor1", def.TypeReference.TypeName); Assert.AreEqual("MyAssembly", def.TypeReference.AssemblyReference.AssemblyName); def = conf.Interceptors[1]; Assert.IsNotNull(def); Assert.AreEqual("key2", def.Key); Assert.AreEqual(TargetTypeEnum.Type, def.TypeReference.TargetType); Assert.AreEqual("Namespace.Interceptor2", def.TypeReference.TypeName); Assert.AreEqual("MyAssembly", def.TypeReference.AssemblyReference.AssemblyName); def = conf.Interceptors[2]; Assert.IsNotNull(def); Assert.AreEqual("key3", def.Key); Assert.AreEqual(TargetTypeEnum.Type, def.TypeReference.TargetType); Assert.AreEqual("Namespace.Interceptor3", def.TypeReference.TypeName); Assert.AreEqual("MyAssembly", def.TypeReference.AssemblyReference.AssemblyName); }
public override void OnInterceptorEntryDefinition(InterceptorEntryDefinition interceptor) { Push( Document.CreateNode(XmlNodeType.Element, "interceptor", null) ); XmlAttribute att = Document.CreateAttribute("key"); att.Value = interceptor.Key; Current.Attributes.Append( att ); SerializeTypeReference(interceptor.TypeReference); Pop(); }
public override void OnInterceptorEntryDefinition(InterceptorEntryDefinition interceptor) { AssertIsInterceptor(interceptor.LexicalInfo, interceptor.TypeReference.ResolvedType, INVALID_INTERCEPTOR); }
public override void OnInterceptorEntryDefinition(InterceptorEntryDefinition interceptor) { base.OnInterceptorEntryDefinition(interceptor); _interceptorKey2TypeReference[interceptor.Key] = interceptor.TypeReference; }
public virtual void OnInterceptorEntryDefinition(InterceptorEntryDefinition interceptor) { OnTypeReferenceDefinition(interceptor.TypeReference); }