Exemplo n.º 1
0
        public override bool Initialize(IPluginHost host)
        {
            Terminate();

            if (host == null)
            {
                return(false);
            }
            m_host = host;
            PluginTranslate.Init(this, KeePass.Program.Translation.Properties.Iso6391Code);
            PluginTranslate.TranslationChanged += (o, e) => { PEDCalcValue.SetTranslatedUnits(); };
            Tools.DefaultCaption = PluginTranslate.PluginName;
            Tools.PluginURL      = "https://github.com/rookiestyle/pedcalc/";

            m_iconActive   = GfxUtil.ScaleImage(Resources.pedcalc, DpiUtil.ScaleIntX(16), DpiUtil.ScaleIntY(16));
            m_iconInactive = ToolStripRenderer.CreateDisabledImage(m_iconActive);

            PwEntry.EntryTouched            += OnEntryTouched;
            GlobalWindowManager.WindowAdded += OnWindowAdded;

            Tools.OptionsFormShown += Tools_OptionsFormShown;

            PEDCValueDAO.StartLogging();

            m_host.ColumnProviderPool.Add(m_cp);

            AddMenu();

            return(true);
        }
Exemplo n.º 2
0
 internal static void SavePEDCString(this PwGroup pg, PEDCalcValue days)
 {
     pg.CustomData.Remove(Configuration.DaysField);
     if (days.Inherit)
     {
         pg.CustomData.Remove(Configuration.Interval);
     }
     else
     {
         pg.CustomData.Set(Configuration.Interval, days.ToString());
     }
     PEDCValueDAO.Invalidate(pg);
 }
Exemplo n.º 3
0
 internal static void SavePEDCString(this PwEntry pe, PEDCalcValue days)
 {
     pe.Strings.Remove(Configuration.DaysField);
     if (days.Inherit)
     {
         pe.Strings.Remove(Configuration.Interval);
     }
     else
     {
         pe.Strings.Set(Configuration.Interval, new ProtectedString(false, days.ToString()));
     }
     PEDCValueDAO.Invalidate(pe);
 }
Exemplo n.º 4
0
        public override void Terminate()
        {
            if (m_host == null)
            {
                return;
            }

            m_host.ColumnProviderPool.Remove(m_cp);

            PEDCValueDAO.EndLogging();

            Tools.OptionsFormShown          -= Tools_OptionsFormShown;
            PwEntry.EntryTouched            -= OnEntryTouched;
            GlobalWindowManager.WindowAdded -= OnWindowAdded;

            RemoveMenu();
            PluginDebug.SaveOrShow();

            m_host = null;
        }
Exemplo n.º 5
0
 internal static PEDCalcValue GetPEDValue(this PwEntry pe, bool recursion)
 {
     return(PEDCValueDAO.GetPEDCValue(pe, recursion));
 }
Exemplo n.º 6
0
 public override string GetCellData(string strColumnName, PwEntry pe)
 {
     return(PEDCValueDAO.GetPEDCValueString(pe));
 }