App_Code/Sections/NewsList.cs
(开头部分) 6KB这里只显示每个文件的开头 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.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace MyWebPagesStarterKit
{
/// <summary>
/// News List Section
/// This section displays a list of news
/// Only news with a showuntil date that lies in the future are displayed
/// </summary>
public class NewsList : Section<NewsList.NewsListData>, ISidebarObject
{
public NewsList()
{
_data.Entries = new DataSet();
_data.Entries.Tables.Add(new DataTable("NewsListEntries"));
DataColumn primaryKeyColumn = new DataColumn("Guid", typeof(Guid));
primaryKeyColumn.Unique = true;
_data.Entries.Tables["NewsListEntries"].Columns.Add(primaryKeyColumn);
_data.Entries.Tables["NewsListEntries"].PrimaryKey = new DataColumn[] { primaryKeyColumn };
_data.Entries.Tables["NewsListEntries"].Columns.AddRange(
new DataColumn[]
{
new DataColumn("Headline", typeof(string)),
new DataColumn("Newstext", typeof(string)),
new DataColumn("NewsDate", typeof(DateTime)),
new DataColumn("ShowUntil", typeof(DateTime))
}
);
}
public NewsList(string id) : base(id) { }
/// <summary>
/// The DataTable with all news
/// </summary>
public DataTable NewsEntries
{
get { return _data.Entries.Tables["NewsListEntries"]; }
}
/// <summary>
/// Returns a DataView with all news that have a ShowUntil-Date in the future and NewsDate in the past
/// </summary>
public DataView GetNewsEntriesReadonly()
后面还有 100 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
