protected override void ParseElement(XElement element)
 {
     var objectParser = new ObjectParser(State);
     objectParser.Parse(element);
     var addExpression =
         new CodeMethodInvokeExpression(
             new CodePropertyReferenceExpression(new CodeVariableReferenceExpression(Parent.VariableName), Name),
             "Add", new CodeVariableReferenceExpression(objectParser.VariableName));
     State.AddStatement(new CodeExpressionStatement(addExpression));
 }
        protected override void ParseElement(XElement element)
        {
            var objectParser = new ObjectParser(State);

            objectParser.Parse(element);
            var addExpression =
                new CodeMethodInvokeExpression(
                    new CodePropertyReferenceExpression(new CodeVariableReferenceExpression(Parent.VariableName), Name),
                    "Add", new CodeVariableReferenceExpression(objectParser.VariableName));

            State.AddStatement(new CodeExpressionStatement(addExpression));
        }
        protected override void ParseElement(XElement element)
        {
            if (!m_firstElement)
                throw new InvalidOperationException();

            var objectParser = new ObjectParser(State);
            objectParser.Parse(element);

            var left = new CodePropertyReferenceExpression(
                new CodeVariableReferenceExpression(Parent.VariableName), Name);
            var right = new CodeVariableReferenceExpression(objectParser.VariableName);
            var assignment = new CodeAssignStatement(left, right);
            State.AddStatement(assignment);
        }
        protected override void ParseElement(XElement element)
        {
            if (!m_firstElement)
            {
                throw new InvalidOperationException();
            }

            var objectParser = new ObjectParser(State);

            objectParser.Parse(element);

            var left = new CodePropertyReferenceExpression(
                new CodeVariableReferenceExpression(Parent.VariableName), Name);
            var right      = new CodeVariableReferenceExpression(objectParser.VariableName);
            var assignment = new CodeAssignStatement(left, right);

            State.AddStatement(assignment);
        }
 public PropertyObjectParser(XamlConvertor.State state, ObjectParser parent)
     : base(state, parent)
 {
 }
Пример #6
0
 public PropertyParser(XamlConvertor.State state, ObjectParser parent)
     : base(state)
 {
     Parent = parent;
 }
 public PropertyObjectParser(XamlConvertor.State state, ObjectParser parent)
     : base(state, parent)
 {
 }
Пример #8
0
 public PropertyParser(XamlConvertor.State state, ObjectParser parent)
     : base(state)
 {
     Parent = parent;
 }