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


C# Trees.XmlTree类代码示例

本文整理汇总了C#中umbraco.cms.presentation.Trees.XmlTree的典型用法代码示例。如果您正苦于以下问题:C# XmlTree类的具体用法?C# XmlTree怎么用?C# XmlTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XmlTree类属于umbraco.cms.presentation.Trees命名空间,在下文中一共展示了XmlTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Render

        public override void Render(ref XmlTree tree)
        {
            List<DocumentType> docTypes;
            if (base.m_id == -1)
                docTypes = DocumentType.GetAllAsList().FindAll(delegate(DocumentType dt) { return dt.MasterContentType == 0; });
            else
                docTypes = DocumentType.GetAllAsList().FindAll(delegate(DocumentType dt) { return dt.MasterContentType == base.m_id; });

            foreach (DocumentType dt in docTypes)
            {
                XmlTreeNode xNode = XmlTreeNode.Create(this);
                xNode.NodeID = dt.Id.ToString();
                xNode.Text = dt.Text;
                xNode.Action = "javascript:openNodeType(" + dt.Id + ");";
                xNode.Icon = "settingDataType.gif";
                xNode.OpenIcon = "settingDataType.gif";
				xNode.Source = GetTreeServiceUrl(dt.Id);
				xNode.HasChildren = dt.HasChildren;
                if (dt.HasChildren) {                    
                    xNode.Icon = "settingMasterDataType.gif";
                    xNode.OpenIcon = "settingMasterDataType.gif";
                }

                OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
                if (xNode != null)
                {
                    tree.Add(xNode);
                    OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
                }
                
            }
        }
开发者ID:elrute,项目名称:Triphulcas,代码行数:32,代码来源:loadNodeTypes.cs

