Library.Net.Amoeba.DownloadManager.Remove C# (CSharp) Method

Remove() public method

public Remove ( int id ) : void
id int
return void
        public void Remove(int id)
        {
            lock (_thisLock)
            {
                var item = _idManager.GetItem(id);

                if (item.State != DownloadState.Completed)
                {
                    _cacheManager.Unlock(item.Seed.Metadata.Key);

                    foreach (var index in item.Indexes)
                    {
                        foreach (var group in index.Groups)
                        {
                            foreach (var key in group.Keys)
                            {
                                _cacheManager.Unlock(key);
                            }
                        }
                    }
                }

                this.UncheckState(item.Index);

                _settings.DownloadItems.Remove(item);
                _idManager.Remove(id);
            }
        }