コード例 #1
0
ファイル: UmbracoManager.cs プロジェクト: nc-nj/uSiteBuilder
        //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);
            }
        }
コード例 #2
0
 /// <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);
     }
 }
コード例 #3
0
ファイル: ContentHelper.cs プロジェクト: nc-nj/uSiteBuilder
 /// <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);
     }
 }
コード例 #4
0
ファイル: ContentUtil.cs プロジェクト: nc-nj/uSiteBuilder
 /// <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);
     }
 }