예제 #1
0
 public ViewFactory(
     IViewDescriptorCollection viewDescriptors,
     IViewInvoker viewInvoker)
 {
     _viewDescriptors = viewDescriptors;
     _viewInvoker     = viewInvoker;
 }
예제 #2
0
        public static T FirstDescriptorModelOfType <T>(this IViewDescriptorCollection viewDescriptorCollection) where T : class
        {
            if (viewDescriptorCollection.Descriptors.ContainsKey(typeof(T)))
            {
                if (viewDescriptorCollection.Descriptors[typeof(T)][0].View.Model is T)
                {
                    return((T)viewDescriptorCollection.Descriptors[typeof(T)][0].View.Model);
                }
            }

            return(null);
        }