📄 photos.cs
字号:
using System;
using System.Collections;
namespace VirtualPhotoOrganizer.Photo
{
/// <summary>
/// the collections class for a Photo
/// </summary>
internal class Photos : CollectionBase, ICloneable
{
#region public accessors
public int Add(Photo p) {
return List.Add(p);
}
public void Insert(int index, Photo p) {
List.Insert(index, p);
}
public void Remove(Photo p) {
List.Remove(p);
}
public void RemoveAt(int index) {
List.RemoveAt(index);
}
public bool Contains(Photo p) {
return List.Contains(p);
}
public int IndexOf(Photo p) {
return List.IndexOf(p);
}
public void CopyTo(Photo[] array, int index) {
List.CopyTo(array, index);
}
public Photo this[int index] {
get { return (Photo) List[index]; }
set { List[index] = value; }
}
#endregion
#region ICloneable Member
public object Clone() {
Photos photos = new Photos();
foreach (Photo p in this)
photos.Add(new Photo(p.Path, p.Thumbnail, p.Title, p.Description, p.TimeTaken));
return photos;
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -