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


C# TreeNode.GetDocumentName方法代码示例

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


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

示例1: btnClone_Click

    /// <summary>
    /// Clone button event handler
    /// </summary>
    protected void btnClone_Click(object sender, EventArgs e)
    {
        if ((pageTemplateInfo != null) && hasModifyPermission)
        {
            node = Node;

            // Clone the info
            string docName = node.GetDocumentName();
            string displayName = "Ad-hoc: " + docName;

            PageTemplateInfo newInfo = PageTemplateInfoProvider.CloneTemplateAsAdHoc(pageTemplateInfo, displayName, SiteContext.CurrentSiteID, node.NodeGUID);

            newInfo.Description = String.Format(GetString("PageTemplate.AdHocDescription"), Node.DocumentNamePath);
            PageTemplateInfoProvider.SetPageTemplateInfo(newInfo);

            CheckOutTemplate(newInfo);

            // Assign the selected template for all cultures and save
            SelectedTemplateID = newInfo.PageTemplateId;

            if (radInherit.Checked)
            {
                radAllCultures.Checked = true;
                radInherit.Checked = false;
            }

            DocumentManager.SaveDocument();
        }
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:32,代码来源:Template.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptHelper.RegisterScriptFile(Page, "cmsedit.js");

        // Initialize events
        ctlAsync.OnFinished += ctlAsync_OnFinished;
        ctlAsync.OnError += ctlAsync_OnError;
        ctlAsync.OnRequestLog += ctlAsync_OnRequestLog;
        ctlAsync.OnCancel += ctlAsync_OnCancel;

        // Get the data
        nodeId = QueryHelper.GetInteger("nodeid", 0);
        targetNodeId = QueryHelper.GetInteger("targetnodeid", 0);
        action = QueryHelper.GetString("action", "");

        if (!Page.IsCallback)
        {
            // Register the main CMS script
            ScriptHelper.RegisterCMS(Page);

            // Get the node
            node = TreeProvider.SelectSingleNode(nodeId);
            targetNode = TreeProvider.SelectSingleNode(targetNodeId, TreeProvider.ALL_CULTURES);

            // Set visibility of panels
            pnlContent.Visible = true;
            pnlLog.Visible = false;

            if ((node != null) && (targetNode != null))
            {
                string targetName = targetNode.GetDocumentName();
                bool isRoot = targetNode.NodeClassName.EqualsCSafe("cms.root", true);

                // Get the real target node
                if (!isRoot && (action.IndexOfCSafe("position", true) >= 0))
                {
                    // Get the target order and real parent ID
                    int newTargetId = targetNode.NodeParentID;
                    TreeNode realTargetNode = TreeProvider.SelectSingleNode(newTargetId);
                    if (realTargetNode != null)
                    {
                        targetName = realTargetNode.GetDocumentName();
                    }
                }

                // Initialize resource strings, images
                btnCancel.OnClientClick = ctlAsync.GetCancelScript(true) + "return false;";
                btnNo.OnClientClick = "SelectNode(" + node.NodeID + "); return false;";

                lblTarget.Text = GetString("ContentOperation.TargetDocument") + " <strong>" + HTMLHelper.HTMLEncode(targetName) + "</strong>";

                switch (action.ToLowerCSafe())
                {
                    case "movenode":
                    case "movenodeposition":
                    case "movenodefirst":
                        // Setup page title text and image
                        titleElemAsync.TitleText = GetString("ContentRequest.StartMove");
                        titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_Content/Dialogs/titlemove.png");

                        canceledString = "ContentRequest.MoveCanceled";
                        lblQuestion.Text = GetString("ContentMove.Question");
                        chkCopyPerm.Text = GetString("contentrequest.preservepermissions");
                        break;

                    case "copynode":
                    case "copynodeposition":
                    case "copynodefirst":
                        // Setup page title text and image
                        titleElemAsync.TitleText = GetString("ContentRequest.StartCopy");
                        titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_Content/Dialogs/titlecopy.png");

                        canceledString = "ContentRequest.CopyingCanceled";
                        childNodes = chkChild.Checked;
                        plcCopyCheck.Visible = (node.NodeChildNodesCount > 0);
                        chkChild.ResourceString = "contentrequest.copyunderlying";

                        lblQuestion.Text = GetString("ContentCopy.Question");
                        chkCopyPerm.Text = GetString("contentrequest.copypermissions");
                        break;

                    case "linknode":
                    case "linknodeposition":
                    case "linknodefirst":
                        // Setup page title text and image
                        titleElemAsync.TitleText = GetString("ContentRequest.StartLink");
                        titleElemAsync.TitleImage = GetImageUrl("CMSModules/CMS_Content/Dialogs/titlelink.png");

                        canceledString = "ContentRequest.LinkCanceled";
                        childNodes = chkChild.Checked;
                        plcCopyCheck.Visible = (node.NodeChildNodesCount > 0);
                        chkChild.ResourceString = "contentrequest.linkunderlying";

                        lblQuestion.Text = GetString("ContentLink.Question");
                        chkCopyPerm.Text = GetString("contentrequest.copypermissions");
                        break;

                    default:
                        ShowError(GetString("error.notsupported"));
                        pnlAction.Visible = false;
//.........这里部分代码省略.........
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:101,代码来源:DragOperation.ascx.cs


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