Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public PropertyCollectionParser(XamlConvertor.State state, ObjectParser parent)
     : base(state, parent)
 {
 }
 public PropertyParser(XamlConvertor.State state, ObjectParser parent)
     : base(state)
 {
     Parent = parent;
 }