protected override void Dispose(bool disposing) { if (_disposed) { return; } _disposed = true; if (disposing) { _notification.Dispose(); } base.Dispose(disposing); }
protected virtual void UnregisterForKeyboardNotifications() { if (_keyboardShowObserver != null) { NSNotificationCenter.DefaultCenter.RemoveObserver(_keyboardShowObserver); _keyboardShowObserver.Dispose(); _keyboardShowObserver = null; } if (_keyboardHideObserver != null) { NSNotificationCenter.DefaultCenter.RemoveObserver(_keyboardHideObserver); _keyboardHideObserver.Dispose(); _keyboardHideObserver = null; } }
protected override void Dispose(bool disposing) { if (disposing) { if (didEnterBackgroundNotification != null) { didEnterBackgroundNotification.Dispose(); didEnterBackgroundNotification = null; } if (willEnterForegroundNotification != null) { willEnterForegroundNotification.Dispose(); willEnterForegroundNotification = null; } } }
protected override void OnDetached() { if (!IsEligibleToConsumeEffect) { return; } if (orientationDidChangeNotificationObserver != null) { NSNotificationCenter.DefaultCenter.RemoveObserver(orientationDidChangeNotificationObserver); orientationDidChangeNotificationObserver?.Dispose(); orientationDidChangeNotificationObserver = null; } Element.Margin = initialMargin; }
void UnregisterForKeyboardNotifications() { _isKeyboardShown = false; if (_keyboardShowObserver != null) { NSNotificationCenter.DefaultCenter.RemoveObserver(_keyboardShowObserver); _keyboardShowObserver.Dispose(); _keyboardShowObserver = null; } if (_keyboardHideObserver != null) { NSNotificationCenter.DefaultCenter.RemoveObserver(_keyboardHideObserver); _keyboardHideObserver.Dispose(); _keyboardHideObserver = null; } }
private static void DetachNotifications() { if (_didBecomeActiveObserver != null) { _didBecomeActiveObserver.Dispose(); } if (_didEnterBackgroundObserver != null) { _didEnterBackgroundObserver.Dispose(); } if (_willResignActiveObserver != null) { _willResignActiveObserver.Dispose(); } }
public override void ViewDidDisappear(bool animated) { if (TabBarController != null) { ((MainTabBarController)TabBarController).WillEnterForegroundAction -= WillEnterForeground; ((MainTabBarController)TabBarController).SameTabTapped -= SameTabTapped; } if (ShowKeyboardToken != null) { NSNotificationCenter.DefaultCenter.RemoveObservers(new[] { CloseKeyboardToken, ShowKeyboardToken, ForegroundToken }); ShowKeyboardToken.Dispose(); CloseKeyboardToken.Dispose(); ForegroundToken.Dispose(); } base.ViewDidDisappear(animated); }
public static bool PrepareFromIntune() { List <string> listaDatos = new List <string> (); try { // Recover configuration parameters from Intune IntuneMAMPolicyManager value = IntuneMAMPolicyManager.Instance; NSDictionary dictionary = value.DiagnosticInformation; NSString[] keys = new NSString[] { new NSString(Mobile.ID_DIC_INTUNE) }; NSDictionary paramsGroups = dictionary.GetDictionaryOfValuesFromKeys(keys); NSObject paramsGroup = paramsGroups.ElementAt(0).Value; var data = Mobile.configData; // Convert parameters to string and regenerate the certificate data.ftpDownload_User = paramsGroup.ValueForKey(new NSString(Mobile.ID_FTP_USER)).ToString(); data.ftpDownload_Pass = paramsGroup.ValueForKey(new NSString(Mobile.ID_FTP_PASS)).ToString(); data.ftpDownload_Host = paramsGroup.ValueForKey(new NSString(Mobile.ID_FTP_HOST)).ToString(); data.ftpDownload_Port = int.Parse(paramsGroup.ValueForKey(new NSString(Mobile.ID_FTP_PORT)).ToString()); data.ftpDownload_Path = paramsGroup.ValueForKey(new NSString(Mobile.ID_FTP_PATH)).ToString(); data.GenerateCert(paramsGroup.ValueForKey(new NSString(Mobile.ID_CERTIFICATE)).ToString()); data.HasIntune = true; Utils.Print("Intune parameters loaded.."); Utils.Print("FTP: " + data.ftpDownload_Host + ":" + data.ftpDownload_Port + " - " + data.ftpDownload_User + " [ " + data.ftpDownload_Pass + " ]"); Utils.Print("Certificate: " + data.certificate.FriendlyName + " [ " + data.certificate.NotAfter + " ]"); // Free memory paramsGroup.Dispose(); paramsGroups.Dispose(); dictionary.Dispose(); value.Dispose(); paramsGroup = null; paramsGroups = null; keys = null; dictionary = null; value = null; } catch (Exception e) { return(false); } return(true); }
public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); if (document != null) { document.Close(null); } // Unsibscribe from UIDocument.StateChangedNotification if (docStateChangeToken != null) { docStateChangeToken.Dispose(); } // Hide the toolbar so the list can't be edited. NavigationController.SetToolbarHidden(true, animated); }
protected override void Dispose(bool disposing) { if (didBecomeActiveObserver != null) { NSNotificationCenter.DefaultCenter.RemoveObserver(didBecomeActiveObserver); didBecomeActiveObserver.Dispose(); didBecomeActiveObserver = null; } if (readerDevice != null) { readerDevice.WeakDelegate = null; readerDevice.Disconnect(); readerDevice.Dispose(); readerDevice = null; } base.Dispose(disposing); }
private async Task <BluetoothDeviceInfo> DoPickSingleDeviceAsync() { EAAccessoryManager.SharedAccessoryManager.RegisterForLocalNotifications(); TaskCompletionSource <EAAccessory> tcs = new TaskCompletionSource <EAAccessory>(); connectionObserver = EAAccessoryManager.Notifications.ObserveDidConnect((s, e) => { tcs.SetResult(e.Selected); }); /*var observer2 = EAAccessoryManager.Notifications.ObserveDidDisconnect((s, e) => * { * // tcs.SetResult(e.Accessory); * });*/ try { await EAAccessoryManager.SharedAccessoryManager.ShowBluetoothAccessoryPickerAsync(null); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); EAAccessoryManager.SharedAccessoryManager.UnregisterForLocalNotifications(); return(null); } EAAccessory accessory = null; if (EAAccessoryManager.SharedAccessoryManager.ConnectedAccessories.GetLength(0) > 0) { accessory = EAAccessoryManager.SharedAccessoryManager.ConnectedAccessories[0]; } else { accessory = await tcs.Task; } EAAccessoryManager.SharedAccessoryManager.UnregisterForLocalNotifications(); connectionObserver.Dispose(); return(accessory); }
private void UnregisterForKeyboardNotifications() { if (_keyboardShowObserver != null) { _keyboardShowObserver.Dispose(); _keyboardShowObserver = null; } if (_keyboardHideObserver != null) { _keyboardHideObserver.Dispose(); _keyboardHideObserver = null; } if (_keyboardChangeObserver != null) { _keyboardChangeObserver.Dispose(); _keyboardChangeObserver = null; } }
public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); if (IsMovingFromParentViewController) { Input.ShouldReturn = null; Send.TouchUpInside -= SendOnTouchUpInside; _didAppearNotification.Dispose(); _didAppearNotification = null; _textFieldChangeNotification.Dispose(); _textFieldChangeNotification = null; _newCommentToken.Dispose(); _newCommentToken = null; } }
protected override void Dispose(bool disposing) { if (_playedToEndObserver != null) { NSNotificationCenter.DefaultCenter.RemoveObserver(_playedToEndObserver); _playedToEndObserver = null; } if (_rateObserver != null) { _rateObserver.Dispose(); _rateObserver = null; } RemoveStatusObserver(); _avPlayerViewController?.Player?.Pause(); _avPlayerViewController?.Player?.ReplaceCurrentItemWithPlayerItem(null); base.Dispose(disposing); }
public NavigationService([NotNull] UIWindow window, Func <UIWindow, UIViewController, UINavigationController> getOrCreateController = null, Func <UIWindow, UINavigationController> restoreNavigationController = null) { Should.NotBeNull(window, nameof(window)); _window = window; _getOrCreateController = getOrCreateController; _restoreNavigationController = restoreNavigationController; if (_window.RootViewController == null) { NSObject observer = null; observer = UIWindow.Notifications.ObserveDidBecomeVisible((sender, args) => { var uiWindow = _window; if (uiWindow != null) { InitializeNavigationController(RestoreNavigationController(uiWindow)); } observer.Dispose(); }); } UseAnimations = true; }
public override void ViewWillDisappear(bool animated) { if (observerExtraInfoLinkClicked != null) { observerExtraInfoLinkClicked.Dispose(); } if (observerCoordinateFormatLinkClicked != null) { observerCoordinateFormatLinkClicked.Dispose(); } if (observerActivated != null) { observerActivated.Dispose(); } if (tapGesture != null) { View.RemoveGestureRecognizer(tapGesture); } base.ViewWillDisappear(animated); }
public void NSObjectCreation_Cleanup() { obj.Dispose(); }
public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); _show.Dispose(); _hide.Dispose(); }
protected override void Dispose(bool disposing) { _notification.Dispose(); base.Dispose(disposing); }
public override void ViewWillUnload() { base.ViewWillUnload(); keyboardShownNotif.Dispose(); keyboardHiddenNotif.Dispose(); }
public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); StopSharing(); ResignActiveNotification?.Dispose(); ResignActiveNotification = null; }
protected override void StopScreenMetricsListeners() { observer?.Dispose(); observer = null; }
public void CallReturnKnownManagedWrapperCleanup() { // cleanup after us someObjectKnownManagedWrapper.Dispose(); someObjectKnownManagedWrapper = null; }
private static void TryRemoveNotificationSubscription(ref NSObject subscriptionToken) { subscriptionToken?.Dispose(); subscriptionToken = null; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); _showKbNotification.Dispose(); _hideKbNotification.Dispose(); }
protected override void Dispose(bool disposing) { observer.Dispose(); base.Dispose(disposing); }
protected override void ExecuteOnMainThread (Action action) { var obj = new NSObject (); obj.BeginInvokeOnMainThread (() => { action (); obj.Dispose (); }); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); contentSizeObserver.Dispose(); }
public void NativeNSObjectCreation_Cleanup() { native_nsobject.Dispose(); }
protected virtual void Dispose(NSObject obj, Type type) { obj.Dispose(); }
public void NativeNSObjectRetainReleaseCreation_Cleanup() { native_nsobject_retain_release.Dispose(); }