public Telescope(string telescopeId) : base(telescopeId) { if (DriverLoader.AscomInterfaces(Impl.GetType()).Contains(typeof(ITelescopeV3))) { isPlatform6Telescope = true; } TL.LogMessage("Telescope", "Platform 5 Telescope: " + isPlatform5Telescope.ToString() + " Platform 6 Telescope: " + isPlatform6Telescope.ToString()); }
virtual protected bool validateResult(object result) { if (result != null && DriverLoader.IsDriver(result.GetType())) { logger?.LogInformation($"Service type request successful"); return(true); } logger?.LogInformation($"Service type request failed"); return(false); }
virtual protected bool valdateRequestType(Type serviceType) { bool result = false; string driverName = serviceType?.FullName ?? "{null}"; logger?.LogInformation($"Type requested: {driverName}"); if (!DriverLoader.IsDriver(serviceType)) { logger?.LogInformation($"Invalid type request: '{driverName ?? "null"}', not a driver type"); } else if (serviceType.IsInterface) { logger?.LogInformation($"Invalid type request: '{driverName}', request typemust be a concrete implmentation class"); } else if (DriverLoader.IsApiType(serviceType)) { logger?.LogInformation($"Invalid type request: '{driverName}', request type cannot be a drvier API type "); } else { result = true; } return(result); }
public DriverApiService(IServiceProvider service) : base(service) { Selector = (Type dType) => { return(DriverLoader.GetApiDriver(dType)); }; }
public DriverImplementationService(IServiceProvider service) : base(service) { Selector = (Type dType) => { return(DriverLoader.GetImplementation(dType)); }; }