So you want to show your own form instead standard attributes form? You can show it in your plugin instead calling layer.ShowAttribute(). It is the easiest way.
There is another, but a bit more complex way - layer.ShowAttribute() internally uses Legend.SharedEventHandlers.FeatureLayerActions which has method ShowAttributes(). So you need to set Legend.SharedEventHandlers.FeatureLayerActions with your own implementation.
There is another, but a bit more complex way - layer.ShowAttribute() internally uses Legend.SharedEventHandlers.FeatureLayerActions which has method ShowAttributes(). So you need to set Legend.SharedEventHandlers.FeatureLayerActions with your own implementation.