示例#1
0
        public static T Inherit <T>(ModelHostBase modelHost, Action <T> action)
            where T : ModelHostBase, new()
        {
            var source = modelHost.Clone() as ModelHostBase;
            var result = new T();

            CopyProperties(source, result);

            if (action != null)
            {
                action(result);
            }

            return(result);
        }
示例#2
0
 public static T Inherit <T>(ModelHostBase modelHost)
     where T : ModelHostBase, new()
 {
     return(Inherit <T>(modelHost, null));
 }
示例#3
0
 public static ModelHostBase Inherit(ModelHostBase modelHost)
 {
     return(Inherit <ModelHostBase>(modelHost));
 }