public ServerSelectionList(ComboBox comboBox, ILogger logger)
 {
     this.comboBox = comboBox;
     this.logger   = logger;
     Insert(0, new LatestServerSource("Stable", ProfileParser.GetDayZFolder(), ProfileParser.GetProfileFilename()));
     Insert(1, new LatestServerSource("Experimental", ProfileParser.GetExperimentalDayZFolder(), ProfileParser.GetProfileFilename()));
     comboBox.SelectedIndex = 0;
 }
示例#2
0
 public async Task <Server> GetServer(ILogger logger, IClock clock, CancellationTokenSource source)
 {
     try
     {
         return(await ProfileParser.GetLastServer(Path.Combine(ProfileDirectory, ProfileFilename), clock, source));
     }
     catch (Exception e)
     {
         logger.Error("Failed to determine last played server", e);
         return(null);
     }
 }
 public async Task <Server> GetServer()
 {
     try
     {
         return(await ProfileParser.GetLastServer(Path.Combine(ProfileDirectory, ProfileFilename)));
     }
     catch (Exception e)
     {
         Logger.Error("Failed to determine last played server", e);
         return(null);
     }
 }