1 /* 2 KeePass Password Safe - The Open-Source Password Manager 3 Copyright (C) 2003-2021 Dominik Reichl <dominik.reichl@t-online.de> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 20 using System; 21 using System.Collections.Generic; 22 using System.Diagnostics; 23 using System.Drawing; 24 using System.Text; 25 using System.Windows.Forms; 26 27 namespace KeePass.UI 28 { 29 public sealed class CustomContextMenuEx : ContextMenu 30 { CustomContextMenuEx()31 public CustomContextMenuEx() : base() { } 32 ShowEx(Control cParent)33 public void ShowEx(Control cParent) 34 { 35 if(cParent == null) { Debug.Assert(false); return; } 36 37 if(cParent.RightToLeft == RightToLeft.Yes) 38 { 39 this.RightToLeft = RightToLeft.Yes; 40 Show(cParent, new Point(cParent.Width, cParent.Height), 41 LeftRightAlignment.Left); 42 } 43 else Show(cParent, new Point(0, cParent.Height)); 44 } 45 } 46 } 47