< Summary

Information
Class: MyNet.Observable.Behaviors.SuspendableBehavior<T>
Assembly: MyNet.Observable
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Observable/Behaviors/SuspendableBehavior.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 29
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_IsSuspended()100%11100%
Suspend()50%22100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Observable/Behaviors/SuspendableBehavior.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="SuspendableBehavior.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using System.Reactive.Disposables;
 9using MyNet.Utilities.Suspending;
 10
 11namespace MyNet.Observable.Behaviors;
 12
 44413public abstract class SuspendableBehavior<T>(T owner) : ObservableBehavior<T>(owner), ISuspendable
 14where T : IObservableObject
 15{
 44416    private readonly Suspender _suspender = new();
 17
 18    /// <summary>
 19    /// Gets a value indicating whether property changed notifications for culture changes are currently suspended. This
 20    /// </summary>
 168321    public bool IsSuspended => _suspender.IsSuspended;
 22
 23    /// <summary>
 24    /// Suspends this behavior until the returned scope is disposed. While suspended, the behavior does not react to pro
 25    /// </summary>
 26    /// <returns>A disposable suspension scope.</returns>
 327    public IDisposable Suspend() => IsDisposed ? Disposable.Empty : _suspender.Suspend();
 28}
 29

Methods/Properties

.ctor(T)
get_IsSuspended()
Suspend()