示例2: Render

        public override void Render(ref XmlTree tree)
        {
            var mediaTypes = Service.GetMediaTypeChildren(base.m_id);

            foreach (var mediaType in mediaTypes)
            {
                var hasChildren = Service.MediaTypeHasChildren(mediaType.Id);

                XmlTreeNode xNode = XmlTreeNode.Create(this);
                xNode.NodeID = mediaType.Id.ToString(CultureInfo.InvariantCulture);
                xNode.Text = mediaType.Name;
                xNode.Action = string.Format("javascript:openMediaType({0});", mediaType.Id);
                xNode.Icon = "settingDataType.gif";
                xNode.OpenIcon = "settingDataType.gif";
                xNode.Source = GetTreeServiceUrl(mediaType.Id);
                xNode.HasChildren = hasChildren;
                if (hasChildren)
                {
                    xNode.Icon = "settingMasterDataType.gif";
                    xNode.OpenIcon = "settingMasterDataType.gif";
                }

                OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
                if (xNode != null)
                {
                    tree.Add(xNode);
                    OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
                }
                
            }
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:31,代码来源:loadMediaTypes.cs

示例3: BaseTree_BeforeNodeRender

 private void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
 {
     if (node.Menu == null || node.NodeType.ToLower() != "content") return;
     node.Menu.Insert(3, new TranslationCreationAction());
     node.Menu.Insert(3, ContextMenuSeperator.Instance);
     node.Menu.Insert(5, ContextMenuSeperator.Instance);
 }
开发者ID:purna,项目名称:Polyglot,代码行数:7,代码来源:MenuCustomisation.cs

示例4: Render

        public override void Render(ref XmlTree tree)
        {
            Hashtable ht = Cache.ReturnCacheItemsOrdred();

            foreach (string key in ht.Keys)
            {
                //each child will need to load a CacheItem instead of a Cache tree so
                //we'll create a loadCacheItem object in order to get it's serivce url and alias properties
                loadCacheItem loadCacheItemTree = new loadCacheItem(this.app);
				int itemCount = ((ArrayList)ht[key]).Count;
                XmlTreeNode xNode = XmlTreeNode.Create(loadCacheItemTree);
                xNode.NodeID = key;
				xNode.Text = key + " (" + itemCount + ")";
				xNode.Action = string.Empty;
                xNode.Source = loadCacheItemTree.GetTreeServiceUrl(key);
                xNode.Icon = "developerCacheTypes.gif";
                xNode.OpenIcon = "developerCacheTypes.gif";
				xNode.HasChildren = itemCount > 0;

                OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
                if (xNode != null)
                {
                    tree.Add(xNode);
                    OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
                }
                
            }
        }
开发者ID:elrute,项目名称:Triphulcas,代码行数:28,代码来源:loadCache.cs

示例5: Render

        /// <summary>
        /// Renders the specified tree item.
        /// </summary>        
        /// <param name="Tree">The tree.</param>
        public override void Render(ref XmlTree Tree)
        {
            //get documents to render
            Document[] docs = Document.GetChildrenForTree(m_id);

            var args = new TreeEventArgs(Tree);
            OnBeforeTreeRender(docs, args);

            foreach (Document dd in docs)
            {
                List<IAction> allowedUserOptions = GetUserActionsForNode(dd);
                if (CanUserAccessNode(dd, allowedUserOptions))
                {

                    XmlTreeNode node = CreateNode(dd, allowedUserOptions);

                    OnRenderNode(ref node, dd);

                    OnBeforeNodeRender(ref Tree, ref node, EventArgs.Empty);
                    if (node != null)
                    {
                        Tree.Add(node);
                        OnAfterNodeRender(ref Tree, ref node, EventArgs.Empty);
                    }
                }
            }
            //args = new TreeEventArgs(Tree);
            OnAfterTreeRender(docs, args);
        }
开发者ID:jracabado,项目名称:justEdit-,代码行数:33,代码来源:BaseContentTree.cs

示例6: FileSystemTree_AfterNodeRender

 void FileSystemTree_AfterNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
 {
     if (node.TreeType == "scripts" && new Core().GetPossibleExtensions(Enums.TranslatorType.Script).Contains(Path.GetExtension(node.NodeID)))
     {
         sender.Remove(node);
     }
 }
开发者ID:Jeavon,项目名称:BundlingAndMinificationForTheMasses,代码行数:7,代码来源:StartUpHandlers.cs

示例7: Render

 /// <summary>
 /// Override the render method to add the recycle bin to the end of this tree
 /// </summary>
 /// <param name="Tree"></param>
 public override void Render(ref XmlTree tree)
 {
     base.Render(ref tree);
     XmlTreeNode recycleBin = CreateRecycleBin();
     if (recycleBin != null)
         tree.Add(recycleBin);
 }
开发者ID:jracabado,项目名称:justEdit-,代码行数:11,代码来源:loadContent.cs

示例8: BaseTree_BeforeNodeRender

        private void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
        {
            if (node.TreeType.ToLower() == "content")
            {
                try
                {
                    Document document = new Document(Convert.ToInt32(node.NodeID));

                    //this changes the create action b/c of the UI.xml entry
                    if (CreateDocTypes.Contains(document.ContentType.Alias))
                    {
                        node.NodeType = "uNews";
                    }

                    if (RemoveCreateDocTypes.Contains(document.ContentType.Alias))
                    {
                        node.Menu.Remove(ActionNew.Instance);
                    }
                }

                catch (Exception e2)
                {

                }
            }
        }
开发者ID:kgiszewski,项目名称:uNews,代码行数:26,代码来源:uNewsEvents.cs

示例9: Render

        public override void Render(ref XmlTree tree)
        {
            // Create tree node to allow sending a newsletter

            var sendNewsletter = XmlTreeNode.Create(this);

            sendNewsletter.Text = "Send Newsletter";

            sendNewsletter.Icon = "docPic.gif";

            sendNewsletter.Action = "javascript:openSendNewsletter()";

            // Add the node to the tree

            tree.Add(sendNewsletter);


            // Create tree node to allow viewing previously sent newsletters
            var previousNewsletters = XmlTreeNode.Create(this);

            previousNewsletters.Text = "Previous Newsletters";

            previousNewsletters.Icon = "docPic.gif";

            previousNewsletters.Action = "javascript:openPreviousNewsletters()";

            // Add the node to the tree
            tree.Add(previousNewsletters);

        }
开发者ID:Narnoo,项目名称:Narnoo-ASP.NET-SDK,代码行数:30,代码来源:ApplicationTree.cs

示例10: Render

        public override void Render(ref XmlTree tree)
        {
            foreach(string role in Roles.GetAllRoles()) {
//            MemberGroup[] MemberGroups = MemberGroup.GetAll;
            
//            for (int i = 0; i < MemberGroups.Length; i++)
//            {
                XmlTreeNode xNode = XmlTreeNode.Create(this);
                xNode.NodeID = role;
                xNode.Text = role;
                xNode.Action = "javascript:openMemberGroup('" + HttpContext.Current.Server.UrlEncode(role.Replace("'", "\\'")) + "');";
                xNode.Icon = "icon-users";
                if (!Member.IsUsingUmbracoRoles())
                {
                    xNode.Menu = null;
                }

                OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
                if (xNode != null)
                {
                    tree.Add(xNode);
                }
                OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
            }
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:25,代码来源:loadMemberGroups.cs

示例11: Render

        public override void Render(ref XmlTree tree)
        {
            var docTypes = Service.GetContentTypeChildren(base.m_id);

            foreach (var docType in docTypes)
            {
                var hasChildren = Service.HasChildren(docType.Id);

                XmlTreeNode xNode = XmlTreeNode.Create(this);
                xNode.NodeID = docType.Id.ToString(CultureInfo.InvariantCulture);
                xNode.Text = TranslateTreeNames.GetTranslatedName(docType.Name);
                xNode.Action = "javascript:openNodeType(" + docType.Id + ");";
                xNode.Icon = "icon-item-arrangement";
                xNode.OpenIcon = "icon-item-arrangement";
                xNode.Source = GetTreeServiceUrl(docType.Id);
                xNode.HasChildren = hasChildren;
                if (hasChildren)
                {
                    xNode.Icon = "icon-item-arrangement";
                    xNode.OpenIcon = "icon-item-arrangement";
                }

                OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
                if (xNode != null)
                {
                    tree.Add(xNode);
                    OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
                }
            }
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:30,代码来源:loadNodeTypes.cs

示例12: Render

        public override void Render(ref XmlTree tree)
        {
            XmlTreeNode xNode;

            xNode = XmlTreeNode.Create(this);
            xNode.Text = "Log";
            xNode.Icon = "doc.gif";
            xNode.NodeType = "uTool";
            xNode.Action = "javascript:openuToolTab('/umbraco/plugins/uTools/log.aspx')";
            tree.Add(xNode);

            xNode = XmlTreeNode.Create(this);
            xNode.Text = "Data Types";
            xNode.Icon = "developerDatatype.gif";
            xNode.NodeType = "uTool";
            xNode.Action = "javascript:openuTool('datatype.aspx')";
            tree.Add(xNode);

            xNode = XmlTreeNode.Create(this);
            xNode.Text = "Document Types";
            xNode.Icon = "settingDatatype.gif";
            xNode.NodeType = "uTool";
            xNode.Action = "javascript:openuTool('doctype.aspx')";
            tree.Add(xNode);

            //xNode = XmlTreeNode.Create(this);
            //xNode.Text = "Content";
            //xNode.Icon = "docPic.gif";
            //xNode.NodeType = "uTool";
            //xNode.Action = "javascript:openuTool('content.aspx')";
            //tree.Add(xNode);

            xNode = XmlTreeNode.Create(this);
            xNode.Text = "Templates";
            xNode.Icon = "settingTemplate.gif";
            xNode.NodeType = "uTool";
            xNode.Action = "javascript:openuTool('template.aspx')";
            tree.Add(xNode);

            xNode = XmlTreeNode.Create(this);
            xNode.Text = "Macros";
            xNode.Icon = "developerMacro.gif";
            xNode.NodeType = "uTool";
            xNode.Action = "javascript:openuTool('macro.aspx')";
            tree.Add(xNode);

            xNode = XmlTreeNode.Create(this);
            xNode.Text = "Content Cache Viewer";
            xNode.Icon = "settingXML.gif";
            xNode.NodeType = "uTool";
            xNode.Action = "javascript:openuTool('cache.aspx')";
            tree.Add(xNode);

            xNode = XmlTreeNode.Create(this);
            xNode.Text = "Media Cache Viewer";
            xNode.Icon = "mediaPhoto.gif";
            xNode.NodeType = "uTool";
            xNode.Action = "javascript:openuTool('mediacache.aspx')";
            tree.Add(xNode);
        }
开发者ID:kgiszewski,项目名称:uTools,代码行数:60,代码来源:uToolsTree.cs

示例13: Render

        public override void Render(ref XmlTree tree)
        {
            foreach (Task t in Task.GetTasks(currentUser(), false)) {

                if (t.Type.Alias == "toTranslate") {
                    XmlTreeNode xNode = XmlTreeNode.Create(this);
                    xNode.Menu.Clear();

                    xNode.NodeID = t.Id.ToString();
                    xNode.Text = t.Node.Text;
                    xNode.Action = "javascript:openTranslationTask(" + t.Id.ToString() + ")";
                    xNode.Icon = ".sprTreeSettingLanguage";
                    xNode.OpenIcon = ".sprTreeSettingLanguage";

                    OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
                    if (xNode != null)
                    {
                        tree.Add(xNode);
                        OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
                    }

                }

            }
        }
开发者ID:jracabado,项目名称:justEdit-,代码行数:25,代码来源:loadTranslationTasks.cs

示例14: Populate

        public override void Populate(ref XmlTree tree, int keyId)
        {
            var reader =
                            Application.SqlHelper.ExecuteReader(
                                @"
                            SELECT Res.RaceResultId, D.Name
                            FROM Result Res INNER JOIN DriverContract DC ON Res.DriverContractId = DC.DriverContractId
                            INNER JOIN Driver D ON DC.DriverId = D.DriverId
                            WHERE Res.ResultType=1 AND Res.RaceId = @raceId
                            ORDER BY [Time]",
                                Application.SqlHelper.CreateParameter("@raceId", keyId));

            while (reader.Read())
            {

                var qNode = XmlTreeNode.Create(_baseTree);
                qNode.NodeID = reader.GetInt("RaceResultId").ToString();
                qNode.Text = reader.GetString("Name");
                qNode.Icon = "medal_silver_3.png";
                qNode.NodeType = "qualiResults";
                qNode.Action = "javascript:openQualificationResult(" + reader.GetInt("RaceResultId") + ")";
                qNode.Menu.Clear();
                qNode.Menu.Add(ActionDelete.Instance);

                tree.Add(qNode);

            }
        }
开发者ID:robgray,项目名称:f1speedguides,代码行数:28,代码来源:loadResultsQualifyingResults.cs

示例15: Render

        public override void Render(ref XmlTree tree)
        {
            
            Dictionary.DictionaryItem[] tmp;
            if (this.id == this.StartNodeID)
                tmp = Dictionary.getTopMostItems;
            else
                tmp = new Dictionary.DictionaryItem(this.id).Children;

            foreach (Dictionary.DictionaryItem di in tmp)
            {
                XmlTreeNode xNode = XmlTreeNode.Create(this);
                xNode.NodeID = di.id.ToString(); //dictionary_ + id.. 
                xNode.Text = di.key;
                xNode.Action = string.Format("javascript:openDictionaryItem({0});", di.id);
                xNode.Icon = "settingDataType.gif";
                xNode.OpenIcon = "settingDataType.gif";
                xNode.NodeType = "DictionaryItem"; //this shouldn't be like this, it should be this.TreeAlias but the ui.config file points to this name.
                xNode.Source = this.GetTreeServiceUrl(di.id);
				xNode.HasChildren = di.hasChildren;

                OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
                if (xNode != null)
                {
                    tree.Add(xNode);
                    OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
                }
                
            }
        }
开发者ID:saciervo,项目名称:Umbraco-CMS,代码行数:30,代码来源:loadDictionary.cs


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