示例#1
0
 internal static void OnChanged(GyroscopeChangedEventArgs e)
 {
     if (useSyncContext)
     {
         MainThread.BeginInvokeOnMainThread(() => ReadingChanged?.Invoke(null, e));
     }
     else
     {
         ReadingChanged?.Invoke(null, e);
     }
 }
示例#2
0
        internal static void OnChanged(GyroscopeChangedEventArgs e)
        {
            if (ReadingChanged == null)
            {
                return;
            }

            if (UseSyncContext)
            {
                Platform.BeginInvokeOnMainThread(() => ReadingChanged?.Invoke(e));
            }
            else
            {
                ReadingChanged?.Invoke(e);
            }
        }
        internal static void OnChanged(GyroscopeChangedEventArgs e)
        {
            var handler = ReadingChanged;

            if (handler == null)
            {
                return;
            }

            if (useSyncContext)
            {
                MainThread.BeginInvokeOnMainThread(() => handler?.Invoke(e));
            }
            else
            {
                handler?.Invoke(e);
            }
        }