In case you want to load data from text file stored in local computer.
string path = @"C:\Data\whazzup.txt";
IIVAOWhazzupDataSource nonCachedLocalDataSource = new LocalIVAOWhazzupDataSource(path);
In case you want to load data from local computer compressed using GZip.
string path = @"C:\Data\whazzup.txt.gz";
IGZipCompression compression = new GZipCompression();
IIVAOWhazzupDataSource nonCachedLocalGZippedDataSource = new LocalGZippedIVAOWhazzupDataSource(path, compression);
In case you want to load data from web in plain text format.
string url = "http://api.ivao.aero/getdata/whazzup/whazzup.txt";
IIVAOWhazzupDataSource nonCachedWebDataSource = new WebIVAOWhazzupDataSource(url);
In case you want to load data from web compressed using GZip.
string url = "http://api.ivao.aero/getdata/whazzup/whazzup.txt.gz";
IGZipCompression gzipCompression = new GZipCompression();
IIVAOWhazzupDataSource nonCachedGZippedWebDataSource = new WebGZippedIVAOWhazzupDataSource(url, gzipCompression);
Once you have data source created you can use it or you can create Cached
datasource.
ICachedIVAOWhazzupDataSource dataSource = new CachedIVAOWhazzupDataSource(nonCachedWebDataSource);
Note: In case you use cached provider, this provider will always return the same data until cache is deleted manually.
datasource.DeleteCache();
You need to create also factory to create parsers for specific data types / sections.
IParserFactory parserFactory = new ParserFactory();
You need to create also section selectors to create extract/select correct section data and pass them to correct parsers.
IGeneralSelector generalSelector = new GeneralSelector();
IClientsSelector clientsSelector = new ClientsSelector();
IServersSelector serverSelector = new ServersSelector();
IAirportsSelector airportsSelector = new AirportsSelector();
Once you have created all supporting instances, you need to create provider depending on what kind of data you are interested in.
// in case you want !GENERAL data
IGeneralDataProvider generalDataProvider = new GeneralDataProvider(dataSource, parserFactory, generalSelector);
// in case you want !CLIENTS data (ATC, PILOT, FOLME)
IClientsProvider clientsDataProvider = new ClientsDataProvider(dataSource, parserFactory, clientsSelector);
// in case you want !CLIENTS specific data -> ATC
IClientsProvider atcClientsDataProvider = new AirTrafficControllersDataProvider(dataSource, parserFactory, clientsSelector);
// in case you want !CLIENTS specific data -> PILOT
IClientsProvider pilotClientsDataProvider = new PilotsDataProvider(dataSource, parserFactory, clientsSelector);
// in case you want !CLIENTS specific data -> FOLME
IClientsProvider followMeClientsDataProvider = new FollowMesDataProvider(dataSource, parserFactory, clientsSelector);
// in case you want !SERVERS data
IServersProvider serversDataProvider = new ServersDataProvider(dataSource, parserFactory, serverSelector);
// in case you want !AIRPORTS data
IAirportsProvider airportsDataProvider = new AirportsDataProvider(dataSource, parserFactory, airportsSelector);
Once you have provider instance you just need to call it to get data.
var data = yourProvider.GetData().ToList();
IVAO Library is licensed under the MIT license.
In case you are interested visit IVAO
homepage here https://www.ivao.aero/