Exemplo n.º 1
0
        public void ShowTimelineAxisEvents(TimelineAxis axis)
        {
            EventModelManager manager = _eventModelManager;

            var list = manager.GetEventModel(axis.Id);
            var eventListViewerViewModel = new EventViewerViewModel()
            {
                DataList = new List <EventViewerItemViewModel>()
            };

            foreach (var item in list)
            {
                eventListViewerViewModel.DataList.Add(new EventViewerItemViewModel()
                {
                    StartDateTime = item.StartDateTime,
                    EndDateTime   = item.EndDateTime,
                    Name          = item.Title,
                });
            }

            CommonLightBox  lightBox = new CommonLightBox();
            EventListViewer viewer   = new EventListViewer();

            viewer.DataContext = eventListViewerViewModel;

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.CancelOnly;
            lightBox.BindUIElement(viewer);
            lightBox.Owner = Application.Current.MainWindow;

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                StartDateTime = viewer.JumpDateTime;
            }
        }
Exemplo n.º 2
0
        public void ExecuteOnAdd(ObservableCollection <AppearListViewItemModel> dataList)
        {
            CommonLightBox dialog = new CommonLightBox();

            TagsSelectorView selectorView = new TagsSelectorView();
            var tagSelectorViewModel      = new TagSelectorViewModel();

            SetSelectingTags(tagSelectorViewModel.SelectingTags);
            selectorView.SetModel(tagSelectorViewModel);

            dialog.Owner = Application.Current.MainWindow;
            dialog.BindUIElement(selectorView);
            dialog.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;

            dialog.IsStretchable = false;

            selectorView.Height = Application.Current.MainWindow.ActualHeight - 80;
            selectorView.Width  = Application.Current.MainWindow.ActualWidth - 80;

            selectorView.DataContext = tagSelectorViewModel;


            if (ShowDialogManager.ShowDialog(dialog) == true)
            {
                tagSelectorViewModel.UpdateModelsComposite();
                _stickable.SetTagIds(GetSelectingTagIds(tagSelectorViewModel.SelectingTags));

                dataList.Clear();
                var list = TagToAppearListViewModelConverter.ToAppearListViewItemModel(_stickable.GetTagIds(), _tagManager);
                foreach (var newItemModel in list)
                {
                    dataList.Add(newItemModel);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 引き継いで新規作成
        /// </summary>
        /// <param name="iEditor">テキストを取得するためのIEditorインターフェース</param>
        /// <returns>正否だけどとりあえずtrueしか返さない</returns>
        public bool CreateNewPlus(IEditor iEditor)
        {
            NewFilePlusControl control = new NewFilePlusControl();

            control.Owner = Application.Current.MainWindow;
            var newFilePlusViewModel = NewFilePlusGenerator.GetNewFilePlusViewModel();

            control.DataContext = newFilePlusViewModel;

            //ダイアログを表示する
            if (ShowDialogManager.ShowDialog(control) == true)
            {
                var transferData = NewFilePlusGenerator.GetTransferData(newFilePlusViewModel);

                ModelsComposite.CreateNew(iEditor);
                CurrentFile = "";

                // Transferの過程でイベントが発生しても怒られないように、一旦Newの状態を各画面に通知する
                EventAggregator.OnDataReloaded(this, new DataReloadedEventArgs());

                // 引き継ぎ
                NewFilePlusTransferer.Transfer(transferData);

                // もっかい画面に通知
                EventAggregator.OnDataReloaded(this, new DataReloadedEventArgs());


                return(true);
            }

            return(true);
        }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            CommonLightBox dialog = new CommonLightBox();

            AppearListViewControl chWindow = new AppearListViewControl();

            dialog.Owner = Application.Current.MainWindow;
            dialog.BindUIElement(chWindow);

            var appearList    = GetAppearList();
            var listViewModel = new AppearListViewModel()
            {
                DataList = appearList,
                DisplayOrNoDisplayHeader = "表示する/しない",
            };

            chWindow.DataContext = listViewModel;
            ShowDialogManager.ShowDialog(dialog);

            foreach (var item in listViewModel.DataList)
            {
                var data = item.ParentObject as TimelineAxis;
                data.IsDisplayed = item.IsAppeared;
            }

            _timelineViewModel.Initialize();
        }
Exemplo n.º 5
0
        private void SateliteButton_Click(object sender, RoutedEventArgs e)
        {
            SateliteSelector sateliteSelector = new SateliteSelector();
            CommonLightBox   commonLightBox   = new CommonLightBox();

            commonLightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.CancelOnly;
            commonLightBox.BindUIElement(sateliteSelector);
            commonLightBox.Owner = Application.Current.MainWindow;

            ShowDialogManager.ShowDialog(commonLightBox);
        }
Exemplo n.º 6
0
        public void ShowExistEvent(EventModel eventModel)
        {
            EventViewModel evtModel = new EventViewModel()
            {
                StartDateTime       = eventModel.StartDateTime,
                EndDateTime         = eventModel.EndDateTime,
                Detail              = eventModel.Detail,
                Title               = eventModel.Title,
                AppearListViewItems = GenerateAppearListViewItemModel(eventModel)
            };

            CommonLightBox lightBox = new CommonLightBox();
            EventRegister  register = new EventRegister();

            register.DataContext = evtModel;

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;
            lightBox.BindUIElement(register);
            lightBox.Owner = Application.Current.MainWindow;

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                _eventModelManager.Remove(eventModel);

                var participants = GetParticipants(evtModel.AppearListViewItems);
                // 参加者がいないイベント作っても意味ないよね
                if (participants.Count() == 0)
                {
                    _view.OnEventChanged(_view, new Timeline.EventChangedArgs()
                    {
                        kind = Timeline.EventChangedKind.Delete, model = eventModel
                    });
                }
                else
                {
                    var addEvent = new EventModel()
                    {
                        StartDateTime = evtModel.StartDateTime,
                        EndDateTime   = evtModel.EndDateTime,
                        Title         = evtModel.Title,
                        Detail        = evtModel.Detail,
                        Participants  = GetParticipants(evtModel.AppearListViewItems),
                        SourceObject  = eventModel.SourceObject,
                    };
                    _eventModelManager.Add(addEvent);
                    _view.OnEventChanged(_view, new Timeline.EventChangedArgs()
                    {
                        kind = Timeline.EventChangedKind.Modify, model = addEvent
                    });
                }
                Initialize();
            }
        }
        private void colorbutton_Click(object sender, RoutedEventArgs e)
        {
            var            userControl = new GeneralColorPicker();
            CommonLightBox lightBox    = new CommonLightBox();

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;
            lightBox.BindUIElement(userControl);
            lightBox.Owner = Application.Current.MainWindow;

            userControl.SelectingColor = ((SolidColorBrush)_model.SelectingModel.ColorBrush).Color;

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                _model.SelectingModel.ColorBrush = new SolidColorBrush(userControl.SelectingColor);
            }
        }
        /// <summary>
        /// ページ数を計算する
        /// </summary>
        public void CalculatePageNumber()
        {
            SetTextToModelsComposite();
            CommonLightBox dialog = new CommonLightBox();

            var pageLineCalcView            = new PageLineCalculatorView();
            var pageLineCalculatorViewModel = new PageLineCalculatorViewModel(ModelsComposite.NovelSettingModel, ModelsComposite.DocumentModel);

            pageLineCalcView.BindModel(pageLineCalculatorViewModel);

            dialog.Owner = Application.Current.MainWindow;
            dialog.BindUIElement(pageLineCalcView);
            dialog.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveOnly;

            ShowDialogManager.ShowDialog(dialog);
        }
