Exemplo n.º 1
0
        internal void RemoveResource([NotNull] HardwareResource resource)
        {
            if (resource == null)
            {
                throw new ArgumentNullException(nameof(resource));
            }

            mResources?.Remove(resource);
            DiagnosticsWriter.WriteDebug("Removed association of resource \"{0}\" from device.", resource);
        }
Exemplo n.º 2
0
        internal void AddResource([NotNull] HardwareResource resource)
        {
            if (resource == null)
            {
                throw new ArgumentNullException(nameof(resource));
            }

            if (mResources == null)
            {
                throw new ObjectDisposedException(nameof(AccelerationDevice), "The device is not available anymore.");
            }

            DiagnosticsWriter.WriteDebug("Associating resource \"{0}\" with device.", resource);
            mResources.Add(resource);
        }