/// <summary> /// 添加备份信息 /// </summary> /// <param name="info">信息对象</param> /// <returns></returns> public bool Add(BackInfo info) { //判断是否已经存在 if (Exists(info)) { return(false); } _list.Add(info); //保存信息 SaveList(); return(true); }
/// <summary> /// 移除备份信息 /// </summary> /// <param name="DBName">数据库名称</param> /// <returns></returns> public bool Remove(string DBName) { //判断是否存在 if (Exists(DBName) == false) { return(false); } BackInfo target = _list.Where(q => q.DBName == DBName).First(); _list.Remove(target); //保存信息 SaveList(); return(true); }
/// <summary> /// 判断备份的数据库信息是否存在 /// </summary> /// <param name="info">信息对象</param> /// <returns></returns> public bool Exists(BackInfo info) { return(Exists(info.DBName)); }
/// <summary> /// 移除备份信息 /// </summary> /// <param name="info">信息对象</param> /// <returns></returns> public bool Remove(BackInfo info) { return(Remove(info.DBName)); }