private void TextViewDidEndEditingEventHandler(object sender, NSNotificationEventArgs e) { if (ActiveTextView == e.Notification.Object) { _activeTextView = null; } }
internal void OnFinishedPlaying(object sender, NSNotificationEventArgs args) { if (DonePlaying != null) { DonePlaying(sender, args); } }
private void playBackIsPreparedToPlayHandler(object sender, NSNotificationEventArgs args) { Logger.Log("UIChaptersEnabledVideoView.playBackIsPreparedToPlayHandler:" + "PlaybackState = '" + moviePlayer.MoviePlayer.PlaybackState + "', LoadState='" + moviePlayer.MoviePlayer.LoadState + "'"); moviePlayer.MoviePlayer.Play(); }
private void OnLoadStateChanged(object sender, NSNotificationEventArgs e) { if (moviePlayer.LoadState == MPMovieLoadState.Playable) { } }
private void OnDidPlayToEndTime(object sender, NSNotificationEventArgs e) { player.Dispose(); player = null; Status = Status.Recorded; }
void OnClose(object sender, NSNotificationEventArgs e) { _btnResultsClipboardObserver?.Dispose(); _btnResultsNotificationCenterObserver?.Dispose(); BindGlobalShortcuts(); }
private void RotationDidChanged(object sender, NSNotificationEventArgs nsNotificationEventArgs) { var orientation = UIDevice.CurrentDevice.Orientation; if (orientation.IsFlat()) { return; } var directional = orientation.IsPortrait() ? UICollectionViewScrollDirection.Horizontal : UICollectionViewScrollDirection.Vertical; _flowLayout.ScrollDirection = directional; if (_selectedIndex == 0) { return; } var indexPath = NSIndexPath.FromItemSection(_selectedIndex, 0); var scrollPosition = orientation.IsPortrait() ? UICollectionViewScrollPosition.CenteredHorizontally : UICollectionViewScrollPosition.CenteredVertically; CollectionView.ScrollToItem(indexPath, scrollPosition, false); }
private async void StopPreview(object o = null, NSNotificationEventArgs args = null) { await Task.Run(() => { _captureSession.StopRunning(); }); }
private void FullInit(object o = null, NSNotificationEventArgs args = null) { SetupCamera(true); StartPreview(); NativeView.Add(_liveCameraStream); NativeView.ClipsToBounds = true; }
protected void OnOrientationChanged(object sender, NSNotificationEventArgs args) { var rotaion = DeviceRotation; switch (UIDevice.CurrentDevice.Orientation) { case UIDeviceOrientation.Portrait: DeviceRotation = DeviceRotation.Portrait; break; case UIDeviceOrientation.LandscapeRight: DeviceRotation = DeviceRotation.Landscape; break; case UIDeviceOrientation.PortraitUpsideDown: DeviceRotation = DeviceRotation.ReversePortrait; break; case UIDeviceOrientation.LandscapeLeft: DeviceRotation = DeviceRotation.ReverseLandscape; break; } if (rotaion != DeviceRotation) { OrientationChanged?.Invoke(this, DeviceRotation); } }
private void PlayToEndNotificationHandler(object sender, NSNotificationEventArgs args) { IsPlaying = false; seekToZeroBeforePlaying = true; UpdatePlayPauseButton(); }
void onOrientationChanged(object sender, NSNotificationEventArgs e) { if (cameraIsObservingDeviceOrientation) { Debug.WriteLine("~~ onOrientationChanged ~~"); _orientationChanged(); } }
private void ApplicationDidBecomeActive(object sender, NSNotificationEventArgs args) { // Start if _flyover is available if (_flyover != null) { Start(_flyover); } }
private static void _defaultMoviePlayerNotificationHandler(object sender, NSNotificationEventArgs e) { if (_playerVC.moviePlayer.loadState == MPMovieLoadState.Playable) { Debug.Log("PLAY MOVIE"); _playerVC.moviePlayer.Play(); } }
void HandleQueryFileListReceived(object sender, NSNotificationEventArgs e) { try { ReadQueryResults(); } catch (Exception ex) { Log.Error(ex); } }
void OnEditingChanged(object sender, NSNotificationEventArgs e) { if (isKeyboardPresent) { activeTextInputView = (UIView)e.Notification.Object; OnKeyboardShow(null, null); } }
private void OnBatteryNotification(object sender, NSNotificationEventArgs args) { CoreDispatcher.Current.Run( () => { this.BatteryStatusChanged?.Invoke(this, this.BatteryStatus); this.RemainingChargePercentChanged?.Invoke(this, this.RemainingChargePercent); }); }
private void didEnterBackgroundHandler(object sender, NSNotificationEventArgs args) { Logger.Log("UIChaptersEnabledVideoView.didEnterBackgroundHandler"); if (!moviePlayer.MoviePlayer.AirPlayVideoActive) { moviePlayer.MoviePlayer.Pause(); } }
private void willEnterForegroundHandler(object sender, NSNotificationEventArgs args) { Logger.Log("UIChaptersEnabledVideoView.willEnterForegroundHandler"); if (moviePlayer.MoviePlayer.PlaybackState != MPMoviePlaybackState.Playing) { moviePlayer.MoviePlayer.Play(); } }
protected void OnWindowWillCloseNotification(object sender, NSNotificationEventArgs e) { var window = e.Notification.Object as NSWindow; if (Windows.Contains(window)) { Windows.Remove(window); } }
internal void HandleTextChange(NSNotificationEventArgs args) { var field = args.Notification.Object as UITextView; if (field == TextInputView) { UpdateTextViewHeight(); SendButton.Enabled = TextInputView.HasText; } }
void DidPlayToEndTime(object sender, NSNotificationEventArgs args) { if (args.Notification.Object != Player.CurrentItem) { return; } // Update play pause button. PlayPauseButton.SetImage(UIImage.FromBundle("PlayButton"), UIControlState.Normal); }
private static void _OnStoreChanged(object sender, NSNotificationEventArgs e) { if (_valuesChangedHandlers != null) { var reason = (NSUbiquitousKeyValueStoreChangeReasonValues)Enum.ToObject( typeof(NSUbiquitousKeyValueStoreChangeReasonValues), Convert.ToInt32(e.userInfo[NSUbiquitousKeyValueStore.ChangeReasonKey])); object[] keys = e.userInfo[NSUbiquitousKeyValueStore.ChangedKeysKey] as object[]; iCloudPrefsChange[] changes = new iCloudPrefsChange[keys.Length]; for (int i = 0; i < keys.Length; i++) { string key = keys[i] as string; // get old value object oldValue = _userDefaults.Object(USER_DEFAULTS_PREFIX + key); if ((oldValue is int) || (oldValue is long)) { oldValue = Convert.ToInt32(oldValue); } else if ((oldValue is double) || (oldValue is float)) { oldValue = (float)Convert.ToDouble(oldValue); } // clean new value, and set it in cache object newValue = store.Object(key); if (newValue == null) { _userDefaults.RemoveObject(USER_DEFAULTS_PREFIX + key); } else if (newValue is string) { _userDefaults.SetObject(newValue, USER_DEFAULTS_PREFIX + key); } else if ((newValue is int) || (newValue is long)) { // in case of long, convert it to int first newValue = Convert.ToInt32(newValue); _userDefaults.SetInteger((int)newValue, USER_DEFAULTS_PREFIX + key); } else if ((newValue is double) || (newValue is float)) { // in case of double, convert it to float first newValue = (float)Convert.ToDouble(newValue); _userDefaults.SetDouble((float)newValue, USER_DEFAULTS_PREFIX + key); } changes[i] = new iCloudPrefsChange(key, newValue, oldValue); } _valuesChangedHandlers(null, new iCloudPrefsChangedEventArgs(reason, changes)); } }
private void OnMediaEnded(object sender, NSNotificationEventArgs args) { MediaEnded?.Invoke(this, null); if (Source is MediaPlaybackList && (AVPlayerItem)args.Notification.Object != _player.Items.Last()) { return; } PlaybackSession.PlaybackState = MediaPlaybackState.None; }
////////////////// ////////////////// END OF WORKAROUND ////////////////// /// /// <summary> /// Tokens the refresh notification. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> void TokenRefreshNotification(object sender, NSNotificationEventArgs e) { // This method will be fired everytime a new token is generated, including the first // time. So if you need to retrieve the token as soon as it is available this is where that // should be done. //var refreshedToken = InstanceId.SharedInstance.Token; ConnectToFCM(_window.RootViewController); // TODO: If necessary send token to application server. }
/// <summary> /// Battery changed notification triggered, bubble up. /// </summary> void BatteryChangedNotification(object sender, NSNotificationEventArgs args) { Helpers.EnsureInvokedOnMainThread(() => { OnBatteryChanged(new BatteryChangedEventArgs { RemainingChargePercent = RemainingChargePercent, IsLow = RemainingChargePercent <= 15, Status = Status, PowerSource = PowerSource }); }); }
/// <summary> /// Battery changed notification triggered, bubble up. /// </summary> void BatteryChangedNotification(object sender, NSNotificationEventArgs args) { Helpers.EnsureInvokedOnMainThread(() => { OnBatteryChanged(new BatteryChangedEventArgs { RemainingChargePercent = RemainingChargePercent, IsLow = RemainingChargePercent <= 15, Status = Status, PowerSource = PowerSource }); }); }
/// <summary> /// UIApplicationWillResignActive notification handler /// </summary> private void ApplicationWillResignActive(object sender, NSNotificationEventArgs args) { if (State != FlyoverCameraState.Stopped) { // Stop flyover as application is no longer active Stop(); } else { // Clear flyover to prevent start on DidBecomeActive _flyover = null; } }
public void ApplicationWillEnterForeGround(object sender, NSNotificationEventArgs e) { switch (OnForegroundAction) { case HidingNavigationForegroundAction.Show: _navBarController.Expand(); _tabBarController?.Expand(); break; case HidingNavigationForegroundAction.Hide: _navBarController.Contract(); _tabBarController?.Contract(); break; } }
private void DidBeginEditing(object sender, NSNotificationEventArgs e) { if (ScrollView != null) { var view = e.Notification.Object as UIView; var parent = view.Superview; while (parent != null) { if (parent.Handle == ScrollView.Handle) { ActiveView = view; } parent = parent.Superview; } } }
void GameControllerDidConnect(object sender, NSNotificationEventArgs e) { var controller = (GCController)e.Notification.Object; Console.WriteLine("Connected game controller: {0}", controller); var playerIndex = controller.PlayerIndex; if (playerIndex == GCController.PlayerIndexUnset) { AssignUnknownController(controller); } else { AssignPresetController(controller, playerIndex); } }
void GameControllerDidDisconnect(object sender, NSNotificationEventArgs e) { var controller = (GCController)e.Notification.Object; foreach (Player player in players) { if (player == null) { continue; } if (player.Controller == controller) { player.Controller = null; } } Console.WriteLine("Disconnected game controller: {0}", controller); }
static void CloudAccountAvailabilityChanged (object sender, NSNotificationEventArgs e) { Console.WriteLine ("UbiquityIdentityDidChange: {0}", CloudAvailable); }
void HandleQueryFileListReceived (object sender, NSNotificationEventArgs e) { try { ReadQueryResults (); } catch (Exception ex) { Log.Error (ex); } }
void DidPlayToEndTime (object sender, NSNotificationEventArgs args) { if (args.Notification.Object != Player.CurrentItem) return; // Update play pause button. PlayPauseButton.SetImage (UIImage.FromBundle ("PlayButton"), UIControlState.Normal); }
private static void _defaultMoviePlayerNotificationHandler(object sender, NSNotificationEventArgs e) { if (_playerVC.moviePlayer.loadState == MPMovieLoadState.Playable) { Debug.Log("PLAY MOVIE"); _playerVC.moviePlayer.Play(); } }
private static void _defaultMoviePlayerFinishHandler(object sender, NSNotificationEventArgs e) { CloseMoviePlayer(); }
void MenuWillHide (object sender, NSNotificationEventArgs e) { var selected = tableView.IndexPathForSelectedRow; tableView.DeselectRow (selected, false); }
void OnDidPlayToEndTime (object sender, NSNotificationEventArgs e) { player.Dispose (); player = null; }
private static void _OnStoreChanged(object sender, NSNotificationEventArgs e) { if (_valuesChangedHandlers != null) { var reason = (NSUbiquitousKeyValueStoreChangeReasonValues)Enum.ToObject( typeof(NSUbiquitousKeyValueStoreChangeReasonValues), Convert.ToInt32(e.userInfo[NSUbiquitousKeyValueStore.ChangeReasonKey])); object[] keys = e.userInfo[NSUbiquitousKeyValueStore.ChangedKeysKey] as object[]; iCloudPrefsChange[] changes = new iCloudPrefsChange[keys.Length]; for (int i=0; i<keys.Length; i++) { string key = keys[i] as string; // get old value object oldValue = _userDefaults.Object(USER_DEFAULTS_PREFIX + key); if ((oldValue is int) || (oldValue is long)) { oldValue = Convert.ToInt32(oldValue); } else if ((oldValue is double) || (oldValue is float)) { oldValue = (float)Convert.ToDouble(oldValue); } // clean new value, and set it in cache object newValue = store.Object(key); if (newValue == null) { _userDefaults.RemoveObject(USER_DEFAULTS_PREFIX + key); } else if (newValue is string) { _userDefaults.SetObject(newValue, USER_DEFAULTS_PREFIX + key); } else if ((newValue is int) || (newValue is long)) { // in case of long, convert it to int first newValue = Convert.ToInt32(newValue); _userDefaults.SetInteger((int)newValue, USER_DEFAULTS_PREFIX + key); } else if ((newValue is double) || (newValue is float)) { // in case of double, convert it to float first newValue = (float)Convert.ToDouble(newValue); _userDefaults.SetDouble((float)newValue, USER_DEFAULTS_PREFIX + key); } changes[i] = new iCloudPrefsChange(key, newValue, oldValue); } _valuesChangedHandlers(null, new iCloudPrefsChangedEventArgs(reason, changes)); } }
private void OnOrientationChanged(object sender, NSNotificationEventArgs args) { CommonInit(); }
void DidEnterBackground (object sender, NSNotificationEventArgs notification) { Paused = true; }
private void _OnOrientationChanged(object sender, NSNotificationEventArgs e) { if (isPlaying) { DeviceOrientation newOrientation = Input.deviceOrientation; if (newOrientation == _oldOrientation) return; // check whether to reinit draw data now or later switch (newOrientation) { case DeviceOrientation.Portrait: case DeviceOrientation.PortraitUpsideDown: if ((_oldOrientation == DeviceOrientation.LandscapeLeft) || (_oldOrientation == DeviceOrientation.LandscapeRight)) _needScreenChecking = true; else _InitDrawData(); break; case DeviceOrientation.LandscapeRight: case DeviceOrientation.LandscapeLeft: if ((_oldOrientation == DeviceOrientation.Portrait) || (_oldOrientation == DeviceOrientation.PortraitUpsideDown)) _needScreenChecking = true; else _InitDrawData(); break; default: break; } } }
void WillEnterForeground (object sender, NSNotificationEventArgs notification) { Paused = false; }
void GameControllerDidDisconnect(object sender, NSNotificationEventArgs e) { var controller = (GCController)e.Notification.Object; foreach (Player player in players) { if (player == null) continue; if (player.Controller == controller) player.Controller = null; } Console.WriteLine ("Disconnected game controller: {0}", controller); }
void GameControllerDidConnect(object sender, NSNotificationEventArgs e) { var controller = (GCController)e.Notification.Object; Console.WriteLine ("Connected game controller: {0}", controller); var playerIndex = controller.PlayerIndex; if (playerIndex == GCController.PlayerIndexUnset) AssignUnknownController (controller); else AssignPresetController (controller, playerIndex); }
private void PlayToEndNotificationHandler (object sender, NSNotificationEventArgs args) { IsPlaying = false; seekToZeroBeforePlaying = true; UpdatePlayPauseButton (); }
private static void _defaultMoviePlayerExitFullscreen(object sender, NSNotificationEventArgs e) { _playerVC.moviePlayer.Stop(); }
internal void OnFinishedPlaying (object sender, NSNotificationEventArgs args) { if (DonePlaying != null) DonePlaying(sender, args); }