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


C# TreeNode.GetValue方法代码示例

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


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

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        // Register script files
        ScriptHelper.RegisterScriptFile(this, @"~/CMSModules/Content/CMSDesk/ContentEditFrameset.js");

        bool checkCulture = false;
        bool splitViewSupported = false;
        nodeId = QueryHelper.GetInteger("nodeid", 0);
        string action = QueryHelper.GetString("action", "edit").ToLowerCSafe();

        switch (action)
        {
            // New dialog / new page form
            case "new":
                int classId = QueryHelper.GetInteger("classid", 0);
                if (classId <= 0)
                {
                    // Get by class name if specified
                    string className = QueryHelper.GetString("classname", string.Empty);
                    if (className != string.Empty)
                    {
                        classInfo = DataClassInfoProvider.GetDataClass(className);
                        if (classInfo != null)
                        {
                            classId = classInfo.ClassID;
                        }
                    }
                }

                nodeId = QueryHelper.GetInteger("parentnodeid", 0);

                if (classId > 0)
                {
                    viewpage = ResolveUrl("~/CMSModules/Content/CMSDesk/Edit/Edit.aspx");

                    // Check if document type is allowed under parent node
                    if (nodeId > 0)
                    {
                        // Get the node
                        TreeNode = Tree.SelectSingleNode(nodeId, TreeProvider.ALL_CULTURES);
                        if (TreeNode != null)
                        {
                            if (!DataClassInfoProvider.IsChildClassAllowed(ValidationHelper.GetInteger(TreeNode.GetValue("NodeClassID"), 0), classId))
                            {
                                viewpage = "~/CMSModules/Content/CMSDesk/NotAllowed.aspx?action=child";
                            }
                        }
                    }

                    // Use product page when product type is selected
                    classInfo = classInfo ?? DataClassInfoProvider.GetDataClass(classId);
                    if ((classInfo != null) && (classInfo.ClassIsProduct))
                    {
                        viewpage = ResolveUrl("~/CMSModules/Ecommerce/Pages/Tools/Products/Product_New.aspx");
                    }
                }
                else
                {
                    if (nodeId > 0)
                    {
                        viewpage = "~/CMSModules/Ecommerce/Pages/Tools/Products/New_ProductOrSection.aspx";
                    }
                    else
                    {
                        viewpage = "~/CMSModules/Ecommerce/Pages/Tools/Products/Product_New.aspx?parentNodeId=0";
                    }
                }
                break;

            case "delete":
                // Delete dialog
                viewpage = "~/CMSModules/Content/CMSDesk/Delete.aspx";
                break;

            default:
                // Edit mode
                viewpage = "~/CMSModules/Content/CMSDesk/Edit/edit.aspx?mode=editform";
                splitViewSupported = true;

                // Ensure class info
                if ((classInfo == null) && (Node != null))
                {
                    classInfo = DataClassInfoProvider.GetDataClass(Node.NodeClassName);
                }

                // Check explicit editing page url
                if ((classInfo != null) && !string.IsNullOrEmpty(classInfo.ClassEditingPageURL))
                {
                    viewpage = URLHelper.AppendQuery(ResolveUrl(classInfo.ClassEditingPageURL), URLHelper.Url.Query);
                }

                checkCulture = true;
                break;
        }

        // If culture version should be checked, check
        if (checkCulture)
        {
            // Check (and ensure) the proper content culture
            CheckPreferredCulture(true);
//.........这里部分代码省略.........
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:101,代码来源:Product_Section.aspx.cs

示例2: ProcessNode

    /// <summary>
    /// Processes the specified document node.
    /// </summary>
    /// <param name="treeNode">Document node to process</param>
    /// <param name="columnName">Column name</param>
    /// <param name="processedFileName">File name</param>
    protected void ProcessNode(TreeNode treeNode, string columnName, string processedFileName)
    {
        if (treeNode != null)
        {
            // Check if latest or live site version is required
            bool latest = !IsLiveSite;
            if (allowLatestVersion && ((treeNode.DocumentID == latestForDocumentId) || (treeNode.DocumentCheckedOutVersionHistoryID == latestForHistoryId)))
            {
                latest = true;
            }

            // If not published, return no content
            if (!latest && !treeNode.IsPublished)
            {
                outputFile = NewOutputFile(null, null);
                outputFile.AliasPath = treeNode.NodeAliasPath;
                outputFile.CultureCode = treeNode.DocumentCulture;
                if (IsLiveSite && AttachmentInfoProvider.CheckPublishedFiles(CurrentSiteName))
                {
                    outputFile.IsPublished = treeNode.IsPublished;
                }
                outputFile.FileNode = treeNode;
                outputFile.Height = Height;
                outputFile.Width = Width;
                outputFile.MaxSideSize = MaxSideSize;
            }
            else
            {
                // Get valid site name if link
                if (treeNode.IsLink)
                {
                    TreeNode origNode = TreeProvider.GetOriginalNode(treeNode);
                    if (origNode != null)
                    {
                        SiteInfo si = SiteInfoProvider.GetSiteInfo(origNode.NodeSiteID);
                        if (si != null)
                        {
                            CurrentSiteName = si.SiteName;
                        }
                    }
                }

                // Process the node
                // Get from specific column
                if (String.IsNullOrEmpty(columnName) && String.IsNullOrEmpty(processedFileName) && treeNode.NodeClassName.EqualsCSafe("CMS.File", true))
                {
                    columnName = "FileAttachment";
                }
                if (!String.IsNullOrEmpty(columnName))
                {
                    // File document type or specified by column
                    Guid attachmentGuid = ValidationHelper.GetGuid(treeNode.GetValue(columnName), Guid.Empty);
                    if (attachmentGuid != Guid.Empty)
                    {
                        ProcessFile(attachmentGuid);
                    }
                }
                else
                {
                    // Get by file name
                    if (processedFileName == null)
                    {
                        // CMS.File - Get
                        Guid attachmentGuid = ValidationHelper.GetGuid(treeNode.GetValue("FileAttachment"), Guid.Empty);
                        if (attachmentGuid != Guid.Empty)
                        {
                            ProcessFile(attachmentGuid);
                        }
                    }
                    else
                    {
                        // Other document types, get the attachment by file name
                        AttachmentInfo ai = null;
                        if (latest)
                        {
                            // Not livesite mode - get latest version
                            ai = DocumentHelper.GetAttachment(treeNode, processedFileName, TreeProvider, false);
                        }
                        else
                        {
                            // Live site mode, get directly from database
                            ai = AttachmentInfoProvider.GetAttachmentInfo(treeNode.DocumentID, processedFileName, false);
                        }

                        if (ai != null)
                        {
                            ProcessFile(ai.AttachmentGUID);
                        }
                    }
                }
            }
        }
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:99,代码来源:GetFile.aspx.cs

示例3: LoadAttachment

    /// <summary>
    /// Loads attachment from the given document node as the selected item
    /// </summary>
    /// <param name="node">Document</param>
    /// <returns>Returns true if only the attachment properties should be displayed in full mode.</returns>
    private bool LoadAttachment(TreeNode node)
    {
        bool fullDisplay = false;

        // Get attachment info and initialize displayed attachment properties
        Guid attachmentGUID = ValidationHelper.GetGuid(node.GetValue("FileAttachment"), Guid.Empty);
        if (attachmentGUID != Guid.Empty)
        {
            // Get the attachment
            var tree = new TreeProvider(MembershipContext.AuthenticatedUser)
            {
                UseCache = false
            };
            var atInfo = DocumentHelper.GetAttachment(node, attachmentGUID, tree, false);
            if (atInfo != null)
            {
                // Get the data
                string extension = atInfo.AttachmentExtension;
                bool isContentFile = node.IsFile();

                if (CMSDialogHelper.IsItemSelectable(SelectableContent, extension, isContentFile))
                {
                    // Set 'get file path'
                    atInfo.AttachmentUrl = GetNodeUrl(node);

                    CurrentAttachmentInfo = atInfo;

                    // Display full-sized properties only when media dialog is opened not in listing mode, node has no children, node is image and selectable are only images or output is not a link
                    if (!IsFullListingMode &&
                        !node.NodeHasChildren &&
                        (!IsLinkOutput || (ImageHelper.IsImage(extension) && (SelectableContent == SelectableContentEnum.OnlyImages))))
                    {
                        // Display properties in full size
                        fullDisplay = true;
                    }
                }
                else
                {
                    mediaView.InfoText = GetString("dialogs.item.notselectable");
                }
            }
        }

        return fullDisplay;
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:50,代码来源:LinkMediaSelector.ascx.cs

示例4: SetupControl

    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        if (StopProcessing || DocumentContext.CurrentDocument == null || DocumentContext.CurrentDocument.NodeClassName.ToLowerCSafe() != "cms.bookingevent")
        {
            // Do nothing
            Visible = false;
        }
        else
        {
            // Get current event document
            EventNode = DocumentContext.CurrentDocument;

            // Get event date, open from/to, capacity and possibility to register over capacity information
            eventDate = ValidationHelper.GetDateTimeSystem(EventNode.GetValue("EventDate"), DateTimeHelper.ZERO_TIME);
            openFrom = ValidationHelper.GetDateTimeSystem(EventNode.GetValue("EventOpenFrom"), DateTimeHelper.ZERO_TIME);
            openTo = ValidationHelper.GetDateTimeSystem(EventNode.GetValue("EventOpenTo"), DateTimeHelper.ZERO_TIME);
            capacity = ValidationHelper.GetInteger(EventNode.GetValue("EventCapacity"), 0);
            allowRegistrationOverCapacity = ValidationHelper.GetBoolean(EventNode.GetValue("EventAllowRegistrationOverCapacity"), false);

            // Display registration section
            DisplayRegistration();

            // Display link to iCalendar file which adds this event to users Outlook
            if (AllowExportToOutlook)
            {
                lnkOutlook.NavigateUrl = "~/CMSModules/EventManager/CMSPages/AddToOutlook.aspx?eventid=" + EventNode.NodeID;
                lnkOutlook.Target = "_blank";
                lnkOutlook.Text = GetString("eventmanager.exporttooutlook");
                lnkOutlook.Visible = true;
            }
        }
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:35,代码来源:EventManager.ascx.cs

示例5: CreateChannelFromNode

        /// <summary>
        /// TreeNode에 정의된 데이터를 기준으로 NetworkChannel 객체를 생성합니다.
        /// TreeNode에는 name, sessionClass, maxSessionPoolCount, listenIpAddress, listenPortNo가 정의되어있어야 합니다.
        /// </summary>
        /// <param name="node">생성할 NetworkChannel의 데이터가 정의된 TreeNode</param>
        /// <returns>생성된 NetworkChannel 객체</returns>
        public static NetworkChannel CreateChannelFromNode(TreeNode<string> node)
        {
            lock (Channels)
            {
                string channelName = node.GetValue("name").ToString();
                if (Channels.Exists(channelName))
                    throw new AegisException(AegisResult.AlreadyExistName, "'{0}' is already exists channel name.", node.Name);

                NetworkChannel channel = new NetworkChannel(channelName);
                channel._configNode = node;
                channel.SessionGenerator = delegate { return GenerateSession(node.GetValue("sessionClass")); };
                channel.MaxSessionCount = node.GetValue("maxSessionCount").ToInt32();
                channel.Acceptor.ListenIpAddress = node.GetValue("listenIpAddress");
                channel.Acceptor.ListenPortNo = node.GetValue("listenPortNo").ToInt32();
                Channels.Add(channelName, channel);

                return channel;
            }
        }
开发者ID:SyncZone,项目名称:AegisFramework,代码行数:25,代码来源:NetworkChannel.cs


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