Esempio n. 1
0
 ActivityScope(Activity activity)
 {
     Instance         = activity;
     activityIdentity = ActivityIdProvider.GetNextId();
     listener         = new ActivityScopeListener();
     listener.ActivityStateChanged += HandleActivityStateChanged;
     activity.Application.RegisterActivityLifecycleCallbacks(listener);
 }
Esempio n. 2
0
 public void Dispose()
 {
     if (listener != null)
     {
         listener.ActivityStateChanged -= HandleActivityStateChanged;
         Instance.Application.UnregisterActivityLifecycleCallbacks(listener);
         listener = null;
     }
 }