📄 bbsdataset.cs
字号:
private void InitClass() {
this.columnTitle = new DataColumn("Title", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnTitle);
this.columnFileName = new DataColumn("FileName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnFileName);
this.columnPostTime = new DataColumn("PostTime", typeof(System.DateTime), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnPostTime);
this.columnStatus = new DataColumn("Status", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnStatus);
this.columnClick = new DataColumn("Click", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnClick);
this.columnReply = new DataColumn("Reply", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnReply);
this.columnLastReply = new DataColumn("LastReply", typeof(System.DateTime), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnLastReply);
this.columnScore = new DataColumn("Score", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnScore);
this.columnID = new DataColumn("ID", typeof(long), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnID);
this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
this.columnID}, true));
this.columnID.AutoIncrement = true;
this.columnID.AllowDBNull = false;
this.columnID.ReadOnly = true;
this.columnID.Unique = true;
}
public BBSRow NewBBSRow() {
return ((BBSRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new BBSRow(builder);
}
protected override System.Type GetRowType() {
return typeof(BBSRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.BBSRowChanged != null)) {
this.BBSRowChanged(this, new BBSRowChangeEvent(((BBSRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.BBSRowChanging != null)) {
this.BBSRowChanging(this, new BBSRowChangeEvent(((BBSRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.BBSRowDeleted != null)) {
this.BBSRowDeleted(this, new BBSRowChangeEvent(((BBSRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.BBSRowDeleting != null)) {
this.BBSRowDeleting(this, new BBSRowChangeEvent(((BBSRow)(e.Row)), e.Action));
}
}
public void RemoveBBSRow(BBSRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class BBSRow : DataRow {
private BBSDataTable tableBBS;
internal BBSRow(DataRowBuilder rb) :
base(rb) {
this.tableBBS = ((BBSDataTable)(this.Table));
}
public string Title {
get {
try {
return ((string)(this[this.tableBBS.TitleColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableBBS.TitleColumn] = value;
}
}
public string FileName {
get {
try {
return ((string)(this[this.tableBBS.FileNameColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableBBS.FileNameColumn] = value;
}
}
public System.DateTime PostTime {
get {
try {
return ((System.DateTime)(this[this.tableBBS.PostTimeColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableBBS.PostTimeColumn] = value;
}
}
public string Status {
get {
try {
return ((string)(this[this.tableBBS.StatusColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableBBS.StatusColumn] = value;
}
}
public int Click {
get {
try {
return ((int)(this[this.tableBBS.ClickColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableBBS.ClickColumn] = value;
}
}
public int Reply {
get {
try {
return ((int)(this[this.tableBBS.ReplyColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableBBS.ReplyColumn] = value;
}
}
public System.DateTime LastReply {
get {
try {
return ((System.DateTime)(this[this.tableBBS.LastReplyColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableBBS.LastReplyColumn] = value;
}
}
public int Score {
get {
try {
return ((int)(this[this.tableBBS.ScoreColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("Cannot get value because it is DBNull.", e);
}
}
set {
this[this.tableBBS.ScoreColumn] = value;
}
}
public long ID {
get {
return ((long)(this[this.tableBBS.IDColumn]));
}
set {
this[this.tableBBS.IDColumn] = value;
}
}
public bool IsTitleNull() {
return this.IsNull(this.tableBBS.TitleColumn);
}
public void SetTitleNull() {
this[this.tableBBS.TitleColumn] = System.Convert.DBNull;
}
public bool IsFileNameNull() {
return this.IsNull(this.tableBBS.FileNameColumn);
}
public void SetFileNameNull() {
this[this.tableBBS.FileNameColumn] = System.Convert.DBNull;
}
public bool IsPostTimeNull() {
return this.IsNull(this.tableBBS.PostTimeColumn);
}
public void SetPostTimeNull() {
this[this.tableBBS.PostTimeColumn] = System.Convert.DBNull;
}
public bool IsStatusNull() {
return this.IsNull(this.tableBBS.StatusColumn);
}
public void SetStatusNull() {
this[this.tableBBS.StatusColumn] = System.Convert.DBNull;
}
public bool IsClickNull() {
return this.IsNull(this.tableBBS.ClickColumn);
}
public void SetClickNull() {
this[this.tableBBS.ClickColumn] = System.Convert.DBNull;
}
public bool IsReplyNull() {
return this.IsNull(this.tableBBS.ReplyColumn);
}
public void SetReplyNull() {
this[this.tableBBS.ReplyColumn] = System.Convert.DBNull;
}
public bool IsLastReplyNull() {
return this.IsNull(this.tableBBS.LastReplyColumn);
}
public void SetLastReplyNull() {
this[this.tableBBS.LastReplyColumn] = System.Convert.DBNull;
}
public bool IsScoreNull() {
return this.IsNull(this.tableBBS.ScoreColumn);
}
public void SetScoreNull() {
this[this.tableBBS.ScoreColumn] = System.Convert.DBNull;
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class BBSRowChangeEvent : EventArgs {
private BBSRow eventRow;
private DataRowAction eventAction;
public BBSRowChangeEvent(BBSRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public BBSRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -