public Event(String key, String value, Hit hit) { Key = key; Value = value; Hit = hit; Timestamp = DateTime.Now; }
void hit_OnHitStarted(Hit sender, EventArgs e) { if (!Hits.Contains(sender)) { Hits.Add(sender); } if (NonRegisteredHits.Contains(sender)) { NonRegisteredHits.Remove(sender); } if (sender.EndDate != new DateTime(0001, 01, 01)) { sender.End(); } }
void hit_OnHitStarting(Hit sender, EventArgs e) { if (!NonRegisteredHits.Contains(sender)) { NonRegisteredHits.Add(sender); } if (Hits.Contains(sender)) { Hits.Remove(sender); } }
void hit_OnHitEnding(Hit sender, EventArgs e) { }
void hit_OnHitEnded(Hit sender, EventArgs e) { if (Hits.Contains(sender)) { Hits.Remove(sender); } if (NonRegisteredHits.Contains(sender)) { NonRegisteredHits.Remove(sender); } DeregisterHit(sender); }
public void RegisterHit(Hit hit) { hit.OnHitStarting += hit_OnHitStarting; hit.OnHitStarted += hit_OnHitStarted; hit.OnHitEnding += hit_OnHitEnding; hit.OnHitEnded += hit_OnHitEnded; }
public void DeregisterHit(Hit hit) { hit.OnHitStarting -= hit_OnHitStarting; hit.OnHitStarted -= hit_OnHitStarted; hit.OnHitEnding -= hit_OnHitEnding; hit.OnHitEnded -= hit_OnHitEnded; }
public static Hit GetHit(this PhoneApplicationPage page) { Hit hit; if (!hits.TryGetValue(page, out hit)) { hit = new Hit(page); hits[page] = hit; } return hit; }