1 Star 0 Fork 1

Sail/SQLiteHelper.net

forked from wo4fisher/SQLiteHelper.net 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SQLiteColumnList.cs 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
Adrian Voo 提交于 2018-09-16 23:28 +08:00 . minor update
using System;
using System.Collections.Generic;
using System.Text;
namespace System.Data.SQLite
{
public class SQLiteColumnList : IList<SQLiteColumn>
{
List<SQLiteColumn> _lst = new List<SQLiteColumn>();
private void CheckColumnName(string colName)
{
for (int i = 0; i < _lst.Count; i++)
{
if (_lst[i].ColumnName == colName)
throw new Exception("Column name of \"" + colName + "\" is already existed.");
}
}
public int IndexOf(SQLiteColumn item)
{
return _lst.IndexOf(item);
}
public void Insert(int index, SQLiteColumn item)
{
CheckColumnName(item.ColumnName);
_lst.Insert(index, item);
}
public void RemoveAt(int index)
{
_lst.RemoveAt(index);
}
public SQLiteColumn this[int index]
{
get
{
return _lst[index];
}
set
{
if (_lst[index].ColumnName != value.ColumnName)
{
CheckColumnName(value.ColumnName);
}
_lst[index] = value;
}
}
public void Add(SQLiteColumn item)
{
CheckColumnName(item.ColumnName);
_lst.Add(item);
}
public void Clear()
{
_lst.Clear();
}
public bool Contains(SQLiteColumn item)
{
return _lst.Contains(item);
}
public void CopyTo(SQLiteColumn[] array, int arrayIndex)
{
_lst.CopyTo(array, arrayIndex);
}
public int Count
{
get { return _lst.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
public bool Remove(SQLiteColumn item)
{
return _lst.Remove(item);
}
public IEnumerator<SQLiteColumn> GetEnumerator()
{
return _lst.GetEnumerator();
}
Collections.IEnumerator Collections.IEnumerable.GetEnumerator()
{
return _lst.GetEnumerator();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sail87/SQLiteHelper.net.git
git@gitee.com:sail87/SQLiteHelper.net.git
sail87
SQLiteHelper.net
SQLiteHelper.net
master

搜索帮助