App_Code/Sections/LinkList.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

//===============================================================================================
//
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.
//
//===============================================================================================

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data;
using System.Collections.Generic;

namespace MyWebPagesStarterKit
{
    public class LinkList : Section<LinkList.LinkListData>, ISidebarObject
    {
        public LinkList()
        {
            _data.Entries = new DataSet();
            _data.Entries.Tables.Add(new DataTable("LinkListEntries"));

            DataColumn primaryKeyColumn = new DataColumn("Guid", typeof(Guid));
            primaryKeyColumn.Unique = true;

            _data.Entries.Tables["LinkListEntries"].Columns.Add(primaryKeyColumn);
            _data.Entries.Tables["LinkListEntries"].PrimaryKey = new DataColumn[] { primaryKeyColumn };

            _data.Entries.Tables["LinkListEntries"].Columns.AddRange(
                new DataColumn[] 
                {
                    new DataColumn("Title", typeof(string)),
                    new DataColumn("Url", typeof(string)),
                    new DataColumn("Target", typeof(string)),
                    new DataColumn("Comment", typeof(string))
                }
           );
        }

        public LinkList(string id) : base(id) { }

        public DataView GetLinkEntries()
        {
            return new DataView(LinkEntries, string.Empty, "Title ASC", DataViewRowState.CurrentRows); 
        }

        public DataTable LinkEntries
        {
            get { return _data.Entries.Tables["LinkListEntries"]; }
        }

        public DataRow GetLinkEntry(string id)
        {
            DataRow row = null;
            DataRow[] foundRows = LinkEntries.Select(string.Format("Guid = '{0}'", id));
            if (foundRows.Length > 0)
                row = foundRows[0];
后面还有 71 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。