public void Modify(IAttribute originalAttribute, IAttribute newAttribute)
        {
            IConditionalExpressionNodeWrapper expression            = newAttribute.AddConditionalExpressionNode();
            ConditionalExpression             conditionalExpression = GetConditionalResourceExpression(originalAttribute);

            expression.SetExpressionBody(conditionalExpression);
        }
        public void Modify(IAttribute originalAttribute, IAttribute newAttribute)
        {
            ICodeExpressionNode codeExpressionNode = newAttribute.AddCodeExpressionNode();

            codeExpressionNode.SetExpressionBody(new CodeExpression("true"));
            IConditionalExpressionNodeWrapper conditionalExpressionNodeWrapper = newAttribute.AddConditionalExpressionNode();

            conditionalExpressionNodeWrapper.SetExpressionBody(new ConditionalExpression(_syntaxProvider.CreateNullCheckAndEvalExpression(originalAttribute.GetTextValue()), originalAttribute.GetTextValue()));
        }
 public void Do(IElement element)
 {
     if (element.HasAttribute("for"))
     {
         IAttribute attribute = element.GetAttribute("for");
         IConditionalExpressionNodeWrapper codeExpressionNode = element.AddConditionalExpressionNode();
         string conditional = _syntaxProvider.CreateNullCheckExpression(attribute.GetTextValue().Split('.').First());
         codeExpressionNode.SetExpressionBody(new ConditionalExpression(conditional, attribute.GetTextValue()));
         element.ClearInnerText();
     }
 }
        public void Do(IElement element)
        {
            string resourceValue = element.GetAttribute("for").GetTextValue();
            IEnumerable <IElement> childElements = element.GetChildElements("option");

            childElements.ForEach(x =>
            {
                if (x.HasAttribute("selected"))
                {
                    x.RemoveAttribute(x.GetAttribute("selected"));
                }
                IConditionalExpressionNodeWrapper wrapper = x.AddAttribute("selected").AddConditionalExpressionNode();
                wrapper.SetExpressionBody(new ConditionalExpression(_syntaxProvider.CreateNullCheckAndEvalExpression(resourceValue), resourceValue));
            });
        }