private void FireEvent(Action <object, WikiSiteEventArgs> eventToFire, string wikiPath, string oldWikiPath = "") { if (eventToFire != null && wikiPath.StartsWith(rootWikiPath)) { // calculate the urls string wikiUrl = PathHelper.GetWikiUrl(rootWikiPath, wikiPath); string oldWikiUrl = ""; if (!string.IsNullOrWhiteSpace(oldWikiPath) && oldWikiPath.StartsWith(rootWikiPath)) { oldWikiUrl = PathHelper.GetWikiUrl(rootWikiPath, oldWikiPath); } WikiSiteEventArgs args = new WikiSiteEventArgs( wikiUrl: wikiUrl, oldWikiUrl: oldWikiUrl); System.Console.WriteLine("{0} Firing event #{1} on thread: {2}", DateTime.Now.Ticks, args.Id, Thread.CurrentThread.Name); eventToFire(this, args); } }
private void HandleSiteUpdate(Action <object, WikiSiteEventArgs> eventToFire, WikiSiteEventArgs args) { if (eventToFire != null) { eventToFire(this, args); } }
private void FireEvent(Action<object, WikiSiteEventArgs> eventToFire, string wikiPath, string oldWikiPath = "") { if (eventToFire != null && wikiPath.StartsWith(rootWikiPath)) { // calculate the urls string wikiUrl = PathHelper.GetWikiUrl(rootWikiPath, wikiPath); string oldWikiUrl = ""; if (!string.IsNullOrWhiteSpace(oldWikiPath) && oldWikiPath.StartsWith(rootWikiPath)) { oldWikiUrl = PathHelper.GetWikiUrl(rootWikiPath, oldWikiPath); } WikiSiteEventArgs args = new WikiSiteEventArgs( wikiUrl: wikiUrl, oldWikiUrl: oldWikiUrl); System.Console.WriteLine("{0} Firing event #{1} on thread: {2}", DateTime.Now.Ticks, args.Id, Thread.CurrentThread.Name); eventToFire(this, args); } }
private void HandleSiteUpdate(Action<object, WikiSiteEventArgs> eventToFire, WikiSiteEventArgs args) { if (eventToFire != null) { eventToFire(this, args); } }