private void OnLoaded(RoutedEventArgs e) { _textEditor = e.OriginalSource as TextEditorEx; if (_eventAggregator != null) { _eventAggregator.GetEvent <RequestTextEvent>().Publish(new TabInfo()); } }
private void Loaded(TextEditorEx textEditor) { _textEditor = textEditor; if (_textEditor != null) { _textEditor.LoadSyntaxHighlighting(AppDomain.CurrentDomain.BaseDirectory + "Assets\\Json.xshd"); _textEditor.Text = JsonString; } UpdateByJsonString(); if (IsSyncDataSource) { UpdateDataSource(true); } }
private void Loaded(RoutedEventArgs e) { var editorControl = e.OriginalSource as EditorControl; _textEditor = editorControl.XamlTextEditorEx; var selectInfo = (TabSelectInfo)(RegionContext.GetObservableContext(editorControl).Value); if (selectInfo != null) { _fileGuid = selectInfo.Guid; IsActive = selectInfo.IsSelected; IsSelected = selectInfo.IsSelected; _eventAggregator.GetEvent<RequestSettingEvent>().Publish(_fileGuid); _eventAggregator.GetEvent<RequestTextEvent>().Publish(new TabInfo { Guid = _fileGuid }); } }
public void Dispose() { //Events _settingChangedEvent.Unsubscribe(OnSettingChanged); _loadTextEvent.Unsubscribe(OnLoadText); _updateTabStatusEvent.Unsubscribe(OnUpdateTabStatus); _selectTabEvent.Unsubscribe(OnSelectTab); //Command _appCommands.SaveCommand.UnregisterCommand(SaveCommand); _appCommands.CompileCommand.UnregisterCommand(CompileCommand); _appCommands.RedoCommand.UnregisterCommand(RedoCommand); _appCommands.UndoCommand.UnregisterCommand(UndoCommand); _textEditor?.Dispose(); _textEditor = null; _xsdParser = null; }
/// <summary> /// 解析結果を反映する /// </summary> /// <param name="filePath"></param> private void reflectParseResult(string filePath) { //ファイルタイプ別更新 FileType.KrkrType type = FileType.GetKrkrType(filePath); switch (type) { case FileType.KrkrType.Kag: if (GlobalStatus.FormManager.IsHiddenKagLabelForm == false) //表示しているときだけ { GlobalStatus.FormManager.KagLabelForm.InitTreeFileItem(filePath); } break; case FileType.KrkrType.Tjs: if (FileType.IsKagexEnvinitFileName(filePath)) { if (GlobalStatus.FormManager.IsHiddenWorldExViewForm == false) //表示しているとき { GlobalStatus.FormManager.WorldExViewForm.InitView(); } } else { //TJSはまだ未実装 } break; } //エディタ関連更新 TextEditorEx editor = GlobalStatus.EditorManager.GetTextEdtorFromFileName(filePath); if (editor != null) { editor.UpdateFolding(); //折りたたみを更新する } }