コード例 #1
0
ファイル: TagDefinition.cs プロジェクト: lulzzz/aika
        /// <summary>
        /// Gets the state set object for the tag.
        /// </summary>
        /// <param name="identity">The identity of the calling user.</param>
        /// <param name="cancellationToken">The cancellation token for the request.</param>
        /// <returns>
        /// A task that will return the state set object.
        /// </returns>
        private async Task <StateSet> GetStateSet(ClaimsPrincipal identity, CancellationToken cancellationToken)
        {
            _historian.ThrowIfDisposed();
            if (DataType != TagDataType.State)
            {
                return(null);
            }

            if (String.IsNullOrWhiteSpace(StateSet))
            {
                throw new InvalidOperationException(Resources.Error_StateSetNameIsRequired);
            }

            return(await Historian.GetStateSet(identity, StateSet, cancellationToken).ConfigureAwait(false));
        }