Language: VB.NET
CodeRush Method
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
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

