Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am reading C# code generated by the Microsoft Visual Studio Tools for Office (VSTO) framework, and have run into a case I don't understand. I have simplified it as follows (I have omitted method parameters):
public interface Tools.Factory
RibbonFactory GetRibbonFactory(); // OK
AddIn CreateAddIn(...); // Missing
CustomTaskPaneCollection CreateCustomTaskPaneCollection(...); // Missing
SmartTagCollection CreateSmartTagCollection(...); // Missing
public interface ApplicationFactory : Tools.Factory
SmartTag CreateSmartTag(...); // OK
Action CreateAction(...); // OK
Document GetVstoObject(...); // OK
bool HasVstoObject(...); // OK
public ThisAddIn(ApplicationFactory factory, IServiceProvider serviceProvider) :
base(factory, serviceProvider, "AddIn", "ThisAddIn")
Globals.Factory = factory;
The ThisAddIn
constructor is code automatically generated by VSTO located in a designer.cs file. It is passed an argument (factory
) that implements the ApplicationFactory
interface. Using F12, I tracked down the interface as shown. That interface in return inherits the Tools.Factory
interface, which I have also listed.
What I don't understand: When I trigger IntelliSense in the editor for the Globals.Factory
variable (shown below), I only see five out of the eight methods listed in the two interfaces (commented as OK in the code listing). The implementations of three methods from the Tools.Factory
interface are missing (commented as missing in the code listing). Why is this?
Note: The code works fine.
–
–
–
There are attributes such as EditorBrowsable
that can hide methods and properties from both the designer and IntelliSense.
In this case the methods mentioned exist and can be called, but are hidden.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.