AspectSharp.Builder.XmlEngineBuilder.Build C# (CSharp) Метод

Build() публичный Метод

public Build ( ) : AspectEngine
Результат AspectEngine
		public override AspectEngine Build()
		{
			if (!_node.Name.Equals("configuration"))
			{
				throw new BuilderException("Invalid root node. Expecting 'configuration'");
			}

			XmlNode contentNode = _node;

			if (contentNode.FirstChild.NodeType == XmlNodeType.Whitespace ||
				contentNode.FirstChild.NodeType == XmlNodeType.Text)
			{
				base.Reader = new StringReader(contentNode.InnerText);
				return base.Build();
			}
			else if (contentNode.FirstChild.NodeType == XmlNodeType.CDATA)
			{
				// CData node containing language configuration
				// Parse it 

				base.Reader = new StringReader(contentNode.FirstChild.Value);
				return base.Build();
			}

			Configuration = new EngineConfiguration();

			LoadImports();
			LoadGlobals();
			LoadAspects();

			ExecuteSteps();

			return new AspectEngine(Configuration);
		}

Usage Example

		public void XmlWithMoreComplexMethodSignature()
		{
			String xmlContents = "<configuration>" + 
				"<import namespace=\"AspectSharp.Tests.Classes\" assembly=\"AspectSharp.Tests\" />" + 
				"<mixins>" + 
				"<mixin key=\"key\" type=\"DummyMixin\" refTypeEnum=\"Type\" />" +
				"</mixins><interceptors>" +
				"<interceptor key=\"key\" type=\"DummyInterceptor\" refTypeEnum=\"Type\" />" +
				"</interceptors>" +
				"<aspect name=\"McBrother\"><for>" +
				"<singletype type=\"DummyCustomer\" refTypeEnum=\"Type\" />" +
				"</for>" +
				"<mixin type=\"key\" refTypeEnum=\"Link\" />" +
				"<pointcut symbol=\"Method\"><signature>(void Name(*))</signature>" +
				"<interceptor type=\"key\" refTypeEnum=\"Link\" />" +
				"</pointcut>" +
				"</aspect>" +
				"</configuration>";
			XmlEngineBuilder builder = new XmlEngineBuilder(xmlContents);
			AspectEngine engine = builder.Build();

			Assert.IsNotNull(engine);
			Assert.IsNotNull(engine.Configuration);

			AspectDefinition aspect = engine.Configuration.Aspects[0];
			Assert.AreEqual(1, aspect.Mixins.Count);

			PointCutDefinition pointcut = aspect.PointCuts[0];
			Assert.IsTrue( pointcut.Method.AllArguments );
			Assert.AreEqual( "void", pointcut.Method.RetType );
			Assert.AreEqual("Name", pointcut.Method.MethodName );

			Assert.AreEqual(1, pointcut.Advices.Count);
			InterceptorDefinition advice = pointcut.Advices[0];
			Assert.AreEqual( typeof(DummyInterceptor), advice.TypeReference.ResolvedType );
		}
All Usage Examples Of AspectSharp.Builder.XmlEngineBuilder::Build