internal static void ApplyChanges(ContentType settings) { SchemaEditor editor = new SchemaEditor(); editor.Load(); ApplyChangesInEditor(settings, editor); editor.Register(); // The ContentTypeManager distributes its reset, no custom DistributedAction call needed ContentTypeManager.Reset(); }
internal static void ApplyChanges(ContentType settings, bool reset) { SchemaEditor editor = new SchemaEditor(); editor.Load(); ApplyChangesInEditor(settings, editor); editor.Register(); // The ContentTypeManager distributes its reset, no custom DistributedAction call needed if (reset) { ContentTypeManager.Reset(); // necessary (ApplyChanges) calls ContentType.Save } }
internal void RemoveContentType(string name) { // Caller: ContentType.Delete() lock (_syncRoot) { ContentType contentType; if (_contentTypes.TryGetValue(name, out contentType)) { SchemaEditor editor = new SchemaEditor(); editor.Load(); RemoveContentType(contentType, editor); editor.Register(); // The ContentTypeManager distributes its reset, no custom DistributedAction call needed ContentTypeManager.Reset(); } } }
public void ExecuteBatch() { //-- Install considering dependencies if (_contentTypeCTD != null) { Install(_contentTypeCTD); } List <CTD> docList = new List <CTD>(_docs.Values); Stack <CTD> stack = new Stack <CTD>(); CTD parent = null; while (docList.Count > 0) { CTD doc = parent ?? docList[0]; docList.Remove(doc); _docs.Remove(doc.Name); if (_docs.ContainsKey(doc.ParentName)) { stack.Push(doc); parent = _docs[doc.ParentName]; } else { Install(doc); while (stack.Count > 0) { Install(stack.Pop()); } parent = null; } } _editor.Register(); // The ContentTypeManager distributes its reset, no custom DistributedAction call needed ContentTypeManager.Reset(); }
public static void RemoveContentType(ContentType contentType) { contentType.Delete(); // The ContentTypeManager distributes its reset, no custom DistributedAction call needed ContentTypeManager.Reset(); }