Ejemplo n.º 1
0
		private EnforceResponse ProcessProtectSimpleResponse(object progressCallback)
		{
			IProgressCallback callback = null;
			try
			{
				lock (m_processingActions)
				{
					m_encryptionManager.AddZipActionEncryptor(m_response);

					int steps = CalculateSteps();
					callback = new TransparentActionProgressCallback((IPolicyClientProgressDialog) progressCallback, steps);

					m_enforcerResponse = CallEnforcer(callback);

                    ResponseAnalyser.CollectAndSendEvents(m_response, ResponseAnalyser.EventType.Action);
					
                    // We need to expand any archives created by the Zip Action, so that the
					// contained documents are correctly referenced by the IFile representation of the zip.
					bool cancelSend;
					m_encryptionManager.AssociateZipActionArchiveWithContent(m_enforcerResponse, m_response, out cancelSend);

					if (!cancelSend)
					{
						m_encryptionManager.ReencryptResponseAttachments(m_enforcerResponse, out cancelSend);
					}

					if (cancelSend)
					{
						m_policyClientDialog.AbortActions = true;
						return m_enforcerResponse;
					}

					m_uiEnforcerResponse = ResponseAdapter.UIEnforceResponseFromEnforceResponse(m_enforcerResponse);
					if (m_uiEnforcerResponse.ContainsAbort)
					{
						m_policyClientDialog.AbortActions = true;
					}
				}
			}
			finally
			{
				IDisposable disp = callback as IDisposable;
				if (disp != null)
				{
					disp.Dispose();
				}
			}
			return m_enforcerResponse;
		}
Ejemplo n.º 2
0
		private EnforceResponse responseDialog_ProcessResponseActions(object sender, ProcessResponseActionsArgs e)
		{
			//if (m_mailItem != null)
			//{
			//    m_mailItem.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olSave);
			//}

			IProgressCallback callback = null;
			try
			{
				lock (m_processingActions)
				{
					m_encryptionManager.AddZipActionEncryptor(m_response);

					int steps = CalculateSteps();

					if (m_uiResponse.ProcessTransparently())
					{
						if (ShowProgress)
						{
							callback = new TransparentActionProgressCallback(m_uiManager, steps);
						}
					}
					else
					{
						callback = new PolicyActionProgressCallback(m_uiManager, steps);
					}

					m_enforcerResponse = CallEnforcer(callback);

                    ResponseAnalyser.CollectAndSendEvents(m_response, ResponseAnalyser.EventType.Action);

					// We need to expand any archives created by the Zip Action, so that the
					// contained documents are correctly referenced by the IFile representation of the zip.
					bool cancelSend;
					m_encryptionManager.AssociateZipActionArchiveWithContent(m_enforcerResponse, m_response, out cancelSend);
					
					if (!cancelSend)
					{
						m_encryptionManager.ReencryptResponseAttachments(m_enforcerResponse, out cancelSend);
					}

					if (cancelSend)
					{
						m_policyClientDialog.AbortActions = true;
						return m_enforcerResponse;
					}

					m_uiEnforcerResponse = ResponseAdapter.UIEnforceResponseFromEnforceResponse(m_enforcerResponse);

					if (m_uiEnforcerResponse.ContainsAbort)
					{
						m_policyClientDialog.AbortActions = true;
					}
				}
			}
			finally
			{
				IDisposable disp = callback as IDisposable;
				if (disp != null)
				{
					disp.Dispose();
				}
			}
			return m_enforcerResponse;
		}