/// <summary>
        /// Get list of standards icons in high definition (if version is >= 2.29)
        /// </summary>
        /// <returns></returns>
        public static List <Image> GetHighDefinitionStandardIcons(
            KeePass.Plugins.IPluginHost iph, int width, int height)
        {
            List <Image> result = null;

            if (TYPE_ImageArchive != null)
            {
                // cf MainForm_Functions.cs line 3234 from KeePass v2.31
                object myArchive = Activator.CreateInstance(TYPE_ImageArchive);
                // type of myArchive should be ImageArchive
                METHOD_ImageArchive_Load.Invoke(
                    myArchive,
                    new object[] { PROPERTYVALUE_Images_Client_HighRes });
                result = (List <Image>)METHOD_ImageArchive_GetImages.Invoke(
                    myArchive,
                    new Object[] { width, height, true });
            }
            else
            {
                System.Windows.Forms.ImageList imgl = iph.MainWindow.ClientIcons;
                ImageList.ImageCollection      ic   = imgl.Images;
                result = new List <Image>();
                for (int i = 0; i < ic.Count; i++)
                {
                    Image img = ResizedImage(ic[i], width, height);
                    result.Add(img);
                }
                return(result);
            }
            return(result);
        }
Esempio n. 2
0
        public override bool Initialize(KeePass.Plugins.IPluginHost host)
        {
            bool ret = base.Initialize(host);

            if (!ret || ReferenceEquals(host, null))
            {
                return(false);
            }

            _host                        = host;
            _windowLogger                = _host.MainWindow.CreateShowWarningsLogger();
            _statusBarLogger             = _host.MainWindow.CreateStatusBarLogger();
            _host.MainWindow.FileSaving += OnDatabaseSaving;

            return(true);
        }
 public PassphraseGenerator(KeePass.Plugins.IPluginHost host)
 {
     this.Host = host;
 }