/// <summary> /// Configures the specified type. /// </summary> /// <param name="type">The type.</param> /// <param name="config">The config.</param> /// <exception cref="Glass.Mapper.Configuration.ConfigurationException">Type configuration is not of type {0}.Formatted(typeof (SitecoreTypeConfiguration).FullName)</exception> public override void Configure(Type type, Mapper.Configuration.AbstractTypeConfiguration config) { var scConfig = config as SitecoreTypeConfiguration; if (scConfig == null) { throw new ConfigurationException( "Type configuration is not of type {0}".Formatted(typeof(SitecoreTypeConfiguration).FullName)); } if (BranchId.IsNotNullOrEmpty()) { scConfig.BranchId = new ID(this.BranchId); } else { scConfig.BranchId = ID.Null; } if (TemplateId.IsNotNullOrEmpty()) { scConfig.TemplateId = new ID(this.TemplateId); } else { scConfig.TemplateId = ID.Null; } scConfig.CodeFirst = this.CodeFirst; scConfig.TemplateName = this.TemplateName; base.Configure(type, config); }
/// <summary> /// Configs the created. /// </summary> /// <param name="config">The config.</param> protected override void ConfigCreated(Mapper.Configuration.AbstractTypeConfiguration config) { var scConfig = config as SitecoreTypeConfiguration; base.ConfigCreated(config); }