public int CompareAlliance(IEveCharacter char1, IEveCharacter char2, SortOrder order) { var comparison = String.Compare(char1.Alliance, char2.Alliance, StringComparison.InvariantCultureIgnoreCase) * (int)order; return(comparison == 0 ? CompareCorporation(char1, char2, SortOrder.Ascending) : comparison); }
public static void AddFirst(IEveCharacter character) { lock (REQUEST_QUEUE) { REQUEST_QUEUE.AddFirst(character); Monitor.Pulse(REQUEST_QUEUE); } }
private static bool IsAssociatedTo(IEveCharacter eveChar, IEveCharacter curChar) { return(eveChar.KillboardInformation != null && ( eveChar.KillboardInformation.AssociatedAlliances.Contains (curChar.Alliance) || eveChar.KillboardInformation.AssociatedCorporations .Contains(curChar.Corporation))); }
private static bool AreConnected(IEveCharacter eveChar, IEveCharacter curChar) { if (Properties.Settings.Default.IsShowingCoalitionsColumn && eveChar.Coalitions.Any(c => curChar.Coalitions.Contains(c))) { return(true); } return((!string.IsNullOrEmpty(eveChar.Alliance) ? eveChar.Alliance == curChar.Alliance : !string.IsNullOrEmpty(eveChar.Corporation) && curChar.Corporation == eveChar.Corporation) || IsAssociatedTo(eveChar, curChar) || IsAssociatedTo(curChar, eveChar)); }
public EveCharacterViewModel(IEveCharacter eveCharacter, EveLocalStatistics statistics) { EveCharacter = eveCharacter; _statistics = statistics; EveCharacter.PropertyChanged += OnPropertyChanged; Properties.Settings.Default.PropertyChanged += SettingsPropertyChanged; ActiveProfile.Default.PropertyChanged += SettingsPropertyChanged; _customCharacterInfo = CUSTOM_CHARACTER_INFO_REPOSITORY.GetCustomCharacterInfo(eveCharacter); _customCharacterInfo.PropertyChanged += CustomCharacterInfoOnPropertyChanged; InitValues(); }
private static int CompareLocalChangeStatus(IEveCharacter char1, IEveCharacter char2) { if (char1.LocalChangeStatus == char2.LocalChangeStatus) { return(0); } if (char1.LocalChangeStatus == LocalChangeStatus.Exited) { return(1); } return(char2.LocalChangeStatus == LocalChangeStatus.Exited ? -1 : 0); }
public int CompareCoalitions(IEveCharacter char1, IEveCharacter char2, SortOrder order) { var char1Coalition = char1.Coalitions.FirstOrDefault(); var char1CoalitionName = char1Coalition != null ? char1Coalition.Name : ""; var char2Coalition = char2.Coalitions.FirstOrDefault(); var char2CoalitionName = char2Coalition != null ? char2Coalition.Name : ""; var comparison = String.Compare(char1CoalitionName, char2CoalitionName, StringComparison.InvariantCultureIgnoreCase) * (int)order; return(comparison == 0 ? CompareAlliance(char1, char2, SortOrder.Ascending) : comparison); }
private static bool TryGetEveCharacterFromMenuItem(object sender, out IEveCharacter eveChar) { var menuItem = sender as MenuItem; if (menuItem == null) { eveChar = null; return(false); } var vm = menuItem.CommandParameter as EveCharacterViewModel; if (vm != null) { eveChar = vm.EveCharacter; return(true); } eveChar = null; return(false); }
public CustomCharacterInfoViewModel GetCustomCharacterInfo(IEveCharacter character) { var id = long.Parse(character.Id); CustomCharacterInfoViewModel result; if (_viewModelsCache.TryGetValue(id, out result)) { return(result); } var customCharacterInfo = App.GetFromCollection <CustomCharacterInfo, CustomCharacterInfo>(x => x.FindById(long.Parse(character.Id))) ?? new CustomCharacterInfo { Id = id }; result = new CustomCharacterInfoViewModel(customCharacterInfo); _viewModelsCache[id] = result; return(result); }
private static void Run() { while (true) { IEveCharacter character = null; try { lock (REQUEST_QUEUE) { if (!REQUEST_QUEUE.Any()) { Monitor.Wait(REQUEST_QUEUE); continue; } character = REQUEST_QUEUE.First(); REQUEST_QUEUE.RemoveFirst(); if (character.KillboardInformation != null) { continue; } } character.KillboardInformation = GetKillboardAnalysisFor(int.Parse(character.Id)); } catch (Exception e) { var message = character == null ? "Error during KB-Data retrieval" : string.Format("Could not retrieve killboard information for {0}", character); LOG.Warn(message, e); Application.Current.Dispatcher.Invoke( new Action( () => { if (Application.Current != null && Application.Current.MainWindow != null) { ((MainWindow)Application.Current.MainWindow).SetTitleToError(message); } })); } } }
public int CompareName(IEveCharacter char1, IEveCharacter char2, SortOrder order) { return(String.Compare(char1.Name, char2.Name, StringComparison.InvariantCultureIgnoreCase) * (int)order); }
public ArchivedEveCharacter(IEveCharacter eveCharacter, LocalChangeStatus status) { _eveCharacter = eveCharacter; _status = status; _eveCharacter.PropertyChanged += EveCharacterOnPropertyChanged; }
public void OpenForCharacter(IEveCharacter character) { var url = "https://neweden.xyz/character/" + character.Id + "/"; Process.Start(url); }
//TODO standings service -> public static bool TryGetStandings(IEveCharacter eveChar, out double standings) { return(TryGetStandings(eveChar.Name, out standings) || TryGetStandings(eveChar.Corporation, out standings) || eveChar.Alliance != null && TryGetStandings(eveChar.Alliance, out standings)); }
private static bool IsInLocal(IEveCharacter character) { return(character.LocalChangeStatus != LocalChangeStatus.Exited); }
public void OpenForCharacter(IEveCharacter character) { var url = "https://zkillboard.com/charactor/search/" + character.Id + "/"; Process.Start(url); }
public void OpenForCharacter(IEveCharacter character) { var url = string.Format(@"https://zkillboard.com/character/{0}/", character.Id); Process.Start(url); }
protected bool Equals(IEveCharacter other) { return(string.Equals(Name, other.Name)); }