Show / Hide Table of Contents

    Class SpatialCoordinateServiceBase<TKey>

    Helper base class for ISpatialCoordinateService implementations.

    Inheritance
    Object
    DisposableBase
    SpatialCoordinateServiceBase<TKey>
    SpatialCoordinateServiceUnityBase<TKey>
    Implements
    ISpatialCoordinateService
    IDisposable
    Inherited Members
    DisposableBase.IsDisposed
    DisposableBase.ObjectName
    DisposableBase.Dispose()
    DisposableBase.OnUnmanagedDispose()
    DisposableBase.ThrowIfDisposed()
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.MixedReality.SpatialAlignment
    Assembly: cs.temp.dll.dll
    Syntax
    public abstract class SpatialCoordinateServiceBase<TKey> : DisposableBase, ISpatialCoordinateService, IDisposable
    Type Parameters
    Name Description
    TKey

    They key for the ISpatialCoordinate.

    Fields

    disposedCTS

    Declaration
    protected readonly CancellationTokenSource disposedCTS
    Field Value
    Type Description
    CancellationTokenSource

    knownCoordinates

    Declaration
    protected readonly ConcurrentDictionary<TKey, ISpatialCoordinate> knownCoordinates
    Field Value
    Type Description
    ConcurrentDictionary<TKey, ISpatialCoordinate>

    Properties

    IsTracking

    Gets or sets whether this coordinate service should be discovering/tracking coordinates.

    Declaration
    public bool IsTracking { get; }
    Property Value
    Type Description
    Boolean

    KnownCoordinates

    Gets a set of all known coordinates to this service.

    Declaration
    public IEnumerable<ISpatialCoordinate> KnownCoordinates { get; }
    Property Value
    Type Description
    IEnumerable<ISpatialCoordinate>

    SupportsDiscovery

    Declaration
    protected virtual bool SupportsDiscovery { get; }
    Property Value
    Type Description
    Boolean

    Methods

    OnDiscoverCoordinatesAsync(CancellationToken, TKey[])

    Implement this method for the logic begin and end tracking (when CancellationToken is cancelled).

    Declaration
    protected abstract Task OnDiscoverCoordinatesAsync(CancellationToken cancellationToken, TKey[] idsToLocate = null)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    TKey[] idsToLocate
    Returns
    Type Description
    Task

    OnManagedDispose()

    Declaration
    protected override void OnManagedDispose()
    Overrides
    DisposableBase.OnManagedDispose()

    OnNewCoordinate(TKey, ISpatialCoordinate)

    Adds a coordinate to be tracked by this service.

    Declaration
    protected void OnNewCoordinate(TKey id, ISpatialCoordinate spatialCoordinate)
    Parameters
    Type Name Description
    TKey id
    ISpatialCoordinate spatialCoordinate

    OnRemoveCoordinate(TKey)

    Removes a tracked coordinate from this service.

    Declaration
    protected void OnRemoveCoordinate(TKey id)
    Parameters
    Type Name Description
    TKey id

    The ide of the coordinate to remove.

    Remarks

    Will throw if coordinate was not tracked by this service, checking is possible throuhg knownCoordinates field.

    TryCreateCoordinateAsync(Vector3, Quaternion, CancellationToken)

    Attempts to create a new coordinate with this service.

    Declaration
    public virtual Task<ISpatialCoordinate> TryCreateCoordinateAsync(Vector3 worldPosition, Quaternion worldRotation, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Vector3 worldPosition
    Quaternion worldRotation
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<ISpatialCoordinate>

    The coordinate if the coordinate was succesfully created, otherwise null.

    TryDeleteCoordinateAsync(TKey, CancellationToken)

    Declaration
    public virtual Task<bool> TryDeleteCoordinateAsync(TKey key, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    TKey key
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Boolean>

    TryDiscoverCoordinatesAsync(CancellationToken, TKey[])

    Declaration
    public Task<bool> TryDiscoverCoordinatesAsync(CancellationToken cancellationToken, params TKey[] ids)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    TKey[] ids
    Returns
    Type Description
    Task<Boolean>

    TryGetKnownCoordinate(TKey, out ISpatialCoordinate)

    Declaration
    public bool TryGetKnownCoordinate(TKey id, out ISpatialCoordinate spatialCoordinate)
    Parameters
    Type Name Description
    TKey id
    ISpatialCoordinate spatialCoordinate
    Returns
    Type Description
    Boolean

    TryParse(String, out TKey)

    Declaration
    protected abstract bool TryParse(string id, out TKey result)
    Parameters
    Type Name Description
    String id
    TKey result
    Returns
    Type Description
    Boolean

    Events

    CoordinatedDiscovered

    Triggered when a new coordinate is discovered or created with this service.

    Declaration
    public event Action<ISpatialCoordinate> CoordinatedDiscovered
    Event Type
    Type Description
    Action<ISpatialCoordinate>
    Remarks

    It may not be in the IsLocated state if created locally.

    CoordinateRemoved

    Triggered when a new coordinate is removed from this service.

    Declaration
    public event Action<ISpatialCoordinate> CoordinateRemoved
    Event Type
    Type Description
    Action<ISpatialCoordinate>

    Explicit Interface Implementations

    ISpatialCoordinateService.TryDeleteCoordinateAsync(String, CancellationToken)

    Attempts to asynchronously delete a coordinate with this space given an Id.

    Declaration
    Task<bool> ISpatialCoordinateService.TryDeleteCoordinateAsync(string id, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    String id

    The id representing the coordinate.

    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Boolean>

    True if the coordinate was succesfully deleted.

    ISpatialCoordinateService.TryDiscoverCoordinatesAsync(CancellationToken, String[])

    Begins search for coordinates, optionally priortizing a set of ids.

    Declaration
    Task<bool> ISpatialCoordinateService.TryDiscoverCoordinatesAsync(CancellationToken cancellationToken, string[] idsToLocate)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    The CancellationToken to be used for cancellation (stopping) of the discovery task.

    String[] idsToLocate
    Returns
    Type Description
    Task<Boolean>

    The set of coordinates discovered during this session.

    ISpatialCoordinateService.TryGetKnownCoordinate(String, out ISpatialCoordinate)

    Declaration
    bool ISpatialCoordinateService.TryGetKnownCoordinate(string id, out ISpatialCoordinate spatialCoordinate)
    Parameters
    Type Name Description
    String id
    ISpatialCoordinate spatialCoordinate
    Returns
    Type Description
    Boolean

    Implements

    ISpatialCoordinateService
    System.IDisposable
    Back to top Generated by DocFX