How to disable "Disconnect library" for Smart Component?

Hi,
I created my own Smart Component with CodeBehind, and now i would like to “lock” it.
Becouse, when I disconnet it, then i am able to edit inside of component (and i dont want that).
I would like to make it same as original ABB smart components, which are not possible to disconnect.

Do you have idea, how it is possible?
Thanks

SmartComponent smartComponent = new SmartComponent();
smartComponent.IsEditable = false;