Title: RE: (ROSE) RelocateClass (was: Deleting a RoseItem)
An even "softer" approach would be to log the offending creation event as it occurs and upon the SaveModel event, use the log file to clean up anything the user might not have corrected.
-----Original Message-----
From: "G�ntsch, Alexander" [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 6:52 AM
To: 'Brian Mclean'; 'Rose Forum'
Subject: RE: (ROSE) RelocateClass (was: Deleting a RoseItem)

Hi Brian

thank you, you're right: it's silly, but it really does make a difference. Unfortunately even without brackets it still doesn't work the way it should:

While before the was not happening anything at all, now I get the message box twice and, afterwards I have the class twice also: Once in the parent category and once in the trashcategory.

Can you understand this?

>
> Hi
>
> This might not make any difference, but try removing the
> brackets, i.e.
> trashCategory.RelocateClass delclass
> instead of
> trashCategory.RelocateClass (delclass)
>
>  Brian
>
> > -----Original Message-----
> > From:       "G�ntsch, Alexander" [SMTP:[EMAIL PROTECTED]]
> > Sent:       Wednesday, February 20, 2002 4:09 PM
> > To: 'Rose Forum'
> > Subject:    (ROSE) RelocateClass (was: Deleting a RoseItem)
> >
> > Hello,
> > 
> > I'd like to forbid to create new classes in certain cases.
> I've tried to
> > do this by deleting the class after a newModelElement event but rose
> > crashes. That is somewhat comprehensible because I have to
> delete the
> > RoseItem of which afterwards a pointer might still be used.
> Now I try a
> > "softer" solution, i. e. I try to relocate the class in a sort of
> > trashcan.
> > The trashcategory is properly initialized (global), as well as the
> > delclass. But still the RelocateClass doesn't work. The class is
> > afterwards just in the same category where it was created.
> > 
> > Anyone knowing a solution?
> > 
> > 
> > Public Sub OnNewModelElement(objRoseApp As RoseApplication,
> objItem As
> > RoseItem)
> >     Dim retval As Boolean
> >     Dim modellname As String
> >        
> >     interneAenderung = True
> >    
> >     'MsgBox "NewModelElement"
> >     'MsgBox "Neuer Item " + objItem.Name
> >    
> >     If aktuelleAnsicht <> ANSICHT.MODELL Then
> >         Dim delclass As RoseClass
> >         Dim res As VbMsgBoxResult
> >         Dim res2 As Boolean
> >        
> >         res = MsgBox("Bitte wechseln Sie zum Anlegen neuer
> Klassen in die
> > Modellansicht.", vbOKOnly, "Fehler")
> >        
> >         Set delclass =
> >
> objRoseApp.CurrentModel.GetAllClasses.GetWithUniqueID(objItem.
> GetUniqueID)
> >        
> >         trashCategory.RelocateClass (delclass)
> >        
> >     Else
> >         ...
> >     End If
> >    
> >     interneAenderung = False
> >    
> > End Sub
> > 
> >
> > Alexander
> >
>

Reply via email to