Пример #1
0
        private string GetScriptName(IMethod method, NamingStrategy namingStrategy)
        {
            IAttributeData actionAttr = method.Attributes.FirstOrDefault(attr => CommonFilters.ScriptActionAttributeTypeFilter.Matches(attr.AttributeType));

            string key = nameof(ScriptActionAttribute.Name);

            if (actionAttr != null && actionAttr.NamedArguments.ContainsKey(key))
            {
                return(actionAttr.NamedArguments[key] as string);
            }

            return(namingStrategy.GetName(method.Name));
        }
Пример #2
0
 /// <summary>
 ///     Gets full path to the file for specified type, using current <see cref="NamingStrategy"/>.
 /// </summary>
 /// <typeparam name="T">The generic type to use with <see cref="INamingStrategy.GetName{T}"/> method.</typeparam>
 /// <returns>Full path to the file.</returns>
 public string GetFileFullPath <T>()
 {
     return(Path.Combine(Location, $"{NamingStrategy.GetName<T>()}.{FileExtension}"));
 }