/// <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(); }
/// <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(); }
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; }
/// <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); }