5 namespace SiliconStudio.Core
21 if (ReferenceEquals(thisArg, null))
23 container.Collector.Remove(thisArg);
35 if (ReferenceEquals(thisArg, null))
37 return container.Collector.Add(thisArg);
49 if (ReferenceEquals(thisArg, null))
51 return collector.Add(thisArg);
61 public static T KeepReference<T>(
this T thisArg) where T :
IReferencable
63 if (ReferenceEquals(thisArg, null))
65 thisArg.AddReference();
76 public static T DisposeBy<T>(
this T thisArg,
ICollectorHolder container) where T : IDisposable
78 if (ReferenceEquals(thisArg, null))
80 return container.Collector.Add(thisArg);
Base interface for all referencable objects.
Interface ICollectorHolder for an instance that can collect other instance.
A struct to dispose IDisposable, IReferencable instances and allocated unmanaged memory.
Extensions for IComponent.