-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathUserGalleryProfile.cs
121 lines (101 loc) · 3.18 KB
/
UserGalleryProfile.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using System;
using GalleryServerPro.Business.Interfaces;
namespace GalleryServerPro.Business
{
/// <summary>
/// Represents a set of properties for a user that are specific to a particular gallery.
/// </summary>
[Serializable]
public class UserGalleryProfile : IUserGalleryProfile, IComparable
{
#region Private Fields
private int _galleryId;
private int _userAlbumId;
private bool _enableUserAlbum;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="UserGalleryProfile" /> class.
/// </summary>
public UserGalleryProfile()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="UserGalleryProfile"/> class.
/// </summary>
/// <param name="galleryId">The gallery ID.</param>
public UserGalleryProfile(int galleryId)
{
_galleryId = galleryId;
}
#endregion
#region Properties
/// <summary>
/// Gets or sets the ID of the gallery the profile properties are associated with.
/// </summary>
/// <value>The gallery ID.</value>
public int GalleryId
{
get { return _galleryId; }
set { _galleryId = value; }
}
/// <summary>
/// Gets or sets the ID for the user's personal album (aka user album).
/// </summary>
/// <value>The ID for the user's personal album (aka user album).</value>
public int UserAlbumId
{
get { return _userAlbumId; }
set { _userAlbumId = value; }
}
/// <summary>
/// Gets or sets a value indicating whether the user has enabled or disabled her personal album (aka user album).
/// </summary>
/// <value>
/// A value indicating whether the user has enabled or disabled her personal album (aka user album).
/// </value>
public bool EnableUserAlbum
{
get { return _enableUserAlbum; }
set { _enableUserAlbum = value; }
}
#endregion
#region Methods
/// <summary>
/// Creates a new instance containing a deep copy of the items it contains.
/// </summary>
/// <returns>Returns a new instance containing a deep copy of the items it contains.</returns>
public IUserGalleryProfile Copy()
{
IUserGalleryProfile copy = new UserGalleryProfile(GalleryId);
copy.EnableUserAlbum = this.EnableUserAlbum;
copy.UserAlbumId = this.UserAlbumId;
return copy;
}
#endregion
#region IComparable
/// <summary>
/// Compares the current instance with another object of the same type.
/// </summary>
/// <param name="obj">An object to compare with this instance.</param>
/// <returns>
/// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than <paramref name="obj"/>. Zero This instance is equal to <paramref name="obj"/>. Greater than zero This instance is greater than <paramref name="obj"/>.
/// </returns>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="obj"/> is not the same type as this instance. </exception>
public int CompareTo(object obj)
{
if (obj == null)
return 1;
else
{
var other = obj as IUserGalleryProfile;
if (other != null)
return this.GalleryId.CompareTo(other.GalleryId);
else
return 1;
}
}
#endregion
}
}