示例#1
0
        public override object Parse(ISelectedData selectedData)
        {
            string[] data = RemoveSelector(selectedData.Data);

            if (data.Length == 0)
            {
                return(null);
            }

            return(GeneralDataBuilder.Create()
                   .WithVersion(_ivaoStringService.IVAO_GetInt(new VersionExtractor().ExtractValue(data)))
                   .WithReload(_ivaoStringService.IVAO_GetInt(new ReloadExtractor().ExtractValue(data)))
                   .WithUpdate(_ivaoStringService.IVAO_GetDateTime(new UpdateExtractor().ExtractValue(data)) ?? DateTime.MinValue)
                   .WithConnectedClients(_ivaoStringService.IVAO_GetInt(new ConnectedClientsExtractor().ExtractValue(data)))
                   .WithConnectedServers(_ivaoStringService.IVAO_GetInt(new ConnectedServersExtractor().ExtractValue(data)))
                   .WithConnectedAirports(_ivaoStringService.IVAO_GetInt(new ConnectedAirportsExtractor().ExtractValue(data)))
                   .Build());
        }
        protected TBuilder AssignGeneralData <TBuilder>(TBuilder builder, string[] rowData)
            where TBuilder : AbstractClientBuilder <TBuilder>
        {
            GPS location = GetLocation(rowData);

            return(builder
                   .WithCallsign(rowData[ClientIndex.All.Callsign])
                   .WithVID(rowData[ClientIndex.All.VID])
                   .WithName(rowData[ClientIndex.All.Name])
                   .WithLocation(location)
                   .WithServer(rowData[ClientIndex.All.Server])
                   .WithProtocol(rowData[ClientIndex.All.Protocol])
                   .WithConnectionTime(_ivaoStringService.IVAO_GetDateTime(rowData[ClientIndex.All.ConnectionTime]) ?? DateTime.MinValue)
                   .WithSoftwareName(rowData[ClientIndex.All.SoftwareName])
                   .WithSoftwareVersion(rowData[ClientIndex.All.SoftwareVersion])
                   .WithAdministrativeVersion((AdministrativeRating)_ivaoStringService.IVAO_GetInt(rowData[ClientIndex.All.AdministrativeVersion]))
                   .WithClientRating(_ivaoStringService.IVAO_GetInt(rowData[ClientIndex.All.ClientRating])));
        }