Example #1
0
        public static MethodInfo GetTemplateMethod(this Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            return(Template.FindCopyFromMethod(type));
        }
            protected bool TryCopyFromMethod()
            {
                object initializer    = CurrentContext.Object;
                var    copyFromMethod = Template.FindCopyFromMethod(initializer.GetType());

                if (copyFromMethod != null)
                {
                    AddCommand(new CopyFromCommand(copyFromMethod, initializer));
                    return(true);
                }
                return(false);
            }