src/Misc/EFTools/EntityDesignModel/Validation/EscherAttributeContentValidator.cs
/// <summary>
///     This method will make an AttributePath for a given an EFObject.
/// </summary>
This method will make an AttributePath for a given an EFObject.
This method will make an AttributePath for a given an EFObject .
private static AttributePath MakeAttributePathFromEFObject(EFObject efobject)
        {
            var attributePath = new AttributePath();
            var curr = efobject.XObject;
            while (curr != null)
            {
                if (curr.NodeType == XmlNodeType.Document)
                {
                    var doc = (XDocument)curr;
                    attributePath.PushFront(doc.Root.Name.LocalName, doc.Root.Name.Namespace.NamespaceName, true);
                }
                else if (curr.NodeType == XmlNodeType.Attribute)
                {
                    var attr = (XAttribute)curr;
                    attributePath.PushFront(attr.Name.LocalName, attr.Name.Namespace.NamespaceName, false);
                }
                else if (curr.NodeType == XmlNodeType.Element)
                {
                    var el = (XElement)curr;
                    attributePath.PushFront(el.Name.LocalName, el.Name.Namespace.NamespaceName, true);
                }
                else
                {
                    Debug.Fail("Unexpected XObject type is neither an attribute nor an element");
                    return null;
                }
                curr = curr.Parent;
            }
            return attributePath;
        }
private static AttributePath MakeAttributePathFromEFObject ( EFObject efobject ) { var attributePath = new AttributePath ( ) ; var curr = efobject . XObject ; while ( curr != null ) { if ( curr . NodeType == XmlNodeType . Document ) { var doc = ( XDocument ) curr ; attributePath . PushFront ( doc . Root . Name . LocalName , doc . Root . Name . Namespace . NamespaceName , true ) ; } else if ( curr . NodeType == XmlNodeType . Attribute ) { var attr = ( XAttribute ) curr ; attributePath . PushFront ( attr . Name . LocalName , attr . Name . Namespace . NamespaceName , false ) ; } else if ( curr . NodeType == XmlNodeType . Element ) { var el = ( XElement ) curr ; attributePath . PushFront ( el . Name . LocalName , el . Name . Namespace . NamespaceName , true ) ; } else { Debug . Fail ( " " ) ; return null ; } curr = curr . Parent ; } return attributePath ; }
This method will make an AttributePath for a given an EFObject.
This method will make an AttributePath for a given an EFObject .
efobject
EFObject