protected void _text_ItemTextSelectionChanged(object sender, ItemTextChangedEventArgs e) { if (ItemTextSelectionChanged != null) { ItemTextSelectionChanged(sender, e); } }
protected void _text_ItemTextEnter(object sender, ItemTextChangedEventArgs e) { if (ItemTextEnter != null) { ItemTextEnter(sender, e); } }
protected virtual void OnItemTextSelectionChanged(ItemTextChangedEventArgs e) { if (ItemTextSelectionChanged != null) { ItemTextSelectionChanged(this, e); } }
protected virtual void OnItemTextEnter(ItemTextChangedEventArgs e) { if (ItemTextEnter != null) { ItemTextEnter(this, e); } }
public void OnItemTextSelectionChanged(object sender, ItemTextChangedEventArgs e) { foreach (IndexedListItem ili in this.items) { if (ili.ItemRichTextBox.Name == ((RichTextBox)sender).Name) { this.ItemTextSelectionChanged(ili, e); } } }
public void OnItemTextSelectionChanged(object sender, ItemTextChangedEventArgs e) { foreach(IndexedListItem ili in this.items) { if(ili.ItemRichTextBox.Name == ((RichTextBox)sender).Name) { this.ItemTextSelectionChanged(ili,e); } } }
private void UCList_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { UseCase useCase = (UseCase)this.currentElement; IndexedListItem item = (IndexedListItem)sender; Step step = (Step)useCase.FindStepByUniqueID((String)item.Tag); if(step != null) { step.Description = item.Text; } this.SetModified(true); }
private void tbPostconditions_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { UseCase useCase = (UseCase)this.currentElement; useCase.Postconditions = tbPostconditions.Text; this.SetModified(true); }
private void OnEditableStateChanged(object sender, ItemTextChangedEventArgs e) { Control activeControl; if(sender.GetType() == typeof(IndexedListItem)) { activeControl = (LinkEnabledRTB)e.Item; } else if(sender is Control) { activeControl = (Control)sender; } else { return; } if(activeControl.GetType() == typeof(UseCaseMakerControls.LinkEnabledRTB)) { LinkEnabledRTB rtb = (LinkEnabledRTB)activeControl; if(!rtb.Focused) { return; } if(rtb.SelectionLength == 0) { mnuEditCut.Enabled = false; mnuEditCopy.Enabled = false; } else { mnuEditCut.Enabled = true; mnuEditCopy.Enabled = true; } if(rtb.CanPaste(DataFormats.GetFormat(DataFormats.Text))) { mnuEditPaste.Enabled = true; } else { mnuEditPaste.Enabled = false; } } else if(activeControl.GetType() == typeof(TreeView)) { if(!tvModelBrowser.Focused) { return; } TreeNode dstNode = tvModelBrowser.SelectedNode; TreeNode srcNode; object srcElement, dstElement; if(dstNode == null) { return; } if(model.FindElementByUniqueID((String)dstNode.Tag).GetType() == typeof(Model)) { mnuEditCut.Enabled = false; mnuEditCopy.Enabled = false; } else { mnuEditCut.Enabled = true; } if(Clipboard.GetDataObject().GetDataPresent(typeof(TreeNode))) { srcNode = (TreeNode)Clipboard.GetDataObject().GetData(typeof(TreeNode)); srcElement = model.FindElementByUniqueID((String)srcNode.Tag); dstElement = model.FindElementByUniqueID((String)dstNode.Tag); // Sorgente e destinazione sono lo stesso elemento if(((IIdentificableObject)dstElement).UniqueID == ((IIdentificableObject)srcElement).UniqueID) { mnuEditPaste.Enabled = false;; } if(dstElement.GetType() == typeof(Package) || dstElement.GetType() == typeof(Model)) { if(srcElement.GetType() == typeof(Package)) { mnuEditPaste.Enabled = true; } } else if(dstElement.GetType() == typeof(Actors)) { if(srcElement.GetType() == typeof(Actors)) { mnuEditPaste.Enabled = true; } if(srcElement.GetType() == typeof(Actor)) { mnuEditPaste.Enabled = true; } } else if(dstElement.GetType() == typeof(UseCases)) { if(srcElement.GetType() == typeof(UseCases)) { mnuEditPaste.Enabled = true; } if(srcElement.GetType() == typeof(UseCase)) { mnuEditPaste.Enabled = true; } } } else { mnuEditPaste.Enabled = false; } } tbBtnCut.Enabled = mnuCtxMBCut.Enabled = mnuCtxETCut.Enabled = mnuEditCut.Enabled; tbBtnCopy.Enabled = mnuCtxMBCopy.Enabled = mnuCtxETCopy.Enabled = mnuEditCopy.Enabled; tbBtnPaste.Enabled = mnuCtxMBPaste.Enabled = mnuCtxETPaste.Enabled = mnuEditPaste.Enabled; if(sender.GetType() == typeof(IndexedListItem)) { if(((IndexedListItem)sender).ReadOnly) { tbBtnCut.Enabled = mnuCtxETCut.Enabled = mnuEditCut.Enabled = false; } } }
private void GList_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { Model model = (Model)this.currentElement; IndexedListItem item = (IndexedListItem)sender; GlossaryItem gi = (GlossaryItem)model.GetGlossaryItem((String)item.Tag); if(gi != null) { gi.Description = item.Text; } this.SetModified(true); }
private void tbNotes_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { CommonAttributes attributes = null; if(this.currentElement.GetType() == typeof(Model)) { attributes = ((Model)this.currentElement).Attributes; } if(this.currentElement.GetType() == typeof(Package)) { attributes = ((Package)this.currentElement).Attributes; } if(this.currentElement.GetType() == typeof(Actor)) { attributes = ((Actor)this.currentElement).Attributes; } if(this.currentElement.GetType() == typeof(UseCase)) { attributes = ((UseCase)this.currentElement).Attributes; } attributes.Notes = tbNotes.Text; this.SetModified(true); }
private void OIList_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { UseCase useCase = (UseCase)this.currentElement; IndexedListItem item = (IndexedListItem)sender; OpenIssue openIssue = (OpenIssue)useCase.FindOpenIssueByUniqueID((String)item.Tag); if(openIssue != null) { openIssue.Description = item.Text; } this.SetModified(true); }
private void RList_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { Package package = (Package)this.currentElement; IndexedListItem item = (IndexedListItem)sender; Requirement requirement = (Requirement)package.FindRequirementByUniqueID((String)item.Tag); if(requirement != null) { requirement.Description = item.Text; } this.SetModified(true); }
public void OnEditableStateChanged(object sender, ItemTextChangedEventArgs e) { Control activeControl; if(sender.GetType() == typeof(IndexedListItem)) { activeControl = (LinkEnabledRTB)e.Item; } else if(sender is Control) { activeControl = (Control)sender; } else { return; } if(activeControl.GetType() == typeof(UseCaseMakerControls.LinkEnabledRTB)) { LinkEnabledRTB rtb = (LinkEnabledRTB)activeControl; if(!rtb.Focused) { return; } if(rtb.SelectionLength == 0) { mnuEditCut.Enabled = false; mnuEditCopy.Enabled = false; } else { mnuEditCut.Enabled = true; mnuEditCopy.Enabled = true; } if(rtb.CanPaste(DataFormats.GetFormat(DataFormats.Text))) { mnuEditPaste.Enabled = true; } else { mnuEditPaste.Enabled = false; } } else if(activeControl.GetType() == typeof(TreeView)) { TreeNode dstNode = frmModelBrowser.tvModelBrowser.SelectedNode; TreeNode srcNode; object srcElement, dstElement; if(dstNode == null) { return; } this.currentElement = model.FindElementByUniqueID((String)dstNode.Tag); // Edit menu forced status if (this.currentElement.GetType() == typeof(Model)) { mnuEditCut.Enabled = false; mnuEditCopy.Enabled = false; } else { mnuEditCut.Enabled = true; if(this.currentElement.GetType() == typeof(UseCases) || this.currentElement.GetType() == typeof(Actors)) { if(((IdentificableObjectCollection)this.currentElement).Count == 0) { mnuEditCut.Enabled = false; } } } if (this.currentElement.GetType() == typeof(Model)) { // ToolBar controls tbBtnAddActor.Enabled = false; tbBtnAddPackage.Enabled = true; tbBtnAddUseCase.Enabled = false; tbBtnRemoveActor.Enabled = false; tbBtnRemovePackage.Enabled = false; tbBtnRemoveUseCase.Enabled = false; // Menu items mnuEditAddActor.Enabled = false; mnuEditAddPackage.Enabled = true; mnuEditAddUseCase.Enabled = false; mnuEditRemoveActor.Enabled = false; mnuEditRemovePackage.Enabled = false; mnuEditRemoveUseCase.Enabled = false; if(((Package)this.currentElement).Packages.Count > 0) { mnuEditReorderElements.Enabled = true; } else { mnuEditReorderElements.Enabled = false; } // Model browser context menu items mnuCtxMBAddActor.Enabled = false; mnuCtxMBAddPackage.Enabled = true; mnuCtxMBAddUseCase.Enabled = false; mnuCtxMBRemoveActor.Enabled = false; mnuCtxMBRemovePackage.Enabled = false; mnuCtxMBRemoveUseCase.Enabled = false; if(((Package)this.currentElement).Packages.Count > 0) { mnuCtxMBReorderElements.Enabled = true; } else { mnuCtxMBReorderElements.Enabled = false; } } else if (this.currentElement.GetType() == typeof(Package)) { Package package = (Package)this.currentElement; // ToolBar controls tbBtnAddActor.Enabled = true; tbBtnAddPackage.Enabled = true; tbBtnAddUseCase.Enabled = true; tbBtnRemoveActor.Enabled = false; tbBtnRemovePackage.Enabled = true; tbBtnRemoveUseCase.Enabled = false; // Menu items mnuEditAddActor.Enabled = true; mnuEditAddPackage.Enabled = true; mnuEditAddUseCase.Enabled = true; mnuEditRemoveActor.Enabled = false; mnuEditRemovePackage.Enabled = true; mnuEditRemoveUseCase.Enabled = false; if(((Package)this.currentElement).Packages.Count > 0) { mnuEditReorderElements.Enabled = true; } else { mnuEditReorderElements.Enabled = false; } // Model browser context menu items mnuCtxMBAddActor.Enabled = true; mnuCtxMBAddPackage.Enabled = true; mnuCtxMBAddUseCase.Enabled = true; mnuCtxMBRemoveActor.Enabled = false; mnuCtxMBRemovePackage.Enabled = true; mnuCtxMBRemoveUseCase.Enabled = false; if(((Package)this.currentElement).Packages.Count > 0) { mnuCtxMBReorderElements.Enabled = true; } else { mnuCtxMBReorderElements.Enabled = false; } } else if (this.currentElement.GetType() == typeof(Actors)) { // ToolBar controls tbBtnAddActor.Enabled = true; tbBtnAddPackage.Enabled = false; tbBtnAddUseCase.Enabled = false; tbBtnRemoveActor.Enabled = false; tbBtnRemovePackage.Enabled = false; tbBtnRemoveUseCase.Enabled = false; // Menu items mnuEditAddActor.Enabled = true; mnuEditAddPackage.Enabled = false; mnuEditAddUseCase.Enabled = false; mnuEditRemoveActor.Enabled = false; mnuEditRemovePackage.Enabled = false; mnuEditRemoveUseCase.Enabled = false; if (((Actors)this.currentElement).Count > 0) { mnuEditReorderElements.Enabled = true; } else { mnuEditReorderElements.Enabled = false; } // Model browser context menu items mnuCtxMBAddActor.Enabled = true; mnuCtxMBAddPackage.Enabled = false; mnuCtxMBAddUseCase.Enabled = false; mnuCtxMBRemoveActor.Enabled = false; mnuCtxMBRemovePackage.Enabled = false; mnuCtxMBRemoveUseCase.Enabled = false; if (((Actors)this.currentElement).Count > 0) { mnuCtxMBReorderElements.Enabled = true; } else { mnuCtxMBReorderElements.Enabled = false; } } else if (this.currentElement.GetType() == typeof(UseCases)) { // ToolBar controls tbBtnAddActor.Enabled = false; tbBtnAddPackage.Enabled = false; tbBtnAddUseCase.Enabled = true; tbBtnRemoveActor.Enabled = false; tbBtnRemovePackage.Enabled = false; tbBtnRemoveUseCase.Enabled = false; // Menu items mnuEditAddActor.Enabled = false; mnuEditAddPackage.Enabled = false; mnuEditAddUseCase.Enabled = true; mnuEditRemoveActor.Enabled = false; mnuEditRemovePackage.Enabled = false; mnuEditRemoveUseCase.Enabled = false; if (((UseCases)this.currentElement).Count > 0) { mnuEditReorderElements.Enabled = true; } else { mnuEditReorderElements.Enabled = false; } // Model browser context menu items mnuCtxMBAddActor.Enabled = false; mnuCtxMBAddPackage.Enabled = false; mnuCtxMBAddUseCase.Enabled = true; mnuCtxMBRemoveActor.Enabled = false; mnuCtxMBRemovePackage.Enabled = false; mnuCtxMBRemoveUseCase.Enabled = false; if (((UseCases)this.currentElement).Count > 0) { mnuCtxMBReorderElements.Enabled = true; } else { mnuCtxMBReorderElements.Enabled = false; } } else if (this.currentElement.GetType() == typeof(Actor)) { // ToolBar controls tbBtnAddActor.Enabled = false; tbBtnAddPackage.Enabled = false; tbBtnAddUseCase.Enabled = false; tbBtnRemoveActor.Enabled = true; tbBtnRemovePackage.Enabled = false; tbBtnRemoveUseCase.Enabled = false; // Menu items mnuEditAddActor.Enabled = false; mnuEditAddPackage.Enabled = false; mnuEditAddUseCase.Enabled = false; mnuEditRemoveActor.Enabled = true; mnuEditRemovePackage.Enabled = false; mnuEditRemoveUseCase.Enabled = false; mnuEditReorderElements.Enabled = false; // Model browser context menu items mnuCtxMBAddActor.Enabled = false; mnuCtxMBAddPackage.Enabled = false; mnuCtxMBAddUseCase.Enabled = false; mnuCtxMBRemoveActor.Enabled = true; mnuCtxMBRemovePackage.Enabled = false; mnuCtxMBRemoveUseCase.Enabled = false; mnuCtxMBReorderElements.Enabled = false; } else if (this.currentElement.GetType() == typeof(UseCase)) { // ToolBar controls tbBtnAddActor.Enabled = false; tbBtnAddPackage.Enabled = false; tbBtnAddUseCase.Enabled = false; tbBtnRemoveActor.Enabled = false; tbBtnRemovePackage.Enabled = false; tbBtnRemoveUseCase.Enabled = true; // Menu items mnuEditAddActor.Enabled = false; mnuEditAddPackage.Enabled = false; mnuEditAddUseCase.Enabled = false; mnuEditRemoveActor.Enabled = false; mnuEditRemovePackage.Enabled = false; mnuEditRemoveUseCase.Enabled = true; mnuEditReorderElements.Enabled = false; // Model browser context menu items mnuCtxMBAddActor.Enabled = false; mnuCtxMBAddPackage.Enabled = false; mnuCtxMBAddUseCase.Enabled = false; mnuCtxMBRemoveActor.Enabled = false; mnuCtxMBRemovePackage.Enabled = false; mnuCtxMBRemoveUseCase.Enabled = true; mnuCtxMBReorderElements.Enabled = false; } // Clipboard status control if(Clipboard.GetDataObject().GetDataPresent(typeof(TreeNode))) { srcNode = (TreeNode)Clipboard.GetDataObject().GetData(typeof(TreeNode)); srcElement = model.FindElementByUniqueID((String)srcNode.Tag); dstElement = model.FindElementByUniqueID((String)dstNode.Tag); // Sorgente e destinazione sono lo stesso elemento if(((IIdentificableObject)dstElement).UniqueID == ((IIdentificableObject)srcElement).UniqueID) { mnuEditPaste.Enabled = false;; } if(dstElement.GetType() == typeof(Package) || dstElement.GetType() == typeof(Model)) { if(srcElement.GetType() == typeof(Package)) { mnuEditPaste.Enabled = true; } } else if(dstElement.GetType() == typeof(Actors)) { if(srcElement.GetType() == typeof(Actors)) { mnuEditPaste.Enabled = true; } if(srcElement.GetType() == typeof(Actor)) { mnuEditPaste.Enabled = true; } } else if(dstElement.GetType() == typeof(UseCases)) { if(srcElement.GetType() == typeof(UseCases)) { mnuEditPaste.Enabled = true; } if(srcElement.GetType() == typeof(UseCase)) { mnuEditPaste.Enabled = true; } } } else { mnuEditPaste.Enabled = false; } } tbBtnCut.Enabled = mnuCtxMBCut.Enabled = mnuCtxETCut.Enabled = mnuEditCut.Enabled; tbBtnCopy.Enabled = mnuCtxMBCopy.Enabled = mnuCtxETCopy.Enabled = mnuEditCopy.Enabled; tbBtnPaste.Enabled = mnuCtxMBPaste.Enabled = mnuCtxETPaste.Enabled = mnuEditPaste.Enabled; if(sender.GetType() == typeof(IndexedListItem)) { if(((IndexedListItem)sender).ReadOnly) { tbBtnCut.Enabled = mnuCtxETCut.Enabled = mnuEditCut.Enabled = false; } } }
protected virtual void OnItemTextSelectionChanged(ItemTextChangedEventArgs e) { if(ItemTextSelectionChanged != null) { ItemTextSelectionChanged(this,e); } }
protected void _text_ItemTextSelectionChanged(object sender, ItemTextChangedEventArgs e) { if(ItemTextSelectionChanged != null) { ItemTextSelectionChanged(sender,e); } }
protected void _text_ItemTextEnter(object sender, ItemTextChangedEventArgs e) { if(ItemTextEnter != null) { ItemTextEnter(sender,e); } }
private void OnEditableStateChanged(object sender, ItemTextChangedEventArgs e) { parent.OnEditableStateChanged(sender, e); }
private void SList_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { Model model = (Model)this.currentElement; IndexedListItem item = (IndexedListItem)sender; Stakeholder stakeholder = (Stakeholder)parent.Model.GetStakeholder((String)item.Tag); if(stakeholder != null) { stakeholder.Description = item.Text; } parent.SetModified(true); }
private void tbTriggerDescription_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { UseCase useCase = (UseCase)this.currentElement; useCase.Trigger.Description = tbTriggerDescription.Text; parent.SetModified(true); }
private void tbProse_ItemTextChanged(object sender, ItemTextChangedEventArgs e) { UseCase useCase = (UseCase)this.currentElement; UseCaseMakerControls.LinkEnabledRTB item = (UseCaseMakerControls.LinkEnabledRTB)sender; useCase.Prose = item.Text; this.SetModified(true); }
protected virtual void OnItemTextEnter(ItemTextChangedEventArgs e) { if(ItemTextEnter != null) { ItemTextEnter(this,e); } }