Exemplo n.º 9
0
        public void ExecuteOnAdd(ObservableCollection <AppearListViewItemModel> dataList)
        {
            CommonLightBox dialog = new CommonLightBox();

            AppearListViewControl chWindow = new AppearListViewControl();

            dialog.Owner = Application.Current.MainWindow;
            dialog.BindUIElement(chWindow);

            var listViewModel = new AppearListViewModel()
            {
                DataList = dataList,
                DisplayOrNoDisplayHeader = "登場する/しない"
            };

            chWindow.DataContext = listViewModel;
            ShowDialogManager.ShowDialog(dialog);
        }
Exemplo n.º 10
0
        public void ShowEventOnVacantCell(TimeBorderViewModel borderModel)
        {
            EventViewModel evtModel = new EventViewModel()
            {
                StartDateTime       = borderModel.StartDateTime,
                EndDateTime         = borderModel.EndDateTime,
                AppearListViewItems = GenerateAppearListViewItemModel(borderModel)
            };

            CommonLightBox lightBox = new CommonLightBox();
            EventRegister  register = new EventRegister();

            register.DataContext = evtModel;

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;
            lightBox.BindUIElement(register);
            lightBox.Owner          = Application.Current.MainWindow;
            lightBox.OnSaveAndQuit += register.OnSaveAndQuit;

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                var participants = GetParticipants(evtModel.AppearListViewItems);
                // 参加者がいないイベント作っても意味ないよね
                if (participants.Count() == 0)
                {
                    return;
                }

                var addEvent = new EventModel()
                {
                    StartDateTime = evtModel.StartDateTime,
                    EndDateTime   = evtModel.EndDateTime,
                    Title         = evtModel.Title,
                    Detail        = evtModel.Detail,
                    Participants  = participants,
                };
                _eventModelManager.Add(addEvent);
                _view.OnEventChanged(_view, new Timeline.EventChangedArgs()
                {
                    kind = Timeline.EventChangedKind.Add, model = addEvent
                });
                Initialize();
            }
        }
