📄 chatuserslist.cs
字号:
public event UsersRowChangeEventHandler UsersRowDeleted;
public event UsersRowChangeEventHandler UsersRowDeleting;
public void AddUsersRow(UsersRow row) {
this.Rows.Add(row);
}
public UsersRow AddUsersRow(string userName, System.DateTime LastAccessTime) {
UsersRow rowUsersRow = ((UsersRow)(this.NewRow()));
rowUsersRow.ItemArray = new object[] {
null,
userName,
LastAccessTime};
this.Rows.Add(rowUsersRow);
return rowUsersRow;
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
UsersDataTable cln = ((UsersDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new UsersDataTable();
}
internal void InitVars() {
this.columnuserId = this.Columns["userId"];
this.columnuserName = this.Columns["userName"];
this.columnLastAccessTime = this.Columns["LastAccessTime"];
}
private void InitClass() {
this.columnuserId = new DataColumn("userId", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnuserId);
this.columnuserName = new DataColumn("userName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnuserName);
this.columnLastAccessTime = new DataColumn("LastAccessTime", typeof(System.DateTime), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnLastAccessTime);
this.columnuserId.AutoIncrement = true;
this.columnuserId.AutoIncrementSeed = 1;
}
public UsersRow NewUsersRow() {
return ((UsersRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new UsersRow(builder);
}
protected override System.Type GetRowType() {
return typeof(UsersRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.UsersRowChanged != null)) {
this.UsersRowChanged(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.UsersRowChanging != null)) {
this.UsersRowChanging(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.UsersRowDeleted != null)) {
this.UsersRowDeleted(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.UsersRowDeleting != null)) {
this.UsersRowDeleting(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action));
}
}
public void RemoveUsersRow(UsersRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class UsersRow : DataRow {
private UsersDataTable tableUsers;
internal UsersRow(DataRowBuilder rb) :
base(rb) {
this.tableUsers = ((UsersDataTable)(this.Table));
}
public int userId {
get {
try {
return ((int)(this[this.tableUsers.userIdColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tableUsers.userIdColumn] = value;
}
}
public string userName {
get {
try {
return ((string)(this[this.tableUsers.userNameColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tableUsers.userNameColumn] = value;
}
}
public System.DateTime LastAccessTime {
get {
try {
return ((System.DateTime)(this[this.tableUsers.LastAccessTimeColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tableUsers.LastAccessTimeColumn] = value;
}
}
public bool IsuserIdNull() {
return this.IsNull(this.tableUsers.userIdColumn);
}
public void SetuserIdNull() {
this[this.tableUsers.userIdColumn] = System.Convert.DBNull;
}
public bool IsuserNameNull() {
return this.IsNull(this.tableUsers.userNameColumn);
}
public void SetuserNameNull() {
this[this.tableUsers.userNameColumn] = System.Convert.DBNull;
}
public bool IsLastAccessTimeNull() {
return this.IsNull(this.tableUsers.LastAccessTimeColumn);
}
public void SetLastAccessTimeNull() {
this[this.tableUsers.LastAccessTimeColumn] = System.Convert.DBNull;
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class UsersRowChangeEvent : EventArgs {
private UsersRow eventRow;
private DataRowAction eventAction;
public UsersRowChangeEvent(UsersRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public UsersRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -