private void PageantAgent_MessageReceived(object aSender, Agent.MessageReceivedEventArgs aEventArgs) { var mainWindow = pluginHost.MainWindow; var thread = new Thread( delegate() { mainWindow.Invoke( (MethodInvoker)delegate() { // don't do anything - we are just seeing if the thread is blocked }); }); thread.Name = "Check"; thread.Start(); // only try to unlock databases if main thread is not blocked if (thread.Join(1000)) { mainWindow.Invoke((MethodInvoker)delegate() { if (Options.UnlockOnActivity) { foreach (var document in mainWindow.DocumentManager.Documents) { if (mainWindow.IsFileLocked(document)) { mainWindow.OpenDatabase(document.LockedIoc, null, false); } } } }); } else { thread.Abort(); } }
private void PageantAgent_KeyUsed(object sender, Agent.KeyUsedEventArgs e) { if (Options.ShowBalloon) { var appText = e.OtherProcess == null ? Translatable.NotifyKeyFetchedUnknownApplication : string.Format("{0} ({1})", e.OtherProcess.MainWindowTitle, e.OtherProcess.ProcessName); string notifyText = string.Format(Translatable.NotifyKeyFetched, e.Key.Comment, appText); uiHelper.ShowBalloonNotification(notifyText); } }
private void PageantAgent_Locked(object aSender, Agent.LockEventArgs aEventArgs) { if (Options.ShowBalloon) { string notifyText; if (aEventArgs.IsLocked) { notifyText = Translatable.NotifyLocked; } else { notifyText = Translatable.NotifyUnlocked; } uiHelper.ShowBalloonNotification(notifyText); } }
void mAgent_KeyListChanged(object aSender, Agent.KeyListChangeEventArgs aEventArgs) { // TODO figure out how to invoke Qt UI thread ReloadData (); }
void mAgent_Locked(object aSender, Agent.LockEventArgs aEventArgs) { // TODO figure out how to invoke Qt UI thread UpdateUIState (); }
private void Agent_Locked(object aSender, Agent.LockEventArgs aEventArgs) { UpdateUI(); }
private void mAgent_KeyListChanged(object aSender, Agent.KeyListChangeEventArgs aEventArgs) { ReloadData(); }
public void AddConstraint(Agent.KeyConstraint aConstraint) { if ((aConstraint.Data == null && aConstraint.Type.GetDataType() != null) || (aConstraint.Data != null && aConstraint.Data.GetType() != aConstraint.Type.GetDataType())) { throw new ArgumentException("Malformed constraint", "aConstraint"); } keyConstraints.Add(aConstraint); }
public static bool HasConstraint(this ISshKey aKey, Agent.KeyConstraintType aType) { return aKey.Constraints.Count(c => c.Type == aType) > 0; }
/// <summary> /// Prepends header /// </summary> /// <param name="aMessage">message number to include in header</param> public void InsertHeader(Agent.Message aMessage) { byteList.Insert(0, (byte)aMessage); byte[] blobLength = byteList.Count.ToBytes(); byteList.InsertRange(0, blobLength); }
/// <summary> /// Prepends header /// </summary> /// <param name="aMessage">message number to include in header</param> /// <param name="aHeaderData">data to include in header</param> public void InsertHeader(Agent.Message aMessage, int aHeaderData) { byteList.InsertRange(0, aHeaderData.ToBytes()); InsertHeader(aMessage); }
private void AgentLockHandler(object aSender, Agent.LockEventArgs aArgs) { // Invoke((MethodInvoker)delegate() // { // UpdateVisibility(); // UpdateButtonStates(); // }); }
private void AgentKeyListChangeHandler(object aSender, Agent.KeyListChangeEventArgs aArgs) { // if (IsDisposed) { // return; // } switch (aArgs.Action) { case Agent.KeyListChangeEventAction.Add: Gtk.Application.Invoke(delegate(object aSender1, EventArgs aEventArgs1) { mKeyCollection.AddNode(new KeyNode(aArgs.Key)); UpdateVisibility(); }); break; case Agent.KeyListChangeEventAction.Remove: Gtk.Application.Invoke(delegate(object aSender1, EventArgs aEventArgs1) { var matchFingerprint = aArgs.Key.GetMD5Fingerprint().ToHexString(); var matches = mKeyCollection.Cast<KeyNode>() .Where(k => k.Fingerprint == matchFingerprint); foreach (var keyNode in matches) { mKeyCollection.RemoveNode(keyNode); } UpdateVisibility(); }); break; } }
/// <summary> /// prepares a message with no data /// </summary> private void PrepareSimpleMessage(Agent.Message aMessage) { BlobBuilder builder = new BlobBuilder(); builder.InsertHeader(aMessage); PrepareMessage(builder); }