/// <summary> /// Execute the Html navigation command. /// </summary> public void NavigateToHtmlHyperlink(HtmlHyperlink hyperlink) { if (hyperlink.TargetName.Length == 0) { return; } bool bFoundTarget = false; if (hyperlink.TargetName[0] == '#') { string href = hyperlink.TargetName.Substring(1, hyperlink.TargetName.Length - 1); if (KeyGenerator.Instance.CanConvertVModellIDToGuid(href)) { Guid id = KeyGenerator.Instance.ConvertVModellIDToGuid(href); ModelElement modelElement = this.Store.ElementDirectory.FindElement(id); if (modelElement != null) { bFoundTarget = true; SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(modelElement); EventManager.GetEvent <SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } } } if (!bFoundTarget) { System.Windows.MessageBox.Show(hyperlink.TargetName); } }
private void AddItemToSelection(MultiSelectTreeViewItem newItem) { if (!_selectedTreeViewItems.Contains(newItem)) { _selectedTreeViewItems.Add(newItem); } }
/// <summary> /// SelectRelationshipCommand executed; /// </summary> public void SelectRelationshipCommand_Executed() { if (this.SelectedItems.Count == 1) { SerializedDomainClassViewModel classViewModel = this.SelectedItems[0] as SerializedDomainClassViewModel; if (classViewModel != null) { if (classViewModel.Parent != null) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(classViewModel.Parent.GetHostedElement()); EventManager.GetEvent <SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } } SerializedReferenceRelationshipViewModel refRelViewModel = this.SelectedItems[0] as SerializedReferenceRelationshipViewModel; if (refRelViewModel != null) { if (!refRelViewModel.IsInFullSerialization) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(refRelViewModel.SerializationElement); EventManager.GetEvent <SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } } } }
private void AddItemToSelection(MultiSelectionTreeViewItem newItem) { if (!_selectedItems.Contains(newItem)) { _selectedItems.Add(newItem); } OnTextChanged(); }
void ObjectModelBrowser_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(this.SelectedElement); if (LanguageDSLDocData.ViewModelStore != null) { LanguageDSLDocData.ViewModelStore.EventManager.GetEvent <SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(null, col)); } }
/// <summary> /// Navigate To Element Command executed. /// </summary> protected virtual void NavigateToElementCommand_Executed() { BaseModelElementViewModel selectedValue = GetPropertyValue() as BaseModelElementViewModel; if (selectedValue != null) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(selectedValue.Element); EventManager.GetEvent <SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } }
/// <summary> /// Navigate To Element Command executed. /// </summary> protected virtual void NavigateToElementCommand_Executed() { if (SelectedObject != null) { ModelElement selectedValue = SelectedObject.Element; if (selectedValue != null) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(selectedValue); EventManager.GetEvent <SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } } }
/// <summary> /// Navigate to model element /// </summary> public virtual void Navigate() { if (this.Element == null) return; if (this.Element.IsDeleted || this.Element.IsDeleting) return; SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(this.Element); // notify observers, that selection has changed this.EventManager.GetEvent<SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); }
/// <summary> /// Navigate to model element /// </summary> public override void Navigate() { if (this.Source == null) { return; } if (this.Source.IsDeleted || this.Source.IsDeleting) { return; } SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(Source); // notify observers, that selection has changed this.EventManager.GetEvent <SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); }
/// <summary> /// Navigate to target model element /// </summary> public virtual void NavigateToTarget() { if (this.DependencyItem.TargetElement == null) { return; } if (this.DependencyItem.TargetElement.IsDeleted || this.DependencyItem.TargetElement.IsDeleting) { return; } SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(this.DependencyItem.TargetElement); // notify observers, that selection has changed this.EventManager.GetEvent <SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); }
/// <summary> /// View properties command executed. /// </summary> private void ViewPropertiesCommand_Executed() { SelectedItemsCollection col = new SelectedItemsCollection(); foreach (BaseModelElementViewModel vm in this.SelectedItems) { col.Add(vm.GetHostedElement()); } EventManager.GetEvent<SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); }
void ObjectModelBrowser_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(this.SelectedElement); if (LanguageDSLDocData.ViewModelStore != null) LanguageDSLDocData.ViewModelStore.EventManager.GetEvent<SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(null, col)); }
/// <summary> /// Execute the Html navigation command. /// </summary> public void NavigateToHtmlHyperlink(HtmlHyperlink hyperlink) { if (hyperlink.TargetName.Length == 0) return; bool bFoundTarget = false; if (hyperlink.TargetName[0] == '#') { string href = hyperlink.TargetName.Substring(1, hyperlink.TargetName.Length - 1); if (KeyGenerator.Instance.CanConvertVModellIDToGuid(href)) { Guid id = KeyGenerator.Instance.ConvertVModellIDToGuid(href); ModelElement modelElement = this.Store.ElementDirectory.FindElement(id); if (modelElement != null) { bFoundTarget = true; SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(modelElement); EventManager.GetEvent<SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } } } if (!bFoundTarget) System.Windows.MessageBox.Show(hyperlink.TargetName); }
/// <summary> /// Navigate To Element Command executed. /// </summary> protected virtual void NavigateToElementCommand_Executed() { BaseModelElementViewModel selectedValue = GetPropertyValue() as BaseModelElementViewModel; if (selectedValue != null) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(selectedValue.Element); EventManager.GetEvent<SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } }
/// <summary> /// SelectRelationshipCommand executed; /// </summary> public void SelectRelationshipCommand_Executed() { if (this.SelectedItems.Count == 1) { SerializedDomainClassViewModel classViewModel = this.SelectedItems[0] as SerializedDomainClassViewModel; if (classViewModel != null) if (classViewModel.Parent != null) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(classViewModel.Parent.GetHostedElement()); EventManager.GetEvent<SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } SerializedReferenceRelationshipViewModel refRelViewModel = this.SelectedItems[0] as SerializedReferenceRelationshipViewModel; if (refRelViewModel != null) if (!refRelViewModel.IsInFullSerialization) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(refRelViewModel.SerializationElement); EventManager.GetEvent<SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } } }
/// <summary> /// Navigate To Element Command executed. /// </summary> protected virtual void NavigateToElementCommand_Executed() { if (SelectedObject != null) { ModelElement selectedValue = SelectedObject.Element; if (selectedValue != null) { SelectedItemsCollection col = new SelectedItemsCollection(); col.Add(selectedValue); EventManager.GetEvent<SelectionChangedEvent>().Publish(new SelectionChangedEventArgs(this, col)); } } }