public void Decrypt( object inputObject ) { object[] inputObjects = ( object[] )inputObject; containerControl = ( Form )inputObjects[ 0 ]; finishedProcessDelegate = ( Delegate )inputObjects[ 1 ]; updateTextDelegate = ( Delegate )inputObjects[ 2 ]; string decryptedString = DecryptString( ( string )inputObjects[ 3 ], ( int )inputObjects[ 4 ], ( string )inputObjects[ 5 ] ); containerControl.Invoke( updateTextDelegate, new object[] { decryptedString } ); containerControl.Invoke( finishedProcessDelegate ); }
public void Encrypt(object inputObject) { var inputObjects = (object[])inputObject; containerControl = (Form)inputObjects[0]; finishedProcessDelegate = (Delegate)inputObjects[1]; updateTextDelegate = (Delegate)inputObjects[2]; string encryptedString = RSA.EncryptString((string)inputObjects[3], (string)inputObjects[4]); containerControl.Invoke(updateTextDelegate, new object[] {encryptedString}); containerControl.Invoke(finishedProcessDelegate); }