//private static void SynchronizeRazorMacros() //{ // RazorManager razorManager = new RazorManager(); // razorManager.Synchronize(); //} private static void RegisterConvertors() { List <Type> convertorTypes = Util.GetFirstLevelSubTypes(typeof(ICustomTypeConvertor)); foreach (Type convertorType in convertorTypes) { ICustomTypeConvertor convertor = (ICustomTypeConvertor)Types.Activation.Activator.Current.GetInstance(convertorType); ContentHelper.RegisterDocumentTypePropertyConvertor(convertor.ConvertType, convertor); } }
/// <summary> /// Registers document type property convertor. /// </summary> /// <param name="propertyType">Document type property type</param> /// <param name="convertor">Convertor implementation</param> internal static void RegisterDocumentTypePropertyConvertor(Type propertyType, ICustomTypeConvertor convertor) { if (PropertyConvertors.ContainsKey(propertyType)) { throw new Exception(string.Format("Failed registering convertor '{0}'. Convertor '{1}' already registered with type '{2}'", convertor.GetType().FullName, PropertyConvertors[propertyType].GetType().FullName, propertyType)); } else { PropertyConvertors.Add(propertyType, convertor); } }
/// <summary> /// Registers document type property convertor. /// </summary> /// <param name="propertyType">Document type property type</param> /// <param name="convertor">Convertor implementation</param> internal static void RegisterDocumentTypePropertyConvertor(Type propertyType, ICustomTypeConvertor convertor) { if (!PropertyConvertors.ContainsKey(propertyType)) { PropertyConvertors.Add(propertyType, convertor); } }