Ejemplo n.º 1
0
        public static SateliteViewer Generate(StoryFrameModel model)
        {
            var viewer    = new SateliteViewer(Application.Current.MainWindow);
            var viewModel = new StoryFrameSateliteViewModel(viewer, model);

            viewer.LeftButtonLabel   = "ステータス";
            viewer.TopButtonLabel    = "登場人物";
            viewer.RightButtonLabel  = "登場アイテム";
            viewer.BottomButtonLabel = "自由記入欄";

            viewer.RelatedModel       = model;
            viewer.TopLeftGridElement = new StatusGrid()
            {
                DataContext = viewModel
            };
            viewer.TopRightGridElement = new CharactersGrid()
            {
                DataContext = viewModel
            };
            viewer.BottomRightGridElement = new ItemsGrid()
            {
                DataContext = viewModel
            };
            viewer.BottomLeftGridElement = new RemarkGrid()
            {
                DataContext = viewModel
            };

            return(viewer);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 展開を削除する
        /// </summary>
        /// <param name="rmModel">展開する展開</param>
        public void RemoveStoryFrame(StoryFrameModel rmModel)
        {
            var strManager = ModelsComposite.StoryFrameModelManager;

            strManager.RemoveModel(rmModel);

            var csmManager = ModelsComposite.CharacterStoryModelManager;

            csmManager.RemoveModel(rmModel);

            var isManager = ModelsComposite.ItemStoryModelManager;

            isManager.RemoveModel(rmModel);

            var plcManager = ModelsComposite.PlaceModelManager;

            var findPlace = plcManager.FindPlaceModel(rmModel.PlaceId);

            if (findPlace != null)
            {
                plcManager.RemoveModel(findPlace);
            }

            EventAggregator.OnModelDataChanged(this, new ModelValueChangedEventArgs());
            EventAggregator.OnDeleteIMarkable(this, new DeleteIMarkableModelEventArgs(rmModel));
        }
Ejemplo n.º 3
0
        public static void AddStoryFrameMark(string text, int index, StoryFrameModel targetMark)
        {
            var marks = ModelsComposite.MarkManager.GetMarks(0, text.Length - 1, MarkKindEnums.StoryFrame);

            int headIndex = index;
            int tailIndex = index;

            // 同じ開始インデックスがあれば回避
            foreach (var mark in marks)
            {
                if (mark.HeadCharIndex == index)
                {
                    return;
                }
            }

            foreach (var mark in marks)
            {
                // 同じのがあったら削除
                if (mark.Parent == targetMark)
                {
                    ModelsComposite.MarkManager.DeleteMark(mark);
                    break;
                }
            }

            AddStoryFrameMark(headIndex, tailIndex, targetMark);
        }
Ejemplo n.º 4
0
        public StoryFrameSateliteViewModel(SateliteViewer viewer, StoryFrameModel model)
        {
            _view   = viewer;
            _parent = model;

            _view.Closed            += _view_Closed;
            _parent.PropertyChanged += _parent_PropertyChanged;
            _view.OnJumpEvent       += _view_OnJumpEvent;
            EventAggregator.DeleteIMarkableHandler += OnIMarkableDeleted;
        }
        public void Select(StoryFrameModel model)
        {
            int selectIndex = -1;

            if (model != null)
            {
                selectIndex = StoryFrameModelCollection.IndexOf(model);
            }

            SelectingIndex = selectIndex;
        }
        public void RemoveModel(StoryFrameModel model)
        {
            var modelMgr = FindModel(model.Id);

            if (_oneStoryCharaStoryMgrDictionary.ContainsKey(model.Id))
            {
                _oneStoryCharaStoryMgrDictionary.Remove(model.Id);
            }

            _modelCollection.Remove(modelMgr);
        }
Ejemplo n.º 7
0
        public static void AddStoryFrameMark(int head, int tail, StoryFrameModel model)
        {
            var storyFrameMark = new StoryFrameMark();

            storyFrameMark.Brush         = model.MarkBrush;
            storyFrameMark.MarkId        = model.Id;
            storyFrameMark.HeadCharIndex = head;
            storyFrameMark.TailCharIndex = tail;
            storyFrameMark.Parent        = model;

            ModelsComposite.MarkManager.AddMark(storyFrameMark);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 新しい展開を追加する
        /// </summary>
        /// <param name="storyModel">追加する展開</param>
        /// <returns>作成した展開</returns>
        public StoryFrameModel AddStoryFrame(StoryFrameModel storyModel)
        {
            var manager = ModelsComposite.StoryFrameModelManager;

            manager.AddModel(storyModel);

            ModelsComposite.CharacterStoryModelManager.AddStoryFrameModel(storyModel.Id);
            ModelsComposite.ItemStoryModelManager.AddStoryFrameModel(storyModel.Id);

            EventAggregator.OnModelDataChanged(this, new ModelValueChangedEventArgs());
            EventAggregator.OnAddIMarkable(this, new AddIMarkableModelEventArgs(storyModel));

            return(storyModel);
        }
 /// <summary>
 /// StoryFrameModelからEventModelを作る
 /// </summary>
 private static EventModel GenerateEventModel(StoryFrameModel story)
 {
     return(new EventModel()
     {
         Title = story.Name,
         StartDateTime = story.StartDateTime,
         EndDateTime = story.EndDateTime,
         Detail = story.Remarks,
         SourceObject = story,
         Participants = new List <int>()
         {
             CommonConstants.STORY_FRAME_EVENT_ID
         }
     });
 }
Ejemplo n.º 10
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 /// <param name="org"></param>
 public StoryFrameTransferItemViewModel(StoryFrameModel org)
 {
     _source = org;
 }
Ejemplo n.º 11
0
 public StoryFrameDetailViewModel(StoryFrameModel model)
 {
     _model = model;
 }