public void Initialize() { if (initialized) { return; } enable = false; initializedTime = (int)DateTime.Now.ToUnixTime(); incrementCount = 0; notifications = new Dictionary <long, NotificationInfo>(); // イベント登録. ApplicationEventHandler.OnQuitAsObservable() .Subscribe(_ => OnSuspend()) .AddTo(Disposable); ApplicationEventHandler.OnSuspendAsObservable() .Subscribe(_ => OnSuspend()) .AddTo(Disposable); ApplicationEventHandler.OnResumeAsObservable() .Subscribe(_ => OnResume()) .AddTo(Disposable); initialized = true; }
/// <summary> /// Called by EAC framework when User Control is loaded /// </summary> /// <param name="args"></param> /// <returns>Config data loaded from environment specific EAC Database is passed in args()</returns> public override bool ReLoad(object[] args) { #if TRACE_BASE Common.WriteToDebugWindow(string.Format("{0}:{1}()", CONTROL_NAME, System.Reflection.MethodInfo.GetCurrentMethod().Name)); #endif // We are called each time the EAC/TestWindowConsole loads a new app(usercontrol). Ensure // that we start clean. Common.Initialize(); // Initialize the ApplicationLevel event handler ApplicationEventHandler.Init(); try { // Save the passed in configuration data. ConfigData.RawXML = (string)args[0]; InitialLoad(); } catch (Exception ex) { #if TRACE_BASE Common.WriteToDebugWindow(string.Format("{0}:{1}()", CONTROL_NAME, System.Reflection.MethodInfo.GetCurrentMethod().Name)); #endif MessageBox.Show(ex.Message); } return(true); }
//----- property ----- //----- method ----- public void Initialize() { disposable = new LifetimeDisposable(); initializedTime = (int)DateTime.Now.ToUnixTime(); incrementCount = 0; notifications = new Dictionary <long, NotificationInfo>(); ApplicationEventHandler.OnQuitAsObservable().Subscribe(_ => OnSuspend()).AddTo(disposable.Disposable); ApplicationEventHandler.OnSuspendAsObservable().Subscribe(_ => OnSuspend()).AddTo(disposable.Disposable); ApplicationEventHandler.OnResumeAsObservable().Subscribe(_ => OnResume()).AddTo(disposable.Disposable); #if UNITY_ANDROID && !UNITY_EDITOR PlatformInitialize(); #elif UNITY_IOS && !UNITY_EDITOR PlatformInitialize(); #endif // 過去に登録した通知を削除. Clear(); }
/// <summary> /// Sends out a UDP broadcast containing an error code. /// </summary> /// <param name="errorCode"></param> /// <param name="port"></param> protected void BroadcastErrorEvent(byte[] errorCode) { ApplicationEventHandler.HandleErrorEvent(errorCode); }
/// <summary> /// Sends out a UDP broadcast containing the UID. /// </summary> /// <param name="uid">The UID that should be broadcast.</param> /// <param name="port">The UDP port to use.</param> protected void BroadcastUidEvent(byte[] uid) { ApplicationEventHandler.HandleUidEvent(uid); }