No idea about C# or the Godot API under C#. But there is an obvious flaw in the logic of your code. Since the if branch already covers inventory_e==true, the else branch is never entered and Hide is never called.
What you should do is on the action being pressed check if the window is visible. In GDscript there is a member variable named visible. Probably called Visible or something in C#. If this variable is true, then hide the control, else show it.
That all of course assumes you want the action to act as a toggle, which isn't entirely clear from your problem statement.
btw. the etime variable seems redundant.