当前位置: 首页>>代码示例>>C#>>正文


C# CMSNode.IsDocument方法代码示例

本文整理汇总了C#中CMSNode.IsDocument方法的典型用法代码示例。如果您正苦于以下问题:C# CMSNode.IsDocument方法的具体用法?C# CMSNode.IsDocument怎么用?C# CMSNode.IsDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMSNode的用法示例。


在下文中一共展示了CMSNode.IsDocument方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

        public void Run(IWorkflowInstance workflowInstance, IWorkflowRuntime runtime)
        {
            // Cast to Umbraco worklow instance.
            var umbracoWorkflowInstance = (UmbracoWorkflowInstance) workflowInstance;

            var count = 0;
            var newCmsNodes = new List<int>();

            foreach(var nodeId in umbracoWorkflowInstance.CmsNodes)
            {
                var n = new CMSNode(nodeId);
                if(!n.IsDocument()) continue;

                var d = new Document(nodeId);
                if (!DocumentTypes.Contains(d.ContentType.Id)) continue;
                
                newCmsNodes.Add(nodeId);
                count++;
            }

            umbracoWorkflowInstance.CmsNodes = newCmsNodes;

            var transition = (count > 0) ? "contains_docs" : "does_not_contain_docs";
            runtime.Transition(workflowInstance, this, transition);
        }
开发者ID:OlivierAlbertini,项目名称:workflow-for-dot-net,代码行数:25,代码来源:FilterDocumentsWorkflowTask.cs

示例2: Run

        public void Run(IWorkflowInstance workflowInstance, IWorkflowRuntime runtime)
        {
            // Cast to Umbraco worklow instance.
            var umbracoWorkflowInstance = (UmbracoWorkflowInstance) workflowInstance;

            foreach(var nodeId in umbracoWorkflowInstance.CmsNodes)
            {
                var n = new CMSNode(nodeId);
                if(!n.IsDocument()) continue;

                var d = new Document(nodeId);
                d.Publish(User.GetUser(0));

                umbraco.library.UpdateDocumentCache(d.Id);
            }

            runtime.Transition(workflowInstance, this, "done");
        }
开发者ID:OlivierAlbertini,项目名称:workflow-for-dot-net,代码行数:18,代码来源:PublishDocumentsWorkflowTask.cs

示例3: GetAttachmentLinks

        public virtual string GetAttachmentLinks(IEnumerable<int> attachedNodes)
        {
            var s = new StringBuilder();
            s.Append("<br/><br/>");

            var host = HttpContext.Current.Request.Url.Host;
            if (HttpContext.Current.Request.Url.Port != 80) host += ":" + HttpContext.Current.Request.Url.Port;

            foreach(var nodeId in attachedNodes)
            {
                var node = new CMSNode(nodeId);

                if(node.IsDocument())
                {
                    s.Append(string.Format("{2} ({1}): <a href='http://{0}/umbraco/dialogs/preview.aspx?id={1}'>[" + GlobalisationService.Instance.GetString("preview") + "]</a> ", host, nodeId, node.Text) + Environment.NewLine);
                    s.Append(string.Format("<a href='http://{0}/umbraco/actions/editContent.aspx?id={1}'>[" + GlobalisationService.Instance.GetString("edit") + "]</a><br/>", host, nodeId) + Environment.NewLine);

                } else if(node.IsMedia())
                {
                    s.Append(string.Format("{2} ({1}): <a href='http://{0}/umbraco/dialogs/preview.aspx?id={1}'>{2}</a> ", host, nodeId, node.Text) + Environment.NewLine);
                    
                } else
                {
                    s.Append(node.Text + "<br/>" + Environment.NewLine);
                }
            }
            
            return s.ToString();
        }
开发者ID:OlivierAlbertini,项目名称:workflow-for-dot-net,代码行数:29,代码来源:BaseEmailWorkflowTask.cs


注:本文中的CMSNode.IsDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。