예제 #1
0
        public bool TryGet <T>(TemplateContent <T> content, out T result)
        {
            if (_accessors.TryGetValue(content, out var methodInfo))
            {
                result = (T)methodInfo.Invoke();
                return(true);
            }

            result = default;
            return(false);
        }
예제 #2
0
 protected void RegisterContent <T>(TemplateContent <T> content, Func <T> accesor)
 {
     _accessors[content] = () => accesor();
 }