示例#1
0
        public getNavigationPathsResponse GetNavigationPaths([System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:msdn-com:public-content-syndication")] getNavigationPathsRequest getNavigationPathsRequest)
        {
            object[] results = this.Invoke("GetNavigationPaths", new object[] {
                getNavigationPathsRequest
            });

            return((getNavigationPathsResponse)(results[0]));
        }
示例#2
0
 /// <remarks/>
 public void GetNavigationPathsAsync(getNavigationPathsRequest getNavigationPathsRequest, object userState)
 {
     if ((this.GetNavigationPathsOperationCompleted == null))
     {
         this.GetNavigationPathsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetNavigationPathsOperationCompleted);
     }
     this.InvokeAsync("GetNavigationPaths", new object[] {
         getNavigationPathsRequest
     }, this.GetNavigationPathsOperationCompleted, userState);
 }
示例#3
0
 /// <remarks/>
 public void GetNavigationPathsAsync(getNavigationPathsRequest getNavigationPathsRequest)
 {
     this.GetNavigationPathsAsync(getNavigationPathsRequest, null);
 }
示例#4
0
 /// <remarks/>
 public void GetNavigationPathsAsync(getNavigationPathsRequest getNavigationPathsRequest, object userState) {
     if ((this.GetNavigationPathsOperationCompleted == null)) {
         this.GetNavigationPathsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetNavigationPathsOperationCompleted);
     }
     this.InvokeAsync("GetNavigationPaths", new object[] {
                 getNavigationPathsRequest}, this.GetNavigationPathsOperationCompleted, userState);
 }
示例#5
0
 /// <remarks/>
 public void GetNavigationPathsAsync(getNavigationPathsRequest getNavigationPathsRequest) {
     this.GetNavigationPathsAsync(getNavigationPathsRequest, null);
 }
示例#6
0
        // Returns the navigation node that corresponds to this content. If
        // we give it a navigation node already, it'll return that node, so
        // no harm done.
        public string GetNavigationNode()
        {
            // Load the contentItem. If we get a Toc entry, then we know it is
            // a navigation node rather than a content node. The reason is that
            // getNavigationPaths only returns the root node if the target node is
            // a navigation node already. We could check to see if we get one path
            // consisting of one node, but the user could give a target node that is
            // the same as the root node. Perf isn't an issue because this should
            // only be called once with the rootNode.

            this.Load(false); // Don't load images in case we are a content node.

            if(toc != null)
                return contentId;

            navigationKey root = new navigationKey();
            root.contentId = rootContentItem.contentId;
            root.locale = locale;
            root.version = rootContentItem.version;

            navigationKey target = new navigationKey();
            //            target.contentId = "AssetId:" + assetId;
            target.contentId = contentId;
            target.locale = locale;
            target.version = collection + "." + version;

            ContentService proxy = new ContentService();
            getNavigationPathsRequest request = new getNavigationPathsRequest();
            request.root = root;
            request.target = target;

            getNavigationPathsResponse response = proxy.GetNavigationPaths(request);

            // We need to deal with the case where the content appears in many
            // places in the TOC. For now, just use the first path.
            if (response.navigationPaths.Length == 0)
                return null;

            // This is the last node in the first path.
               return response.navigationPaths[0].navigationPathNodes[
                response.navigationPaths[0].navigationPathNodes.Length - 1].navigationNodeKey.contentId;
        }