Locking Delete of Tags

Anyone know if there a way to create tags in a module that are locked, in the sense that they cannot be deleted except by the module?

I am not really sure I understand this fully, but I would look at implementing my own TagProvider and from there you can probably control everything. Did you try that approach?

Cheers

Nicolas

No I have not. Would my own tag provider allow me to have tags that are not visible to other projects? What are some other benefits of creating my own tag provider?

Robert

[quote=“MoreThanCarbon”]No I have not. Would my own tag provider allow me to have tags that are not visible to other projects? What are some other benefits of creating my own tag provider?
[/quote]

I don’t think you can limit the visibility of the provider to a project, but it looks like you can prevent tags from being deleted, so implementing your own TagProvider might not be the right solution…

Where do you want to limit the visibility? In the designer only (SQLTags browser, when binding properties)?

Actually these might work then. The only reason I wanted to limit visibility was to prevent the tags from being deleted accidentally, since once my module creates them it needs them to function properly. I want the tags to be created and deleted only by the interface that I create. Are there any examples of implementing tag providers?

Creating a full tag provider is quite a bit of work. However, we have another option for modules that simply want to expose data as tags: the SimpleTagProvider. It sounds like this might fit what you want to do well.

It is described in the programmers guide around page 42. As the name suggests, it’s very simple. However, it covers what modules like yours tend to want to do: expose data as tags, driven by the module. The user can’t delete the tags, and they can’t create new ones (in that provider. Of course they can create tags in the normal providers, and reference your tags for expressions and stuff). The user can set up history and alarming on your tags, though. Also, you can set it up to allow users to write values to certain tags.

Check it out and see if it will work for you.

Regards,