src/Misc/EFTools/XmlCore/Model/EFElement.cs
/// <summary>
///     This will set the attribute's value or add the attribute if it doesn't exist
/// </summary>
/// <param name="attributeName"></param>
/// <param name="attributeValue"></param>
This will set the attribute's value or add the attribute if it doesn't exist
This will set the attribute ' s value or add the attribute if it doesn ' t exist
internal void SetAttributeValue(XNamespace namespaceName, string attributeName, string attributeValue)
        {
            var attr = GetAttribute(attributeName);
            if (attr == null)
            {
                attr = new XAttribute(namespaceName + attributeName, attributeValue);
                XContainer.Add(attr);
            }
            else
            {
                if (attr.Value == attributeValue)
                {
                    return;
                }
                if (attributeValue == null)
                {
                    attr.Remove();
                }
                else
                {
                    attr.Value = attributeValue;
                }
            }
        }
internal void SetAttributeValue ( XNamespace namespaceName , string attributeName , string attributeValue ) { var attr = GetAttribute ( attributeName ) ; if ( attr == null ) { attr = new XAttribute ( namespaceName + attributeName , attributeValue ) ; XContainer . Add ( attr ) ; } else { if ( attr . Value == attributeValue ) { return ; } if ( attributeValue == null ) { attr . Remove ( ) ; } else { attr . Value = attributeValue ; } } }
This will set the attribute's value or add the attribute if it doesn't exist
This will set the attribute ' s value or add the attribute if it doesn ' t exist
namespaceName
XNamespace
attributeName
string
None
attributeValue
string
None