public StoryClip CreateStoryBlockClipItem(StoryClip parentUiItem) { if (parentUiItem == null) { parentUiItem = RootClip; } StoryClip item = new StoryClip(this); ItemCreated?.Invoke(item, parentUiItem); parentUiItem.AddChildItem(item); return(item); }
public void RemoveStoryBlockItem(StoryBlockBase item) { if (item is StoryClip) { foreach (StoryBlockBase childItem in ((StoryClip)item).ChildItemList) { RemoveStoryBlockItem(childItem); } } StoryClip parentItem = item.ParentItem; parentItem.ChildItemList.Remove(item); ItemRemoved?.Invoke(item, parentItem); }
public JObject ToJObject() { JObject jFile = new JObject(); //Add scenes JObject jScenes = new JObject(); jFile.Add("Scenes", jScenes); foreach (KeyValuePair <string, Scene> scenePair in SceneDict) { JObject jScene = new JObject(); jScenes.Add(scenePair.Key, jScene); Scene scene = scenePair.Value; jScene.Add(scene.ToJObject()); } //Add clips JObject jClips = new JObject(); jFile.Add("Clips", jClips); foreach (KeyValuePair <string, StoryClip> clipPair in ClipDict) { JObject jClip = new JObject(); jClips.Add(clipPair.Key, jClip); StoryClip clip = clipPair.Value; jClip.Add(clip.ToJObject()); } //Add rootClip JObject jRootClip = new JObject(); jFile.Add("RootClip", RootClip.ToJObject()); return(jFile); }
private void CreateRootItem() { RootClip = new StoryClip(this); ItemCreated?.Invoke(RootClip, null); }