Esempio n. 1
0
        /// <inheritdoc />
        public Task <ITag> ResolveTagAsync(TagIdentifier tagId)
        {
            ITag tag;

            _tags.TryGetValue(tagId, out tag);
            return(Task.FromResult(tag));
        }
Esempio n. 2
0
 /// <summary>
 /// Returns the tag identified or null if it is not found.
 /// </summary>
 /// <param name="server">The data server to search for the tag.</param>
 /// <param name="tagId">The tag identifier to look for.</param>
 /// <returns>The tag or null if it was not found.</returns>
 public static Task <ITag> ResolveTagAsync(this DataServer server, TagIdentifier tagId)
 {
     return(server.Sources[tagId.Source].ResolveTagAsync(tagId));
 }
Esempio n. 3
0
 /// <summary>
 /// Adds a field to the data table given a tag identifier and a server to search the tag in.
 /// </summary>
 /// <param name="table">The data to which to add a field.</param>
 /// <param name="server">The data server to search for the tag.</param>
 /// <param name="tagId">The tag to add as a field.</param>
 /// <returns>The added field.</returns>
 public static async Task <DataField> AddFieldAsync(this DataTable table, DataServer server, TagIdentifier tagId)
 {
     return(table.AddField(await server.ResolveTagAsync(tagId)));
 }