private void ParseEntityTimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs) { this.EndTime = DateTime.Now; if (this.ParseEntityTimerProcessing) { return; } this.ParseEntityTimerProcessing = true; Func <bool> processor = delegate { try { var parseEntity = new ParseEntity { Players = new List <PlayerEntity>() }; foreach (StatGroup statGroup in this.Timeline.Party) { var player = (Player)statGroup; try { var type = Regex.Match(player.Name, @"\[(?<type>.+)\]", SharedRegEx.DefaultOptions).Groups["type"].Value; var playerEntity = new PlayerEntity { Name = player.Name, Job = Actor.Job.Unknown, CombinedDPS = (double)player.GetStatValue("CombinedDPS"), DPS = (double)player.GetStatValue("DPS"), DOTPS = (double)player.GetStatValue("DOTPS"), CombinedHPS = (double)player.GetStatValue("CombinedHPS"), HPS = (double)player.GetStatValue("HPS"), HOTPS = (double)player.GetStatValue("HOTPS"), HOHPS = (double)player.GetStatValue("HOHPS"), HMPS = (double)player.GetStatValue("HMPS"), CombinedDTPS = (double)player.GetStatValue("CombinedDTPS"), DTPS = (double)player.GetStatValue("DTPS"), DTOTPS = (double)player.GetStatValue("DTOTPS"), CombinedTotalOverallDamage = (double)player.GetStatValue("CombinedTotalOverallDamage"), TotalOverallDamage = (double)player.GetStatValue("TotalOverallDamage"), TotalOverallDamageOverTime = (double)player.GetStatValue("TotalOverallDamageOverTime"), CombinedTotalOverallHealing = (double)player.GetStatValue("CombinedTotalOverallHealing"), TotalOverallHealing = (double)player.GetStatValue("TotalOverallHealing"), TotalOverallHealingOverTime = (double)player.GetStatValue("TotalOverallHealingOverTime"), TotalOverallHealingOverHealing = (double)player.GetStatValue("TotalOverallHealingOverHealing"), TotalOverallHealingMitigated = (double)player.GetStatValue("TotalOverallHealingMitigated"), CombinedTotalOverallDamageTaken = (double)player.GetStatValue("CombinedTotalOverallDamageTaken"), TotalOverallDamageTaken = (double)player.GetStatValue("TotalOverallDamageTaken"), TotalOverallDamageTakenOverTime = (double)player.GetStatValue("TotalOverallDamageTakenOverTime"), PercentOfTotalOverallDamage = (double)player.GetStatValue("PercentOfTotalOverallDamage"), PercentOfTotalOverallDamageOverTime = (double)player.GetStatValue("PercentOfTotalOverallDamageOverTime"), PercentOfTotalOverallHealing = (double)player.GetStatValue("PercentOfTotalOverallHealing"), PercentOfTotalOverallHealingOverTime = (double)player.GetStatValue("PercentOfTotalOverallHealingOverTime"), PercentOfTotalOverallHealingOverHealing = (double)player.GetStatValue("PercentOfTotalOverallHealingOverHealing"), PercentOfTotalOverallHealingMitigated = (double)player.GetStatValue("PercentOfTotalOverallHealingMitigated"), PercentOfTotalOverallDamageTaken = (double)player.GetStatValue("PercentOfTotalOverallDamageTaken"), PercentOfTotalOverallDamageTakenOverTime = (double)player.GetStatValue("PercentOfTotalOverallDamageTakenOverTime") }; switch (type) { case "P": playerEntity.Type = PlayerType.Party; break; case "O": playerEntity.Type = PlayerType.Other; break; case "A": playerEntity.Type = PlayerType.Alliance; break; case "???": playerEntity.Type = PlayerType.Unknown; break; default: playerEntity.Type = PlayerType.You; break; } if (player.NPCEntry != null) { playerEntity.Job = player.NPCEntry.Job; } parseEntity.Players.Add(playerEntity); } catch (Exception ex) { Logging.Log(Logger, new LogItem(ex, true)); } } parseEntity.CombinedDPS = (double)this.Timeline.Overall.GetStatValue("CombinedDPS"); parseEntity.DPS = (double)this.Timeline.Overall.GetStatValue("DPS"); parseEntity.DOTPS = (double)this.Timeline.Overall.GetStatValue("DOTPS"); parseEntity.CombinedHPS = (double)this.Timeline.Overall.GetStatValue("CombinedHPS"); parseEntity.HPS = (double)this.Timeline.Overall.GetStatValue("HPS"); parseEntity.HOTPS = (double)this.Timeline.Overall.GetStatValue("HOTPS"); parseEntity.HOHPS = (double)this.Timeline.Overall.GetStatValue("HOHPS"); parseEntity.HMPS = (double)this.Timeline.Overall.GetStatValue("HMPS"); parseEntity.CombinedDTPS = (double)this.Timeline.Overall.GetStatValue("CombinedDTPS"); parseEntity.DTPS = (double)this.Timeline.Overall.GetStatValue("DTPS"); parseEntity.DTOTPS = (double)this.Timeline.Overall.GetStatValue("DTOTPS"); parseEntity.CombinedTotalOverallDamage = (double)this.Timeline.Overall.GetStatValue("CombinedTotalOverallDamage"); parseEntity.TotalOverallDamage = (double)this.Timeline.Overall.GetStatValue("TotalOverallDamage"); parseEntity.TotalOverallDamageOverTime = (double)this.Timeline.Overall.GetStatValue("TotalOverallDamageOverTime"); parseEntity.CombinedTotalOverallHealing = (double)this.Timeline.Overall.GetStatValue("CombinedTotalOverallHealing"); parseEntity.TotalOverallHealing = (double)this.Timeline.Overall.GetStatValue("TotalOverallHealing"); parseEntity.TotalOverallHealingOverTime = (double)this.Timeline.Overall.GetStatValue("TotalOverallHealingOverTime"); parseEntity.TotalOverallHealingOverHealing = (double)this.Timeline.Overall.GetStatValue("TotalOverallHealingOverHealing"); parseEntity.TotalOverallHealingMitigated = (double)this.Timeline.Overall.GetStatValue("TotalOverallHealingMitigated"); parseEntity.CombinedTotalOverallDamageTaken = (double)this.Timeline.Overall.GetStatValue("CombinedTotalOverallDamageTaken"); parseEntity.TotalOverallDamageTaken = (double)this.Timeline.Overall.GetStatValue("TotalOverallDamageTaken"); parseEntity.TotalOverallDamageTakenOverTime = (double)this.Timeline.Overall.GetStatValue("TotalOverallDamageTakenOverTime"); parseEntity.PercentOfTotalOverallDamage = (double)this.Timeline.Overall.GetStatValue("PercentOfTotalOverallDamage"); parseEntity.PercentOfTotalOverallDamageOverTime = (double)this.Timeline.Overall.GetStatValue("PercentOfTotalOverallDamageOverTime"); parseEntity.PercentOfTotalOverallHealing = (double)this.Timeline.Overall.GetStatValue("PercentOfTotalOverallHealing"); parseEntity.PercentOfTotalOverallHealingOverTime = (double)this.Timeline.Overall.GetStatValue("PercentOfTotalOverallHealingOverTime"); parseEntity.PercentOfTotalOverallHealingOverHealing = (double)this.Timeline.Overall.GetStatValue("PercentOfTotalOverallHealingOverHealing"); parseEntity.PercentOfTotalOverallHealingMitigated = (double)this.Timeline.Overall.GetStatValue("PercentOfTotalOverallHealingMitigated"); parseEntity.PercentOfTotalOverallDamageTaken = (double)this.Timeline.Overall.GetStatValue("PercentOfTotalOverallDamageTaken"); parseEntity.PercentOfTotalOverallDamageTakenOverTime = (double)this.Timeline.Overall.GetStatValue("PercentOfTotalOverallDamageTakenOverTime"); var notify = false; if (this.LastParseEntity == null) { this.LastParseEntity = parseEntity; notify = true; } else { var hash1 = JsonConvert.SerializeObject(this.LastParseEntity).GetHashCode(); var hash2 = JsonConvert.SerializeObject(parseEntity).GetHashCode(); if (!hash1.Equals(hash2)) { this.LastParseEntity = parseEntity; notify = true; } } if (notify) { if (Settings.Default.ShowDPSWidgetOnLoad) { EntityHelper.Parse.CleanAndCopy(parseEntity, EntityHelper.Parse.ParseType.DPS); } if (Settings.Default.ShowDTPSWidgetOnLoad) { EntityHelper.Parse.CleanAndCopy(parseEntity, EntityHelper.Parse.ParseType.DTPS); } if (Settings.Default.ShowHPSWidgetOnLoad) { EntityHelper.Parse.CleanAndCopy(parseEntity, EntityHelper.Parse.ParseType.HPS); } } } catch (Exception ex) { Logging.Log(Logger, new LogItem(ex, true)); } this.ParseEntityTimerProcessing = false; return(true); }; Task.Run(() => processor()); }
private void ParseEntityTimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs) { EndTime = DateTime.Now; if (ParseEntityTimerProcessing) { return; } ParseEntityTimerProcessing = true; Func<bool> parseEntityProcessor = delegate { try { var parseEntity = new ParseEntity { Players = new List<PlayerEntity>() }; foreach (Player player in Timeline.Party) { try { var type = Regex.Match(player.Name, @"\[(?<type>.+)\]", SharedRegEx.DefaultOptions) .Groups["type"].Value; var playerEntity = new PlayerEntity { Name = player.Name, Job = Actor.Job.Unknown, CombinedDPS = (decimal) player.GetStatValue("CombinedDPS"), DPS = (decimal) player.GetStatValue("DPS"), DOTPS = (decimal) player.GetStatValue("DOTPS"), CombinedHPS = (decimal) player.GetStatValue("CombinedHPS"), HPS = (decimal) player.GetStatValue("HPS"), HOTPS = (decimal) player.GetStatValue("HOTPS"), HOHPS = (decimal) player.GetStatValue("HOHPS"), HMPS = (decimal) player.GetStatValue("HMPS"), CombinedDTPS = (decimal) player.GetStatValue("CombinedDTPS"), DTPS = (decimal) player.GetStatValue("DTPS"), DTOTPS = (decimal) player.GetStatValue("DTOTPS"), CombinedTotalOverallDamage = (decimal) player.GetStatValue("CombinedTotalOverallDamage"), TotalOverallDamage = (decimal) player.GetStatValue("TotalOverallDamage"), TotalOverallDamageOverTime = (decimal) player.GetStatValue("TotalOverallDamageOverTime"), CombinedTotalOverallHealing = (decimal) player.GetStatValue("CombinedTotalOverallHealing"), TotalOverallHealing = (decimal) player.GetStatValue("TotalOverallHealing"), TotalOverallHealingOverTime = (decimal) player.GetStatValue("TotalOverallHealingOverTime"), TotalOverallHealingOverHealing = (decimal) player.GetStatValue("TotalOverallHealingOverHealing"), TotalOverallHealingMitigated = (decimal) player.GetStatValue("TotalOverallHealingMitigated"), CombinedTotalOverallDamageTaken = (decimal) player.GetStatValue("CombinedTotalOverallDamageTaken"), TotalOverallDamageTaken = (decimal) player.GetStatValue("TotalOverallDamageTaken"), TotalOverallDamageTakenOverTime = (decimal) player.GetStatValue("TotalOverallDamageTakenOverTime"), PercentOfTotalOverallDamage = (decimal) player.GetStatValue("PercentOfTotalOverallDamage"), PercentOfTotalOverallDamageOverTime = (decimal) player.GetStatValue("PercentOfTotalOverallDamageOverTime"), PercentOfTotalOverallHealing = (decimal) player.GetStatValue("PercentOfTotalOverallHealing"), PercentOfTotalOverallHealingOverTime = (decimal) player.GetStatValue("PercentOfTotalOverallHealingOverTime"), PercentOfTotalOverallHealingOverHealing = (decimal) player.GetStatValue("PercentOfTotalOverallHealingOverHealing"), PercentOfTotalOverallHealingMitigated = (decimal) player.GetStatValue("PercentOfTotalOverallHealingMitigated"), PercentOfTotalOverallDamageTaken = (decimal) player.GetStatValue("PercentOfTotalOverallDamageTaken"), PercentOfTotalOverallDamageTakenOverTime = (decimal) player.GetStatValue("PercentOfTotalOverallDamageTakenOverTime") }; switch (type) { case "P": playerEntity.Type = PlayerType.Party; break; case "O": playerEntity.Type = PlayerType.Other; break; case "A": playerEntity.Type = PlayerType.Alliance; break; case "???": playerEntity.Type = PlayerType.Unknown; break; default: playerEntity.Type = PlayerType.You; break; } if (player.NPCEntry != null) { playerEntity.Job = player.NPCEntry.Job; } parseEntity.Players.Add(playerEntity); } catch (Exception ex) { } } parseEntity.CombinedDPS = (decimal) Timeline.Overall.GetStatValue("CombinedDPS"); parseEntity.DPS = (decimal) Timeline.Overall.GetStatValue("DPS"); parseEntity.DOTPS = (decimal) Timeline.Overall.GetStatValue("DOTPS"); parseEntity.CombinedHPS = (decimal) Timeline.Overall.GetStatValue("CombinedHPS"); parseEntity.HPS = (decimal) Timeline.Overall.GetStatValue("HPS"); parseEntity.HOTPS = (decimal) Timeline.Overall.GetStatValue("HOTPS"); parseEntity.HOHPS = (decimal) Timeline.Overall.GetStatValue("HOHPS"); parseEntity.HMPS = (decimal) Timeline.Overall.GetStatValue("HMPS"); parseEntity.CombinedDTPS = (decimal) Timeline.Overall.GetStatValue("CombinedDTPS"); parseEntity.DTPS = (decimal) Timeline.Overall.GetStatValue("DTPS"); parseEntity.DTOTPS = (decimal) Timeline.Overall.GetStatValue("DTOTPS"); parseEntity.CombinedTotalOverallDamage = (decimal) Timeline.Overall.GetStatValue("CombinedTotalOverallDamage"); parseEntity.TotalOverallDamage = (decimal) Timeline.Overall.GetStatValue("TotalOverallDamage"); parseEntity.TotalOverallDamageOverTime = (decimal) Timeline.Overall.GetStatValue("TotalOverallDamageOverTime"); parseEntity.CombinedTotalOverallHealing = (decimal) Timeline.Overall.GetStatValue("CombinedTotalOverallHealing"); parseEntity.TotalOverallHealing = (decimal) Timeline.Overall.GetStatValue("TotalOverallHealing"); parseEntity.TotalOverallHealingOverTime = (decimal) Timeline.Overall.GetStatValue("TotalOverallHealingOverTime"); parseEntity.TotalOverallHealingOverHealing = (decimal) Timeline.Overall.GetStatValue("TotalOverallHealingOverHealing"); parseEntity.TotalOverallHealingMitigated = (decimal) Timeline.Overall.GetStatValue("TotalOverallHealingMitigated"); parseEntity.CombinedTotalOverallDamageTaken = (decimal) Timeline.Overall.GetStatValue("CombinedTotalOverallDamageTaken"); parseEntity.TotalOverallDamageTaken = (decimal) Timeline.Overall.GetStatValue("TotalOverallDamageTaken"); parseEntity.TotalOverallDamageTakenOverTime = (decimal) Timeline.Overall.GetStatValue("TotalOverallDamageTakenOverTime"); parseEntity.PercentOfTotalOverallDamage = (decimal) Timeline.Overall.GetStatValue("PercentOfTotalOverallDamage"); parseEntity.PercentOfTotalOverallDamageOverTime = (decimal) Timeline.Overall.GetStatValue("PercentOfTotalOverallDamageOverTime"); parseEntity.PercentOfTotalOverallHealing = (decimal) Timeline.Overall.GetStatValue("PercentOfTotalOverallHealing"); parseEntity.PercentOfTotalOverallHealingOverTime = (decimal) Timeline.Overall.GetStatValue("PercentOfTotalOverallHealingOverTime"); parseEntity.PercentOfTotalOverallHealingOverHealing = (decimal) Timeline.Overall.GetStatValue("PercentOfTotalOverallHealingOverHealing"); parseEntity.PercentOfTotalOverallHealingMitigated = (decimal) Timeline.Overall.GetStatValue("PercentOfTotalOverallHealingMitigated"); parseEntity.PercentOfTotalOverallDamageTaken = (decimal) Timeline.Overall.GetStatValue("PercentOfTotalOverallDamageTaken"); parseEntity.PercentOfTotalOverallDamageTakenOverTime = (decimal) Timeline.Overall.GetStatValue("PercentOfTotalOverallDamageTakenOverTime"); var notify = false; if (LastParseEntity == null) { LastParseEntity = parseEntity; notify = true; } else { var hash1 = JsonConvert.SerializeObject(LastParseEntity) .GetHashCode(); var hash2 = JsonConvert.SerializeObject(parseEntity) .GetHashCode(); if (!hash1.Equals(hash2)) { LastParseEntity = parseEntity; notify = true; } } if (notify) { if (Settings.Default.ShowDPSWidgetOnLoad) { EntityHelper.Parse.CleanAndCopy(parseEntity, EntityHelper.Parse.ParseType.DPS); } if (Settings.Default.ShowDTPSWidgetOnLoad) { EntityHelper.Parse.CleanAndCopy(parseEntity, EntityHelper.Parse.ParseType.DTPS); } if (Settings.Default.ShowHPSWidgetOnLoad) { EntityHelper.Parse.CleanAndCopy(parseEntity, EntityHelper.Parse.ParseType.HPS); } } } catch (Exception ex) { } ParseEntityTimerProcessing = false; return true; }; parseEntityProcessor.BeginInvoke(delegate { }, parseEntityProcessor); }
public static void CleanAndCopy(ParseEntity source, ParseType parseType) { try { var target = new ParseEntity { CombinedDPS = source.CombinedDPS, DPS = source.DPS, DOTPS = source.DOTPS, CombinedHPS = source.CombinedHPS, HPS = source.HPS, HOTPS = source.HOTPS, HOHPS = source.HOHPS, HMPS = source.HMPS, CombinedDTPS = source.CombinedDTPS, DTPS = source.DTPS, DTOTPS = source.DTOTPS, CombinedTotalOverallDamage = source.CombinedTotalOverallDamage, TotalOverallDamage = source.TotalOverallDamage, TotalOverallDamageOverTime = source.TotalOverallDamageOverTime, CombinedTotalOverallHealing = source.CombinedTotalOverallHealing, TotalOverallHealing = source.TotalOverallHealing, TotalOverallHealingOverTime = source.TotalOverallHealingOverTime, TotalOverallHealingOverHealing = source.TotalOverallHealingOverHealing, TotalOverallHealingMitigated = source.TotalOverallHealingMitigated, CombinedTotalOverallDamageTaken = source.CombinedTotalOverallDamageTaken, TotalOverallDamageTaken = source.TotalOverallDamageTaken, TotalOverallDamageTakenOverTime = source.TotalOverallDamageTakenOverTime, PercentOfTotalOverallDamage = source.PercentOfTotalOverallDamage, PercentOfTotalOverallDamageOverTime = source.PercentOfTotalOverallDamageOverTime, PercentOfTotalOverallHealing = source.PercentOfTotalOverallHealing, PercentOfTotalOverallHealingOverTime = source.PercentOfTotalOverallHealingOverTime, PercentOfTotalOverallHealingOverHealing = source.PercentOfTotalOverallHealingOverHealing, PercentOfTotalOverallHealingMitigated = source.PercentOfTotalOverallHealingMitigated, PercentOfTotalOverallDamageTaken = source.PercentOfTotalOverallDamageTaken, PercentOfTotalOverallDamageTakenOverTime = source.PercentOfTotalOverallDamageTakenOverTime, Players = new List<PlayerEntity>() }; foreach (var playerEntity in source.Players) { try { switch (parseType) { case ParseType.DPS: decimal dps; decimal.TryParse(Settings.Default.DPSVisibility, out dps); if (playerEntity.CombinedDPS <= dps) { continue; } break; case ParseType.DTPS: decimal dtps; decimal.TryParse(Settings.Default.DTPSVisibility, out dtps); if (playerEntity.CombinedDTPS <= dtps) { continue; } break; case ParseType.HPS: decimal hps; decimal.TryParse(Settings.Default.HPSVisibility, out hps); if (playerEntity.CombinedHPS <= hps) { continue; } break; } var entity = new PlayerEntity { Name = playerEntity.Name, Job = playerEntity.Job, CombinedDPS = playerEntity.CombinedDPS, DPS = playerEntity.DPS, DOTPS = playerEntity.DOTPS, CombinedHPS = playerEntity.CombinedHPS, HPS = playerEntity.HPS, HOTPS = playerEntity.HOTPS, HOHPS = playerEntity.HOHPS, HMPS = playerEntity.HMPS, CombinedDTPS = playerEntity.CombinedDTPS, DTPS = playerEntity.DTPS, DTOTPS = playerEntity.DTOTPS, CombinedTotalOverallDamage = playerEntity.CombinedTotalOverallDamage, TotalOverallDamage = playerEntity.TotalOverallDamage, TotalOverallDamageOverTime = playerEntity.TotalOverallDamageOverTime, CombinedTotalOverallHealing = playerEntity.CombinedTotalOverallHealing, TotalOverallHealing = playerEntity.TotalOverallHealing, TotalOverallHealingOverTime = playerEntity.TotalOverallHealingOverTime, TotalOverallHealingOverHealing = playerEntity.TotalOverallHealingOverHealing, TotalOverallHealingMitigated = playerEntity.TotalOverallHealingMitigated, CombinedTotalOverallDamageTaken = playerEntity.CombinedTotalOverallDamageTaken, TotalOverallDamageTaken = playerEntity.TotalOverallDamageTaken, TotalOverallDamageTakenOverTime = playerEntity.TotalOverallDamageTakenOverTime, PercentOfTotalOverallDamage = playerEntity.PercentOfTotalOverallDamage, PercentOfTotalOverallDamageOverTime = playerEntity.PercentOfTotalOverallDamageOverTime, PercentOfTotalOverallHealing = playerEntity.PercentOfTotalOverallHealing, PercentOfTotalOverallHealingOverTime = playerEntity.PercentOfTotalOverallHealingOverTime, PercentOfTotalOverallHealingOverHealing = playerEntity.PercentOfTotalOverallHealingOverHealing, PercentOfTotalOverallHealingMitigated = playerEntity.PercentOfTotalOverallHealingMitigated, PercentOfTotalOverallDamageTaken = playerEntity.PercentOfTotalOverallDamageTaken, PercentOfTotalOverallDamageTakenOverTime = playerEntity.PercentOfTotalOverallDamageTakenOverTime, Type = playerEntity.Type }; target.Players.Add(entity); } catch (Exception ex) { } } // sort entity based on settings switch (parseType) { case ParseType.DPS: if (target.Players.Any()) { switch (Settings.Default.DPSWidgetSortDirection) { case "Descending": switch (Settings.Default.DPSWidgetSortProperty) { case "Name": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.Name)); break; case "Job": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.Job)); break; case "DPS": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.DPS)); break; case "CombinedDPS": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.CombinedDPS)); break; case "TotalOverallDamage": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.TotalOverallDamage)); break; case "CombinedTotalOverallDamage": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.CombinedTotalOverallDamage)); break; case "PercentOfTotalOverallDamage": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.PercentOfTotalOverallDamage)); break; } break; default: switch (Settings.Default.DPSWidgetSortProperty) { case "Name": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.Name)); break; case "Job": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.Job)); break; case "DPS": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.DPS)); break; case "CombinedDPS": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.CombinedDPS)); break; case "TotalOverallDamage": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.TotalOverallDamage)); break; case "CombinedTotalOverallDamage": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.CombinedTotalOverallDamage)); break; case "PercentOfTotalOverallDamage": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.PercentOfTotalOverallDamage)); break; } break; } } DPSWidgetViewModel.Instance.ParseEntity = target; break; case ParseType.DTPS: if (target.Players.Any()) { switch (Settings.Default.DTPSWidgetSortDirection) { case "Descending": switch (Settings.Default.DTPSWidgetSortProperty) { case "Name": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.Name)); break; case "Job": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.Job)); break; case "DTPS": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.DTPS)); break; case "CombinedDTPS": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.CombinedDTPS)); break; case "TotalOverallDamageTaken": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.TotalOverallDamageTaken)); break; case "CombinedTotalOverallDamageTaken": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.CombinedTotalOverallDamageTaken)); break; case "PercentOfTotalOverallDamageTaken": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.PercentOfTotalOverallDamageTaken)); break; } break; default: switch (Settings.Default.DTPSWidgetSortProperty) { case "Name": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.Name)); break; case "Job": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.Job)); break; case "DTPS": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.DTPS)); break; case "CombinedDTPS": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.CombinedDTPS)); break; case "TotalOverallDamageTaken": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.TotalOverallDamageTaken)); break; case "CombinedTotalOverallDamageTaken": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.CombinedTotalOverallDamageTaken)); break; case "PercentOfTotalOverallDamageTaken": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.PercentOfTotalOverallDamageTaken)); break; } break; } } DTPSWidgetViewModel.Instance.ParseEntity = target; break; case ParseType.HPS: if (target.Players.Any()) { switch (Settings.Default.HPSWidgetSortDirection) { case "Descending": switch (Settings.Default.HPSWidgetSortProperty) { case "Name": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.Name)); break; case "Job": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.Job)); break; case "HPS": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.HPS)); break; case "CombinedHPS": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.CombinedHPS)); break; case "TotalOverallHealing": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.TotalOverallHealing)); break; case "CombinedTotalOverallHealing": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.CombinedTotalOverallHealing)); break; case "PercentOfTotalOverallHealing": target.Players = new List<PlayerEntity>(target.Players.OrderByDescending(p => p.PercentOfTotalOverallHealing)); break; } break; default: switch (Settings.Default.HPSWidgetSortProperty) { case "Name": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.Name)); break; case "Job": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.Job)); break; case "HPS": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.HPS)); break; case "CombinedHPS": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.CombinedHPS)); break; case "TotalOverallHealing": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.TotalOverallHealing)); break; case "CombinedTotalOverallHealing": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.CombinedTotalOverallHealing)); break; case "PercentOfTotalOverallHealing": target.Players = new List<PlayerEntity>(target.Players.OrderBy(p => p.PercentOfTotalOverallHealing)); break; } break; } } HPSWidgetViewModel.Instance.ParseEntity = target; break; } } catch (Exception ex) { } }