/// <summary> /// Event handler when a Business Object is added to the business object collection /// </summary> protected virtual void BusinessObjectCollection_ChildAdded(object sender, BOEventArgs e) { try { IBusinessObjectCollection businessObjectCollection = sender as IBusinessObjectCollection; IBusinessObject businessObject = e.BusinessObject; AddBusinessObjectToCollectionNode(businessObjectCollection, businessObject); } catch (Exception ex) { GlobalRegistry.UIExceptionNotifier.Notify(ex, "", "Error "); } }
/// <summary> /// Event handler when a Business Object is removed to the business object collection /// </summary> protected virtual void BusinessObjectCollection_ChildRemoved(object sender, BOEventArgs e) { try { IBusinessObjectCollection businessObjectCollection = sender as IBusinessObjectCollection; IBusinessObject businessObject = e.BusinessObject; TreeView.SelectedNode = null; RemoveBusinessObjectFromCollectionNode(businessObjectCollection, businessObject); } catch (Exception ex) { GlobalRegistry.UIExceptionNotifier.Notify(ex, "", "Error "); } }
/// <summary> /// This handler is called when a business object has been added to /// the collection - it subsequently adds the item to the ComboBox /// list as well. /// </summary> /// <param name="sender">The object that notified of the change</param> /// <param name="e">Attached arguments regarding the event</param> private void BusinessObjectAddedHandler(object sender, BOEventArgs e) { _comboBox.Items.Add(e.BusinessObject); }
protected override void ObjectID_Updated_Handler(object sender, BOEventArgs e) { base.ObjectID_Updated_Handler(sender, e); _updatedEventCalled = true; }
/// <summary> /// A handler that updates the display when a business object has been /// added to the collection /// </summary> /// <param name="sender">The object that notified of the event</param> /// <param name="e">Attached arguments regarding the event</param> private void BusinessObjectAddedHandler(object sender, BOEventArgs e) { ListView.Items.Add(CreateListViewItem(e.BusinessObject)); }
//TODO _Port: //private void SetupComboBoxRightClickController() //{ // _comboBoxRightClickController = new ComboBoxRightClickController(_comboBox, _collection.ClassDef); // _comboBoxRightClickController.NewObjectCreated += NewComboBoxObjectCreatedHandler; //} //private void NewComboBoxObjectCreatedHandler(IBusinessObject businessObject) //{ // _collection.Add(businessObject); // _comboBox.SelectedItem = businessObject; //} //TODO _Port: /////<summary> ///// The controller used to handle the right-click pop-up form behaviour /////</summary> //public ComboBoxRightClickController ComboBoxRightClickController //{ // get { return _comboBoxRightClickController; } // set { _comboBoxRightClickController = value; } //} /// <summary> /// This handler is called when a business object has been removed from /// the collection - it subsequently removes the item from the ComboBox /// list as well. /// </summary> /// <param name="sender">The object that notified of the change</param> /// <param name="e">Attached arguments regarding the event</param> private void BusinessObjectRemovedHandler(object sender, BOEventArgs e) { _comboBox.Items.Remove(e.BusinessObject); }
private void Grid_OnBusinessObjectSelected(object sender, BOEventArgs e) { if (this.BusinessObjectSelected != null) { this.BusinessObjectSelected(this, e); } }
/// <summary> /// This handler is called when a business object has been removed from /// the collection - it subsequently removes the item from the ListBox /// list as well. /// </summary> /// <param name="sender">The object that notified of the change</param> /// <param name="e">Attached arguments regarding the event</param> private void BusinessObjectRemovedHandler(object sender, BOEventArgs e) { RemoveBOPanel(e.BusinessObject); }
/// <summary> /// Handles the event of a business object being added. Adds a new /// data row containing the object. /// </summary> /// <param name="sender">The object that notified of the event</param> /// <param name="e">Attached arguments regarding the event</param> protected virtual void BOAddedHandler(object sender, BOEventArgs e) { BusinessObject businessObject = (BusinessObject) e.BusinessObject; int rowNum = this.FindRow(e.BusinessObject); if (rowNum >= 0) return; //If row already exists in the datatable then do not add it. LoadBusinessObject(businessObject); }
/// <summary> /// Updates the grid ID column when the Business's ID is changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void IDUpdatedHandler(object sender, BOEventArgs e) { BusinessObject businessObject = (BusinessObject) e.BusinessObject; UpdateBusinessObjectRowValues(businessObject); }
/// <summary> /// Handles the event of a business object being removed. Removes the /// data row that contains the object. /// </summary> /// <param name="sender">The object that notified of the event</param> /// <param name="e">Attached arguments regarding the event</param> protected virtual void RemovedHandler(object sender, BOEventArgs e) { lock (_table.Rows) { int rowNum = this.FindRow(e.BusinessObject); if (rowNum == -1) return; try { this._table.Rows.RemoveAt(rowNum); } catch (Exception) { //IF you hit delete many times in succession then you get an issue with the events interfering and you get a wierd error //This suppresses the error. Console.Write(Xsds.There_was_an_error_in_DataSetProvider_MultipleDelesHit); } } }
private void BusinessObject_OnSaved(object sender, BOEventArgs e) { UpdateIsEditable(); }
private void BusinessObjectUpdatedHandler(object sender, BOEventArgs e) { var businessObject = e.BusinessObject; /* var boToBeUpdated = this.ListView.Items.Cast<ListViewItem>().FirstOrDefault(item => item.Tag == businessObject); */ var listItemToBeUpdated = _listItemsHash[businessObject] as ListViewItem; if (listItemToBeUpdated == null) return; listItemToBeUpdated.Text = businessObject.ToString(); }
/// <summary> /// Event handler when a Business Object is updated in any way. /// </summary> protected virtual void BusinessObject_Updated(object sender, BOEventArgs e) { try { UpdateBusinessObject(e.BusinessObject); } catch (Exception ex) { GlobalRegistry.UIExceptionNotifier.Notify(ex, "", "Error "); } }
/// <summary> /// This handler is called when a business object has been removed from /// the collection - it subsequently removes the item from the ListBox /// list as well. /// </summary> /// <param name="sender">The object that notified of the change</param> /// <param name="e">Attached arguments regarding the event</param> private void BusinessObjectRemovedHandler(object sender, BOEventArgs e) { ITabPage page = GetTabPage(e.BusinessObject); TabControl.Controls.Remove(page); IBusinessObjectControl boControl = this.GetBusinessObjectControl(page); FireTabPageRemoved(page, boControl); }
/// <summary> /// Event handler when a Business Object is deleted /// </summary> protected virtual void BusinessObject_Deleted(object sender, BOEventArgs e) { try { IBusinessObject businessObject = sender as IBusinessObject; RemoveBusinessObjectNode(businessObject); } catch (Exception ex) { GlobalRegistry.UIExceptionNotifier.Notify(ex, "", "Error "); } }
/// <summary> /// This handler is called when a business object has been added to /// the collection - it subsequently adds the item to the ListBox /// list as well. /// </summary> /// <param name="sender">The object that notified of the change</param> /// <param name="e">Attached arguments regarding the event</param> private void BusinessObjectAddedHandler(object sender, BOEventArgs e) { IBusinessObject busObject = e.BusinessObject; if (HasTabPage(busObject))return; AddTabPage(busObject); }
/// <summary> /// This handler is called when a business object has been added to /// the collection - it subsequently adds the item to the ListBox /// list as well. /// </summary> /// <param name="sender">The object that notified of the change</param> /// <param name="e">Attached arguments regarding the event</param> private void BusinessObjectAddedHandler(object sender, BOEventArgs e) { AddBOPanel(e.BusinessObject); }
/// <summary> /// A handler that updates the display when a business object has been /// removed from the collection /// </summary> /// <param name="sender">The object that notified of the event</param> /// <param name="e">Attached arguments regarding the event</param> private void BusinessObjectRemovedHandler(object sender, BOEventArgs e) { var businessObject = e.BusinessObject; var itemToBeRemoved = _listItemsHash[businessObject] as ListViewItem; if (itemToBeRemoved == null) return; ListView.Items.Remove(itemToBeRemoved); }