Visual Studio Development Bookmark and Share   
 index > Visual Studio Extensibility > FileCodeModel and CodeModel
 

FileCodeModel and CodeModel

Hi,

This is a basic question but nevertheless...

I would like some clarification/explanation on the differences or relation between FileCodeModel and CodeModel interfaces.

Do they complement each other or does one have an advantage over the other?

Just how are the related?

audipen  17 hours 50 minutes ago
FileCodeModel belongs to a file (EnvDTE.ProjectItem) and it allows you to examine the code elements of a file.

CodeModel belongs to a project (EnvDTE.Project) and it allows you to examine all the code elements of your project.

Depending on the needs of your add-in, you may want to use one or the other... for example, to populate the comboboxes on top of the code editor window you would use FileCodeModel, but to populate the Class View toolwindow you would use CodeModel.
MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about VS extensibility: http://msmvps.com/blogs/carlosq/
Carlos Quintero - MVP  1 hour 28 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• wrong icon size/resolution ..howto change?
• Visual Studio AddIn...
• Toolbox items in a DSL
• Toolbox item tooltips don't show up reliably
• rebuilding the code model
• WarnedOldMSSCCIProvider
• Why VS Package can't work without SDK installed
• Howto determine the startup form of a project?
• How to implement Refresh on an IVsUIHierarchy?
• VS2005 - FTP WebSite Project is not of type IVsSccProject2 - Not able get list of files to be managed by any SCC provider