How to limit user input for a string value to a limited character set? For example, how can I limit users from entering specific characters, say non-pritable non-standard ASCII characters, when attempting to change a string value of a SNMP Device parameter? Is there a way to have a single place in a protocol that defines a valid character set to be used for all, or a subset of, string type parameters? Any way to globally for the entire system, or on a protocol level, to only allow standard pritable ASCII characters and not any extended ASCII or Unicode characters?
Thanks in advance for any advice
Hi,
Filtering out only the ASCII characters will have to be done by a QAction. This functionality can be present in one (precompiled) QAction. Other QActions then import that QAction to be able to call the method. The output of that method will then be the ASCII characters that can then be used to perform the actual SNMP set.
Working with a precompiled QAction has the advantage that the code can be adapted easily, but has the downside that the QAction code is needed in every protocol version. An alternative could be to create a custom class library project that generates a dll and then let all protocol versions import that dll, or that class library project could even be stored on a NuGet store. This way the code is stored and maintained in one place, so if something needs to be changed it only has to be done once and it's not needed to start copy-pasting the content everywhere.
Regards,