'Where is ITextBuffer.Properties documented?
As answer to an earlier question, I was told to use a specific entry from an ITextBuffer.Properties
object. Which was a good idea and the right thing to do in this case, but it leads to a new question: Where can one find such information?
More concrete: Is there a description of the entries of ITextBuffer.Properties
somewhere in the web that one can use? I have googled (with DuckDuckGo) and did not find anything.
Solution 1:[1]
This is the "property bag" pattern, i.e. a place for random features to dump random stuff in they might need. It's also needed because there's a lot of times you need to create some extra data object or something processing a ITextBuffer that needs to have the same lifetime as the buffer, so you can stick it in the property bag. Reaching in and grabbing some properties from it is very close to relying on implementation details and is not a generally recommended pattern.
(That said, the previous question's suggestion for ITextDocument is often the way it's done for that specific case...)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jason Malinowski |