private void OnEcasEvent(object sender, EcasRaisingEventArgs e) { if (e.Event.Type.Equals(CopiedEntryInfo)) { checkMaJ(oldEntriesList); File.AppendAllText(pathForLogs, DateTime.Today.ToString("[ dd/MM/yyyy ") + "" + DateTime.Now.ToString("HH:mm:ss ] ") + m_host.MainWindow.GetSelectedEntry(true).Uuid.ToHexString() + " L'entrée a été copiée dans le presse-papier : Title - " + m_host.MainWindow.GetSelectedEntry(true).Strings.ReadSafe(PwDefs.TitleField) + Environment.NewLine); } else if (e.Event.Type.Equals(OpenedDatabaseFile)) { //appel d'une fcontion qui enregistre l'etat actuel de la bdd oldEntriesList = FindLastModEnt(m_host.Database); File.AppendAllText(pathForLogs, DateTime.Today.ToString("[ dd/MM/yyyy ") + "" + DateTime.Now.ToString("HH:mm:ss ] ") + " Ouverture de la Database par " + Environment.MachineName + Environment.NewLine); } else if (e.Event.Type.Equals(ClosingDatabaseFilePost)) { checkMaJ(oldEntriesList); File.AppendAllText(pathForLogs, DateTime.Today.ToString("[ dd/MM/yyyy ") + "" + DateTime.Now.ToString("HH:mm:ss ] ") + " Fermeture de la Database par " + Environment.MachineName + Environment.NewLine); using (ZipFile zip = new ZipFile()) { zip.Password = passwordForLogs; zip.AddFile(pathForLogs); zip.Save(pathForLogs + ".zip"); } //recuperation de l'état actuel de la bdd + comparaison avec celle enregistrée à l'ouverture de la bdd pour voir les différences et les logger EntriesListCompare(oldEntriesList, m_host.MainWindow.GetSelectedEntry(true)); //reste encore à log les ajouts et suppressions d'entrées } }
private void OnEcasEvent(object sender, EcasRaisingEventArgs e) { if (e.Event.Type.EqualsValue(EcasAppLoadPost)) { m_bMainFormLoading = false; } }
private void TriggerSystem_RaisingEvent(object sender, EcasRaisingEventArgs e) { if (e.Event.TypeString == DatabaseOpenedTriggerUuid) { RunTaskInBackground(false); } }
private void TriggerSystem_RaisingEvent(object sender, EcasRaisingEventArgs e) { EcasPropertyDictionary dict = e.Properties; if (dict == null) { Debug.Assert(false); return; } string command = dict.Get <String>(EcasProperty.CommandID); if (command != null && command.Equals(Util.ToolbarConnectBtnId)) { ConnectRDPtoKeePassEntry(false, true); } }
private void TriggerSystem_RaisingEvent(object sender, EcasRaisingEventArgs e) { //Check if the event is our toggle button and toggle the highlights on or off accordingly. EcasPropertyDictionary dict = e.Properties; if (dict == null) { Debug.Assert(false); return; } string command = e.Properties.Get <string>(EcasProperty.CommandID); if (command != null && command.Equals(ToggleBtnCommand)) { _highlightsOn = !_highlightsOn; //Save the scrollbar state so we can restore it. ListView lv = (_host.MainWindow.Controls.Find( "m_lvEntries", true)[0] as ListView); if (lv == null) { Debug.Assert(false); return; } int topIndex = lv.TopItem.Index; if (!_highlightsOn) { _host.MainWindow.RefreshEntriesList(); } _host.MainWindow.UpdateUI(false, null, false, null, true, null, false); //Reset scroll position of the list. lv.TopItem = lv.Items[topIndex]; } }