Browse Source

Exposed services as an IEnumerator instead

tags/docs-0.9
Justas Dabrila 9 years ago
parent
commit
6841217dad
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net/ServiceManager.cs

+ 3
- 1
src/Discord.Net/ServiceManager.cs View File

@@ -1,11 +1,11 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;


namespace Discord namespace Discord
{ {
public class ServiceManager public class ServiceManager
{ {
public IEnumerable<IService> Services => _services.Values;
private readonly Dictionary<Type, IService> _services; private readonly Dictionary<Type, IService> _services;


internal DiscordClient Client { get; } internal DiscordClient Client { get; }
@@ -37,5 +37,7 @@ namespace Discord
throw new InvalidOperationException($"This operation requires {typeof(T).Name} to be added to {nameof(DiscordClient)}."); throw new InvalidOperationException($"This operation requires {typeof(T).Name} to be added to {nameof(DiscordClient)}.");
return singletonT; return singletonT;
} }

public IEnumerator GetEnumerator() => _services.Values.GetEnumerator();
} }
} }

Loading…
Cancel
Save