CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: VB.NET

CodeRush Method

145 Views
Copy Code Show/Hide Line Numbers
Private Sub XPOSimplifier_Execute(ByVal Sender As Object, ByVal ea As ApplyContentEventArgs)
    ' This method is executed when the system executes your Code 
    If CodeRush.Source.ActiveClass IsNot Nothing Then
        Dim FieldClass As LanguageElement = Nothing
        Dim FieldProperty As LanguageElement = Nothing
        Dim Searcher As ElementEnumerable
        Dim element As IEnumerator(Of LanguageElement)
 
        Searcher = New ElementEnumerable(CodeRush.Source.ActiveClass, GetType([Class]), True)
        element = Searcher.GetEnumerator
        element.Reset()
        While element.MoveNext
            If element.Current.ClassName = "FieldClass" Then
                FieldClass = element.Current
                Exit While
            End If
        End While
 
        If FieldClass Is Nothing Then
            'TODO: Workout how to create a class ;)
            'Need to create the Shared Class
            'then assign it to the FieldClass variable
        End If
 
        Searcher = New ElementEnumerable(CodeRush.Source.ActiveClass, GetType([Property]), True)
        element = Searcher.GetEnumerator
        element.Reset()
        While element.MoveNext
            If element.Current.Name = CodeRush.Source.ActiveProperty.Name Then
                FieldProperty = element.Current
                Exit While
            End If
        End While
 
        If FieldProperty IsNot Nothing Then
            'TODO: workout how to blow away the property
            'set the fieldproperty back to nothing 
        End If
 
        'TODO: make a new property
 
 
 
    End If
End Sub
by AussieALF
  March 18, 2010 @ 8:26am

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate