コード例 #1
0
        /// <summary>
        /// This looks lame but it means we don't have to go into Umbraco and configure stuff.
        /// </summary>
        public static void Synchronize()
        {
            var dataSync        = new DataTypeSync();
            var mediaSync       = new MediaTypeSync();
            var docSync         = new DocTypeSync();
            var memberSync      = new MemberTypeSync();
            var memberGroupSync = new MemberGroupSync();

            //Sync all the types
            dataSync.SyncAll();
            mediaSync.SyncAll();
            docSync.SyncAll();
            memberSync.SyncAll();
            memberGroupSync.SyncAll();

            //Syncing tasks that user wants to run.
            var syncTaskTypes = ReflectionHelper.GetTypesThatImplementInterface(typeof(ISyncTask));

            foreach (var syncTaskType in syncTaskTypes)
            {
                var task = Activator.CreateInstance(syncTaskType) as ISyncTask;
                task.Run();
            }

            AssemblyVersionHelper.Update();
        }
コード例 #2
0
ファイル: CmsSyncManger.cs プロジェクト: richieallen/ucreate
        /// <summary>
        /// This looks lame but it means we don't have to go into Umbraco and configure stuff.
        /// </summary>
        public static void Synchronize()
        {
            var dataSync = new DataTypeSync();
            var mediaSync = new MediaTypeSync();
            var docSync = new DocTypeSync();
            var memberSync = new MemberTypeSync();
            var memberGroupSync = new MemberGroupSync();

            //Sync all the types
            dataSync.SyncAll();
            mediaSync.SyncAll();
            docSync.SyncAll();
            memberSync.SyncAll();
            memberGroupSync.SyncAll();

            //Syncing tasks that user wants to run.
            var syncTaskTypes = ReflectionHelper.GetTypesThatImplementInterface(typeof(ISyncTask));

            foreach (var task in syncTaskTypes.Select(syncTaskType => Activator.CreateInstance(syncTaskType) as ISyncTask))
            {
                task.Run();
            }

            AssemblyVersionHelper.Update();
        }
コード例 #3
0
        public PropertyType GetPropertyType()
        {
            var dataType = new DataTypeSync().GetDataType(TypeName);
            if(dataType == null)
                throw new Exception($"Failed to find data type with name: {TypeName} for property: {Name}");

            var propType = new PropertyType(dataType)
            {
                Alias = Alias,
                Name = Name,
                Description = Description,
                Mandatory = Mandatory,
                ValidationRegExp = ValidationRegExp
            };

            return propType;
        }
コード例 #4
0
ファイル: PropertyAttribute.cs プロジェクト: ilia280/ucreate
        /// <summary>
        /// Generates umbraco PropertyType from attribute values
        /// </summary>
        /// <returns></returns>
        public PropertyType GetPropertyType()
        {
            var dataType = new DataTypeSync().GetDataType(TypeName);

            if (dataType == null)
            {
                throw new Exception($"Failed to find data type with name: {TypeName} for property: {Name}");
            }

            var propType = new PropertyType(dataType)
            {
                Alias            = Alias,
                Name             = Name,
                Description      = Description,
                Mandatory        = Mandatory,
                ValidationRegExp = ValidationRegExp
            };

            return(propType);
        }