/// <summary> /// ViewModelから転送データを取得する /// </summary> /// <param name="model">データソース</param> /// <returns>転送データ</returns> public static NewFilePlusTransferData GetTransferData(NewFilePlusViewModel model) { var transferData = new NewFilePlusTransferData(); transferData.Characters = GetTransferCharacterData(model.Characters); transferData.Items = GetTransferItemData(model.Items); transferData.StoryFrames = GetTransferStoryFrameData(model.StoryFrames); transferData.Events = GetTransferEventData(model.Events); if (model.DoTransferTags) { transferData.Tags = GetTransferTagData(GetTagListItems()); } transferData.Places = GetTransferPlaceData(); transferData.CharaStoryRelations = GetTransferCSRelationData(ModelsComposite.CharacterStoryModelManager.ModelCollection.ToList(), transferData.Characters, transferData.StoryFrames); transferData.ItemStoryRelations = GetTransferISRelationData(ModelsComposite.ItemStoryModelManager.ModelCollection.ToList(), transferData.Items, transferData.StoryFrames); RemoveInvalidDataFromCharacters(transferData.Characters, transferData.Tags); RemoveInvalidDataFromItem(transferData.Items, transferData.Tags); RemoveInvalidDataFromEvents(transferData.Events, transferData.Characters); RemoveInvalidDataFromStoryFrame(transferData.Characters, transferData.Tags); RemoveInvalidPlaces(transferData.Places, transferData.StoryFrames); return transferData; }
/// <summary> /// データを転送する /// </summary> /// <param name="transferData">転送データ</param> public static void Transfer(NewFilePlusTransferData transferData) { TransferCharacters(transferData.Characters); TransferPlaces(transferData.Places); TransferStoryFrames(transferData.StoryFrames); TransferItems(transferData.Items); TransferCharacterStoryRelation(transferData.CharaStoryRelations); TransferItemStoryRelation(transferData.ItemStoryRelations); TransferTags(transferData.Tags); TransferEvent(transferData.Events); }