protected override void Dispose(bool disposing) { if (disposing) { Switch.Dispose(); Switch = null; } }
/// <summary> /// Dispose the specified disposing. /// </summary> /// <returns>The dispose.</returns> /// <param name="disposing">If set to <c>true</c> disposing.</param> protected override void Dispose(bool disposing) { if (disposing) { _switch.ValueChanged -= _switch_ValueChanged; AccessoryView = null; _switch?.Dispose(); _switch = null; } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (disposing) { if (_switch != null) { _switch.Dispose(); _switch = null; } } }
new void Dispose() { //we have to un-register the event handlers because else the whole viewcontroller will be kept in the garbage collector. if (_meterTypeSegment != null) { _meterTypeSegment.ValueChanged -= HandleSegmentChange; } _meterTypeSegment?.Dispose(); _selectionLabel?.Dispose(); _toggleBarcodeLabel.RemoveFromSuperview(); _toggleBarcodeLabel?.Dispose(); _toggleBarcodeSwitch.ValueChanged -= OnValueChanged; _toggleBarcodeSwitch.RemoveFromSuperview(); _toggleBarcodeSwitch?.Dispose(); _toggleBarcodeView.RemoveFromSuperview(); _toggleBarcodeView?.Dispose(); _segmentItems = null; _alert?.Dispose(); _error?.Dispose(); //we have to erase the scan view so that there are no dependencies for the viewcontroller left. _anylineEnergyView?.RemoveFromSuperview(); _anylineEnergyView?.Dispose(); _anylineEnergyView = null; GC.Collect(GC.MaxGeneration); base.Dispose(); }
protected override void Dispose(bool disposing) { if (disposing) { if (schedule != null) { schedule.Dispose(); schedule = null; } if (OptionView != null) { this.OptionView.RemoveFromSuperview(); this.OptionView.Dispose(); this.OptionView = null; } if (buttonScheduleView != null) { buttonScheduleView.TouchUpInside -= ShowPicker1; buttonScheduleView.Dispose(); buttonScheduleView = null; } if (doneButton != null) { doneButton.TouchUpInside -= HidePicker; doneButton.Dispose(); doneButton = null; } if (rangeslider != null) { rangeslider.RangeValueChange -= Slider_RangeValueChange; rangeslider.Dispose(); rangeslider = null; } if (daySettings != null) { daySettings.Dispose(); daySettings = null; } if (labelBlackOutDays != null) { labelBlackOutDays.Dispose(); labelBlackOutDays = null; } if (labelScheduleView != null) { labelScheduleView.Dispose(); labelScheduleView = null; } if (labelShowNonAccess != null) { labelShowNonAccess.Dispose(); labelShowNonAccess = null; } if (labelWeekNumber != null) { labelWeekNumber.Dispose(); labelWeekNumber = null; } if (labelWorkingHours != null) { labelWorkingHours.Dispose(); labelWorkingHours = null; } if (monthSettings != null) { monthSettings.Dispose(); monthSettings = null; } if (pickerScheduleView != null) { pickerScheduleView.Dispose(); pickerScheduleView = null; } if (switchBlackOutDates != null) { switchBlackOutDates.Dispose(); switchBlackOutDates = null; } if (switchNonAccessbleBlock != null) { switchNonAccessbleBlock.Dispose(); switchNonAccessbleBlock = null; } if (switchWeekNumber != null) { switchWeekNumber.Dispose(); switchWeekNumber = null; } if (weekSettings != null) { weekSettings.Dispose(); weekSettings = null; } if (workWeekSettings != null) { workWeekSettings.Dispose(); workWeekSettings = null; } } base.Dispose(disposing); }