Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Mon, 12 Nov 2007 14:35:01 -0800,    group: microsoft.public.vstudio.extensibility        back       


CodeType.Members collection does not see partial classes?   
I'm trying to automate the process of wrapping a class' properties in the 
implementation of another class.  I thought it was working great, and then I 
noticed some properties were missing.  It looks like the properties are being 
picked up from only one of the two files that implement the partial class 
pieces of my class.

Here's the beginning of my macro:
        Dim ts As TextSelection = TryCast(ActiveDocument.Selection, 
TextSelection)
        If ts Is Nothing Then Return
        Dim classElem As CodeClass = 
TryCast(ts.ActivePoint.CodeElement(vsCMElement.vsCMElementClass), CodeClass)
        Dim varElem As CodeVariable = 
TryCast(ts.ActivePoint.CodeElement(vsCMElement.vsCMElementVariable), 
CodeVariable)
        If classElem Is Nothing Or varElem Is Nothing Then Return
        Dim ifcElem As CodeInterface = Nothing
        If classElem.ImplementedInterfaces.Count > 0 Then
            ifcElem = classElem.ImplementedInterfaces.Item(1)
        End If
        Dim ctyp As CodeType = varElem.Type.CodeType
        Dim buffer As New System.Text.StringBuilder()
        For Each mbr As CodeElement In ctyp.Members

The for loop that began on the last line ends up enumerating properties from 
one of my two files, but not the other.  One of them is generated by the LINQ 
to SQL designer and the other is manually edited code that adds some extra 
properties to wrap some of those provided by the designer.

Is this a bug in VS Extensibility implementation?
date: Mon, 12 Nov 2007 14:35:01 -0800   author:   Benjamin

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us