Exemple #1
0
            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;
            }
Exemple #2
0
        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);
        }