private object OnDragDropDelayed(object arg) { this.isDropping = false; TextEditProxy textEditProxy = (TextEditProxy)arg; if (textEditProxy != null) { using (SceneEditTransaction editTransaction = this.Tool.ActiveSceneViewModel.CreateEditTransaction(StringTable.UndoUnitDragDropText)) { if (this.editProxy != null) { this.ActiveSceneViewModel.ElementSelectionSet.SetSelection((SceneElement)this.editProxy.TextSource); TextSelectionSet textSelectionSet = this.ActiveSceneViewModel.TextSelectionSet; textSelectionSet.TextEditProxy = this.editProxy; textSelectionSet.IsActive = true; } textEditProxy.Serialize(); textEditProxy.UpdateDocumentModel(); this.RemoveEditProxyFromScene(textEditProxy); this.CommitCurrentEdit(); editTransaction.Commit(); if (this.editProxy != null) { if (this.editProxy.TextSource.IsViewObjectValid) { this.SetIsTextEditingProperty(this.editProxy.TextSource, true); } } } } return((object)null); }
private void EditDifferentElement(BaseFrameworkElement element) { this.EndTextEdit(); if (element != null && !TextEditProxyFactory.IsEditableElement((SceneElement)element)) { element = (BaseFrameworkElement)null; } bool flag1 = false; if (element != null && element.IsViewObjectValid) { SceneElementSelectionSet elementSelectionSet = this.ActiveSceneViewModel.ElementSelectionSet; if (elementSelectionSet != null) { elementSelectionSet.SetSelection((SceneElement)element); } flag1 = true; this.BeginTextEdit(element); } TextSelectionSet textSelectionSet = this.ActiveSceneViewModel.TextSelectionSet; bool flag2 = false; if (textSelectionSet != null) { flag2 = this.ActiveSceneViewModel.TextSelectionSet.IsActive; int num = flag1 ? true : false; textSelectionSet.TextEditProxy = this.editProxy; textSelectionSet.IsActive = flag1; } if (flag1 != flag2) { this.ActiveSceneViewModel.RefreshSelection(); } if (flag1) { return; } this.ActiveView.ReturnFocus(); }
private void SelectionManager_LateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { this.designerContext.ResourceManager.OnSceneUpdate(args); TextSelectionSet textSelectionSet = this.designerContext.SelectionManager.TextSelectionSet; SceneElementSelectionSet elementSelectionSet = this.designerContext.SelectionManager.ElementSelectionSet; if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.IsEditable | SceneViewModel.ViewStateBits.ActiveTrigger | SceneViewModel.ViewStateBits.ActiveTimeline | SceneViewModel.ViewStateBits.ElementSelection | SceneViewModel.ViewStateBits.TextSelection | SceneViewModel.ViewStateBits.KeyFrameSelection | SceneViewModel.ViewStateBits.AnimationSelection | SceneViewModel.ViewStateBits.StoryboardSelection | SceneViewModel.ViewStateBits.CurrentValues | SceneViewModel.ViewStateBits.ChildPropertySelection | SceneViewModel.ViewStateBits.BehaviorSelection)) { this.FireAllPropertyChangedEvents(args); } else { if (args.DocumentChanges.Count <= 0) { return; } foreach (DocumentNodeChange documentNodeChange in args.DocumentChanges.DistinctChanges) { if (documentNodeChange.ParentNode != null && documentNodeChange.ParentNode.TargetType == typeof(DictionaryEntry)) { this.FireAllPropertyChangedEvents(args); return; } } this.changedPropertyReferences = new List <PropertyReference>(); foreach (SceneChange sceneChange in SceneChange.ChangesOfType <SceneChange>(args.DocumentChanges, args.ViewModel.RootNode)) { if (sceneChange is StyleSceneChange) { this.FireAllPropertyChangedEvents(args); return; } } this.FireSelectivePropertyChangedEvents(args); } }