public ReferenceInfo(IAssetReference reference) { this.Reference = reference; ManagerExecutableAttribute attr = (ManagerExecutableAttribute)Attribute.GetCustomAttribute( reference.GetType(), typeof(ManagerExecutableAttribute), true); // By default references are executable, unless they specify otherwise. this.IsEnabled = (attr == null) || attr.AllowExecute; }
public static T Resolve <T>(IAssetReference reference) where T : class { if (reference == null) { return(null); } var resolver = Resolvers.FirstOrDefault(x => x.CanResolve(reference.GetType())); return(resolver?.Resolve(reference) as T); }