Exemplo n.º 11
0
        public void OpenFileDialog()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.FileName = GetOpenFileName();

            ofd.InitialDirectory = GetOpenDirectoryName();

            ofd.Filter      = "ArtOfWordsファイル(*.kieAow)|*.kieAow";
            ofd.FilterIndex = 1;

            ofd.Title            = "開くファイルを選択してください";
            ofd.RestoreDirectory = true;

            //ダイアログを表示する
            if (ShowDialogManager.ShowDialog(ofd) == true)
            {
                OpenFilePath = ofd.FileName;
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// ファイルを開く
        /// </summary>
        /// <param name="editor">テキストを展開するためのIEditorインターフェース</param>
        /// <returns>正否</returns>
        public bool OpenFile(IEditor editor)
        {
            FileSelectorControl control = new FileSelectorControl();

            control.Owner = Application.Current.MainWindow;
            var viewModel = new FileSelectorViewModel(control);

            viewModel.Initialize(NovelsCollectorGenerator.GetRecentlyNovelsCollector(),
                                 NovelsCollectorGenerator.GetSemiAutoBackupNovelsCollector(),
                                 NovelsCollectorGenerator.GetNovelsBoxCollector());

            control.SetViewModel(viewModel);
            //ダイアログを表示する
            if (ShowDialogManager.ShowDialog(control) == true)
            {
                OpenFile(editor, control.FilePath);
                return(true);
            }

            return(false);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 名前をつけて保存
        /// </summary>
        /// <returns></returns>
        public bool SaveFileWithName()
        {
            //SaveFileDialogクラスのインスタンスを作成
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.FileName         = "新しいファイル.kieAow";
            sfd.InitialDirectory = GetFolderPath();
            sfd.Filter           = "ArtOfWordsファイル(*.kieAow)|*.kieAow";
            sfd.FilterIndex      = 1;

            sfd.Title            = "保存先のファイルを選択してください";
            sfd.RestoreDirectory = true;
            sfd.OverwritePrompt  = true;
            sfd.CheckPathExists  = true;

            if (ShowDialogManager.ShowDialog(sfd) == true)
            {
                return(SaveFile(sfd.FileName));
            }

            return(false);
        }
        private void TextStyleButton_Click_1(object sender, RoutedEventArgs e)
        {
            var            userControl = new TextBoxColorPicker();
            CommonLightBox lightBox    = new CommonLightBox();

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;
            lightBox.BindUIElement(userControl);
            lightBox.Owner = Application.Current.MainWindow;

            userControl.SelectingFontFamily = Properties.Settings.Default.TextBoxFontFamily;
            //dlg.DlgFontWeight = FontWeights.Bold;
            userControl.SelectingFontSize        = Properties.Settings.Default.TextBoxFontSize;
            userControl.SelectingFontColor       = Properties.Settings.Default.TextBoxFontColor;
            userControl.SelectingBackgroundColor = Properties.Settings.Default.TextBoxBackgroundColor;

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                Properties.Settings.Default.TextBoxFontColor       = userControl.SelectingFontColor;
                Properties.Settings.Default.TextBoxBackgroundColor = userControl.SelectingBackgroundColor;
                Properties.Settings.Default.Save();

                EventAggregator.OnFontSettingChanged(this, 0);
            }
        }
        private void FontButton_Click_1(object sender, RoutedEventArgs e)
        {
            var            dlg      = new emanual.Wpf.Controls.FontDialogEx();
            CommonLightBox lightBox = new CommonLightBox();

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;
            lightBox.BindUIElement(dlg);
            lightBox.Owner = Application.Current.MainWindow;

            dlg.DlgFontFamily = Properties.Settings.Default.TextBoxFontFamily;
            //dlg.DlgFontWeight = FontWeights.Bold;
            dlg.DlgFontSize   = Properties.Settings.Default.TextBoxFontSize;
            dlg.DlgLanguage   = "ja-jp";
            dlg.DlgSampleText = "ここでFontのテストが出来ます";

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                Properties.Settings.Default.TextBoxFontSize   = dlg.DlgFontSize;
                Properties.Settings.Default.TextBoxFontFamily = dlg.DlgFontFamily;
                Properties.Settings.Default.Save();

                EventAggregator.OnFontSettingChanged(this, 0);
            }
        }