Assets/Watson/Scripts/Services/IWatsonService.cs
/// <summary>
/// This returns a instance of all services.
/// </summary>
/// <returns>An array of IWatsonService instances.</returns>
This returns a instance of all services.
This returns a instance of all services .
public static IWatsonService[] GetAllServices(bool reqCredentials = false)
        {
            List<IWatsonService> services = new List<IWatsonService>();
            Type[] types = Utilities.Utility.FindAllDerivedTypes(typeof(IWatsonService));
            foreach (var type in types)
            {
                try
                {
                    IWatsonService serviceObject = Activator.CreateInstance(type) as IWatsonService;
                    if (reqCredentials && Config.Instance.FindCredentials(serviceObject.GetServiceID()) == null)
                        continue;       
                    services.Add(serviceObject as IWatsonService);
                }
                catch (Exception)
                { }
            }
            return services.ToArray();
        }
public static IWatsonService [ ] GetAllServices ( bool reqCredentials = false ) { List < IWatsonService > services = new List < IWatsonService > ( ) ; Type [ ] types = Utilities . Utility . FindAllDerivedTypes ( typeof ( IWatsonService ) ) ; foreach ( var type in types ) { try { IWatsonService serviceObject = Activator . CreateInstance ( type ) as IWatsonService ; if ( reqCredentials && Config . Instance . FindCredentials ( serviceObject . GetServiceID ( ) ) == null ) continue ; services . Add ( serviceObject as IWatsonService ) ; } catch ( Exception ) { } } return services . ToArray ( ) ; }
This returns a instance of all services.
This returns a instance of all services .
// skip services that don't have credential data..
An array of IWatsonService instances.
An array of IWatsonService instances .
reqCredentials
bool