Example #1
0
        private static ContentBlock CreateContentBlockForType(ContentBlockType type)
        {
            var classType       = GetContentBlockClassTypeFromEnumValue(type);
            var newContentBlock = (ContentBlock)Activator.CreateInstance(classType);

            newContentBlock.Id = Guid.NewGuid();
            return(newContentBlock);
        }
        private static ContentBlock CreateContentBlockForType(ContentBlockType type)
        {
            var classType       = GetContentBlockClassTypeFromEnumValue(type);
            var newContentBlock = (ContentBlock)Activator.CreateInstance(classType);

            newContentBlock.Created = DateTime.UtcNow;
            return(newContentBlock);
        }
 public BasicContentBlock(ContentBlockType type)
 {
     Type = type;
 }
Example #4
0
        private static ContentBlock CreateContentBlockForType(ContentBlockType type)
        {
            var classType = GetContentBlockClassTypeFromEnumValue(type);

            return((ContentBlock)Activator.CreateInstance(classType));
        }
 public static Type GetContentBlockClassTypeFromEnumValue(ContentBlockType enumValue)
 {
     return(enumValue.GetEnumAttribute <ContentBlockClassType>().Type);
 }