コード例 #1
0
ファイル: UpdateTree.cs プロジェクト: zhonli/odata.net
 public ResourceInstanceNavRefProperty(string propertyName, ResourceBodyTree updateTreeNode)
     : base(propertyName)
 {
     _updateTreeNode = updateTreeNode;
 }
コード例 #2
0
 /// <summary>Checks whether the specified <paramref name="node"/> contains any syntax errors.</summary>
 /// <param name="node">Update node to check.</param>
 /// <returns>
 /// true if there are any errors in the <paramref name="node"/> tree;
 /// false otherwise.
 /// </returns>
 public static bool ContainsSyntaxError(ResourceBodyTree node)
 {
     return(InternalContainsSyntaxError(node));
 }
コード例 #3
0
        public void VisitResourceNavigationRefProperty(ResourceInstanceNavProperty navProperty, ResourceBodyTree treeNode, XmlElement parentNode)
        {
            string     type          = "";
            string     hrefKey       = null;
            XmlElement inlineElement = null;

            if (treeNode is AssociationResourceInstance)
            {
                AssociationResourceInstance instance = treeNode as AssociationResourceInstance;
                hrefKey = CreateCanonicalUri(instance.ResourceInstanceKey).Replace(Workspace.ServiceUri + @"\", "");
            }
            else
            {
                inlineElement = CreateDataWebMetadataElement("inline");
                if (navProperty is ResourceInstanceNavColProperty)
                {
                    XmlElement feedNode = CreateAtomElement("feed");
                    this.Visit(navProperty, treeNode, feedNode);
                    inlineElement.AppendChild(feedNode);
                    type = "feed";
                }
                else
                {
                    this.Visit(navProperty, treeNode, inlineElement);
                    type = "entry";
                }
            }
            XmlElement   linkElement   = CreateAtomLinkElement(navProperty, parentNode, hrefKey);
            XmlAttribute typeAttribute = CreateAtomAttribute("type");

            typeAttribute.Value = "application/atom+xml;type=" + type;
            linkElement.Attributes.Append(typeAttribute);
            if (inlineElement != null)
            {
                linkElement.AppendChild(inlineElement);
            }
            parentNode.AppendChild(linkElement);
        }