///--------------------------------------------------------------------------------
        /// <summary>This method processes the delete RelationshipProperty command.</summary>
        ///--------------------------------------------------------------------------------
        public void ProcessDeleteRelationshipPropertyCommand()
        {
            RelationshipPropertyEventArgs message = new RelationshipPropertyEventArgs();

            message.RelationshipProperty = RelationshipProperty;
            message.RelationshipID       = RelationshipID;
            message.Solution             = Solution;
            message.WorkspaceID          = WorkspaceID;
            Mediator.NotifyColleagues <RelationshipPropertyEventArgs>(MediatorMessages.Command_DeleteRelationshipPropertyRequested, message);
        }
        ///--------------------------------------------------------------------------------
        /// <summary>This method sends the edit item performed message to have the
        /// update applied.</summary>
        ///--------------------------------------------------------------------------------
        public void SendEditRelationshipPropertyPerformed()
        {
            RelationshipPropertyEventArgs message = new RelationshipPropertyEventArgs();

            message.RelationshipProperty = RelationshipProperty;
            message.RelationshipID       = RelationshipID;
            message.Solution             = Solution;
            message.WorkspaceID          = WorkspaceID;
            Mediator.NotifyColleagues <RelationshipPropertyEventArgs>(MediatorMessages.Command_EditRelationshipPropertyPerformed, message);
        }
        ///--------------------------------------------------------------------------------
        /// <summary>This method applies relationship deletes.</summary>
        ///--------------------------------------------------------------------------------
        public void ProcessDeleteRelationshipPerformed(RelationshipEventArgs data)
        {
            try
            {
                bool isItemMatch = false;
                if (data != null && data.Relationship != null)
                {
                    foreach (RelationshipViewModel item in Relationships.ToList <RelationshipViewModel>())
                    {
                        if (item.Relationship.RelationshipID == data.Relationship.RelationshipID)
                        {
                            // remove item from tabs, if present
                            WorkspaceEventArgs message = new WorkspaceEventArgs();
                            message.ItemID = item.Relationship.RelationshipID;
                            Mediator.NotifyColleagues <WorkspaceEventArgs>(MediatorMessages.Command_CloseItemRequested, message);

                            // delete children
                            for (int i = item.Items.Count - 1; i >= 0; i--)
                            {
                                if (item.Items[i] is RelationshipPropertyViewModel)
                                {
                                    RelationshipPropertyViewModel child        = item.Items[i] as RelationshipPropertyViewModel;
                                    RelationshipPropertyEventArgs childMessage = new RelationshipPropertyEventArgs();
                                    childMessage.RelationshipProperty = child.RelationshipProperty;
                                    childMessage.RelationshipID       = item.Relationship.RelationshipID;
                                    childMessage.Solution             = Solution;
                                    childMessage.WorkspaceID          = child.WorkspaceID;
                                    item.ProcessDeleteRelationshipPropertyPerformed(childMessage);
                                }
                            }

                            // delete item
                            isItemMatch = true;
                            Relationships.Remove(item);
                            Entity.RelationshipList.Remove(item.Relationship);
                            Items.Remove(item);
                            Entity.ResetModified(true);
                            OnUpdated(this, null);
                            break;
                        }
                    }
                    if (isItemMatch == false)
                    {
                        ShowIssue(DisplayValues.Issue_DeleteItemNotFound);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowIssue(ex.Message + ex.StackTrace);
            }
        }
        ///--------------------------------------------------------------------------------
        /// <summary>This method processes the new RelationshipProperty command.</summary>
        ///--------------------------------------------------------------------------------
        public void ProcessNewRelationshipPropertyCommand()
        {
            RelationshipPropertyEventArgs message = new RelationshipPropertyEventArgs();

            message.RelationshipProperty = new RelationshipProperty();
            message.RelationshipProperty.RelationshipPropertyID = Guid.NewGuid();
            message.RelationshipProperty.RelationshipID         = RelationshipID;
            message.RelationshipProperty.Relationship           = Solution.RelationshipList.FindByID((Guid)RelationshipID);
            if (message.RelationshipProperty.Relationship != null)
            {
                message.RelationshipProperty.Order = message.RelationshipProperty.Relationship.RelationshipPropertyList.Count + 1;
            }
            message.RelationshipProperty.Solution = Solution;
            message.RelationshipID = RelationshipID;
            message.Solution       = Solution;
            message.WorkspaceID    = WorkspaceID;
            Mediator.NotifyColleagues <RelationshipPropertyEventArgs>(MediatorMessages.Command_EditRelationshipPropertyRequested, message);
        }