8 /// Base interface for Guid containers, object that can store a unique identifier for a collection of object.
9 /// </summary>
10 /// <remarks>Specialization of this interface will usually hold references on objects until they are unregistered or until the container is cleared.</remarks>
14 /// Gets or or create a <see cref="Guid"/> for a given object. If the object is <c>null</c>, a new Guid will be returned.
15 /// </summary>
16 /// <param name="obj">The object.</param>
17 /// <returns>The <see cref="Guid"/> associated to the given object, or a newly registered <see cref="Guid"/> if the object was not previously registered.</returns>
18 Guid GetOrCreateGuid(object obj);
19
20 /// <summary>
21 /// Gets the <see cref="Guid"/> for a given object, if available.
22 /// </summary>
23 /// <param name="obj">The object.</param>
24 /// <returns>The <see cref="Guid"/> associated to the given object, or <see cref="Guid.Empty"/> if the object was not previously registered.</returns>
25 Guid GetGuid(object obj);
26
27 /// <summary>
28 /// Register the given <see cref="Guid"/> to the given object. If a <see cref="Guid"/> is already associated to this object, it is replaced by the new one.
29 /// </summary>
30 /// <param name="guid">The <see cref="Guid"/> to register.</param>
31 /// <param name="obj">The object to register.</param>
32void RegisterGuid(Guid guid, object obj);
33
34 /// <summary>
35 /// Removes a <see cref="Guid"/> that was previously registered.
36 /// </summary>
37 /// <param name="guid">The <see cref="Guid"/> to remove.</param>
38 /// <returns><c>true</c> if a <see cref="Guid"/> has been actually removed, <c>false</c> otherwise.</returns>
39bool UnregisterGuid(Guid guid);
40
41 /// <summary>
42 /// Clear the <see cref="IGuidContainer"/>, removing everything it references.