Home

ExplorerItem.Text - Serves 2 purposes

I'm writing a new driver (dynamic data context) and I'm struggling with something.

Within GetSchemaAndBuildAssembly when setting ExplorerItem's Text property, it seems there's no way to supply a string for the explorer tree node that differs from the Enumerable/Queryable property on the context. For my driver this poses an issue:

The actual thing being queried has a name that doesn't conform to .NET type name rules. I'd prefer to display the real name in the tree, but use a different valid c# identifier, derived from the real name, for the enumerable property on the context.

In 2012, a user named Hugo indicated that they would prefer to be able to set a display name value distinct from the property name on the data context. https://forum.linqpad.net/discussion/comment/49/#Comment_49

If I'm missing something, please let me know. I'm going to experiment with nested types in my generated data context.

As an aside: it occurs to me that if the explorer tree is to be so strongly coupled to the data context and it's members, maybe the explorer item list could be generated from attribute types. I may experiment with something like this.

Thanks for any advice!

Comments

Sign In or Register to comment.