public override void OnRaiseEvent(IRaiseEventCallInfo info) { if (info.Request.EvCode == 0) { base.OnRaiseEvent(info); } else if (info.Request.EvCode == 1) { info.Defer(); } else if (info.Request.EvCode == 2) { info.Cancel(); } else if (info.Request.EvCode == 3) { info.Fail(); this.PluginHost.BroadcastErrorInfoEvent("We called fail method"); } else if (info.Request.EvCode == 4) { throw new Exception("Event 4 exception"); } else if (info.Request.EvCode == 5) { var request = new HttpRequest { Async = true, Callback = HttpCallbackWithException, Url = "http://photon.webscript.io/auth-demo/", }; this.PluginHost.HttpRequest(request); info.Defer(); } else if (info.Request.EvCode == 6) { var request = new HttpRequest { Async = false, Callback = HttpCallbackWithException, Url = "http://photon.webscript.io/auth-demo/", }; this.PluginHost.HttpRequest(request); info.Continue(); } else if (info.Request.EvCode == 7) { this.timer = this.PluginHost.CreateOneTimeTimer(this.TimerAction, 100); info.Defer(); } else if (info.Request.EvCode == 8) { this.timer = this.PluginHost.CreateTimer(this.TimerAction, 100, 100); info.Defer(); } }
public override void OnRaiseEvent(IRaiseEventCallInfo info) { if (info.Request.EvCode == 0) { base.OnRaiseEvent(info); } else if (info.Request.EvCode == 1) { #pragma warning disable CS0618 // Type or member is obsolete info.Defer(); #pragma warning restore CS0618 // Type or member is obsolete } else if (info.Request.EvCode == 2) { info.Cancel(); } else if (info.Request.EvCode == 3) { info.Fail(); this.PluginHost.BroadcastErrorInfoEvent("We called fail method"); } else if (info.Request.EvCode == 4) { throw new Exception("Event 4 exception"); } else if (info.Request.EvCode == 5) { var request = new HttpRequest { Async = true, Callback = HttpCallbackWithException, Url = "https://wt-e4c18d407aa73a40e4182aaf00a2a2eb-0.run.webtask.io/auth/auth-demo/", }; this.PluginHost.HttpRequest(request, info); } else if (info.Request.EvCode == 6) { var request = new HttpRequest { Async = false, Callback = HttpCallbackWithException, Url = "https://wt-e4c18d407aa73a40e4182aaf00a2a2eb-0.run.webtask.io/auth/auth-demo/", }; this.PluginHost.HttpRequest(request, info); } else if (info.Request.EvCode == 7) { this.timer = this.PluginHost.CreateOneTimeTimer(info, this.TimerAction, 100); } else if (info.Request.EvCode == 8) { this.timer = this.PluginHost.CreateTimer(this.TimerAction, 100, 100); } }
public override void OnRaiseEvent(IRaiseEventCallInfo info) { if (info.Request.EvCode == 0) { base.OnRaiseEvent(info); } else if (info.Request.EvCode == 1) { info.Defer(); } else if (info.Request.EvCode == 2) { info.Cancel(); } else if (info.Request.EvCode == 3) { info.Fail(); this.PluginHost.BroadcastErrorInfoEvent("We called fail method"); } else if (info.Request.EvCode == 4) { throw new Exception("Event 4 exception"); } else if (info.Request.EvCode == 5) { var request = new HttpRequest { Async = true, Callback = HttpCallbackWithException, Url = "http://photon.webscript.io/auth-demo/", }; this.PluginHost.HttpRequest(request); info.Defer(); } else if (info.Request.EvCode == 6) { var request = new HttpRequest { Async = false, Callback = HttpCallbackWithException, Url = "http://photon.webscript.io/auth-demo/", }; this.PluginHost.HttpRequest(request); info.Continue(); } else if (info.Request.EvCode == 7) { this.timer = this.PluginHost.CreateOneTimeTimer(this.TimerAction, 100); info.Defer(); } else if (info.Request.EvCode == 8) { this.timer = this.PluginHost.CreateTimer(this.TimerAction, 100, 100); info.Defer(); } }