Exemplo n.º 1
0
        public static void CopyPropertyIfExists(ITaskItem item, IDictionary <string, string> properties, string key, string toKey)
        {
            var wrapper = new MSBuildTaskItem(item);

            var propertyValue = wrapper.GetProperty(key);

            if (!string.IsNullOrEmpty(propertyValue) &&
                !properties.ContainsKey(key))
            {
                properties.Add(toKey, propertyValue);
            }
        }
Exemplo n.º 2
0
        public static string GetPropertyIfExists(ITaskItem item, string key)
        {
            var wrapper = new MSBuildTaskItem(item);

            var propertyValue = wrapper.GetProperty(key);

            if (!string.IsNullOrEmpty(propertyValue))
            {
                return(propertyValue);
            }

            return(null);
        }