コード例 #1
0
        public OpenWithItem(string strFilePath, OwFilePathType tPath,
                            string strName, Image imgIcon, DynamicMenu dynMenu)
        {
            if (strFilePath == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("strFilePath");
            }
            if (strName == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("strName");
            }
            if (dynMenu == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("dynMenu");
            }

            m_strPath = strFilePath;
            m_tPath   = tPath;
            m_strName = strName.Trim();
            m_imgIcon = imgIcon;
            m_dynMenu = dynMenu;

            if (m_strName.Length == 0)
            {
                Debug.Assert(false);
                m_strName = m_strPath;
                if (m_strName.Length == 0)
                {
                    m_strName = KPRes.Unknown;
                }
            }
        }
コード例 #2
0
ファイル: OpenWithMenu.cs プロジェクト: riking/go-keepass2
		public OpenWithItem(string strFilePath, OwFilePathType tPath,
			string strMenuText, Image imgIcon, DynamicMenu dynMenu)
		{
			m_strPath = strFilePath;
			m_tPath = tPath;
			m_strMenuText = strMenuText;
			m_imgIcon = imgIcon;

			m_tsmi = dynMenu.AddItem(m_strMenuText, m_imgIcon, this);

			try { m_tsmi.ToolTipText = m_strPath; }
			catch(Exception) { } // Too long?
		}
コード例 #3
0
ファイル: OpenWithMenu.cs プロジェクト: vacovsky/keepass2
        public OpenWithItem(string strFilePath, OwFilePathType tPath,
                            string strMenuText, Image imgIcon, DynamicMenu dynMenu)
        {
            m_strPath     = strFilePath;
            m_tPath       = tPath;
            m_strMenuText = strMenuText;
            m_imgIcon     = imgIcon;

            m_tsmi = dynMenu.AddItem(m_strMenuText, m_imgIcon, this);

            try { m_tsmi.ToolTipText = m_strPath; }
            catch (Exception) { }            // Too long?
        }
コード例 #4
0
ファイル: OpenWithMenu.cs プロジェクト: eberzosa/KeePass
        public OpenWithItem(string strFilePath, OwFilePathType tPath,
                            string strMenuText, Image imgIcon, DynamicMenu dynMenu)
        {
            if (strFilePath == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("strFilePath");
            }
            if (strMenuText == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("strMenuText");
            }
            if (dynMenu == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("dynMenu");
            }

            m_strPath     = strFilePath;
            m_tPath       = tPath;
            m_strMenuText = strMenuText;
            m_imgIcon     = imgIcon;

            m_tsmi = dynMenu.AddItem(m_strMenuText, m_imgIcon, this);

            try
            {
                string strTip = strFilePath;
                if (strTip.StartsWith("cmd://", StrUtil.CaseIgnoreCmp))
                {
                    strTip = strTip.Substring(6);
                }

                if (strTip.Length != 0)
                {
                    m_tsmi.ToolTipText = strTip;
                }
            }
            catch (Exception) { Debug.Assert(false); }            // Too long?
        }