Пример #1
0
        protected override void VisitAttributeFragment(HxlAttribute fragment)
        {
            HxlExpressionAttribute werk = fragment as HxlExpressionAttribute;

            if (werk == null)
            {
                string variable = CodeUtility.EmitInstantiation(this.manager, this.output, fragment);
                EmitRenderingThunk(this.output, variable, fragment);
                DoAppend(variable);
            }
            else
            {
                string varName = SafeNewVariable(werk.GetType().Name, true);
                // TODO Possibly better to use other name in this attribute render closure

                werk.GetInitCode(varName, this, output);
                DoAppend(varName);
            }
        }
Пример #2
0
 public void ImplicitName_should_remove_affixes()
 {
     Assert.Equal("my", HxlAttribute.GetImplicitName(typeof(MyAttributeFragment)));
 }