예제 #1
0
        /// <summary>
        /// Get the value of an attribute
        /// </summary>
        /// <param name="endpoint">The endpoint to retrieve the attribute from</param>
        /// <param name="attribute">The attribute to read</param>
        /// <returns>The value of the attribute, converted to T</returns>
        public async Task <T> GetAttributeValueAsync <T>(Endpoint endpoint, Enums.CommonAttributeNames attribute)
        {
            string attributeName = Enum.GetName(typeof(Enums.CommonAttributeNames), attribute);

            return(await GetAttributeValueAsync <T>(endpoint, attributeName));
        }
예제 #2
0
        /// <summary>
        /// Get the value of an attribute
        /// </summary>
        /// <param name="endpoint">The endpoint to retrieve the attribute from</param>
        /// <param name="attribute">The attribute to read</param>
        /// <returns>The value of the attribute, converted to T</returns>
        public async Task <T> GetAttributeValueAsync <T>(string endpointName, Enums.CommonAttributeNames attribute)
        {
            Endpoint endpoint = await GetEndpointAsync(endpointName);

            return(await GetAttributeValueAsync <T>(endpoint, attribute));
        }
예제 #3
0
        /// <summary>
        /// Finds an attribute with a given name on an endpoint
        /// </summary>
        /// <param name="endpoint">Endpoint instance</param>
        /// <param name="attributeName">Attribute name</param>
        /// <returns>Attribute instance</returns>
        private async Task <Model.Attribute> GetAttributeAsync(Endpoint endpoint, Enums.CommonAttributeNames attribute)
        {
            string attributeName = Enum.GetName(typeof(Enums.CommonAttributeNames), attribute);

            return(await GetAttributeAsync(endpoint, attributeName));
        }