Esempio 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;
		}
Esempio 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;
		}
Esempio n. 3
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="enforceResponse"></param>
		/// <returns></returns>
		public static UIEnforceResponse UIEnforceResponseFromEnforceResponse(EnforceResponse enforceResponse)
		{
			UIEnforceResponse uiEnforceResponse = new UIEnforceResponse(enforceResponse);

			uiEnforceResponse.Initialize();

			return uiEnforceResponse;
		}
Esempio n. 4
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="uiEnforceResponse"></param>
		/// <returns></returns>
		public static EnforceResponse EnforceResponseFromUIEnforceResponse(UIEnforceResponse uiEnforceResponse)
		{
			string reason = string.Empty;

			uiEnforceResponse.Synchronize(out reason);

			return uiEnforceResponse.EnforceResponse;
		}
Esempio n. 5
0
		public MockRequestManager(MethodBase method, UIEnforceResponse response, Request request)
			: this(method, request, null)
		{
			m_uiEnforcerResponse = response;
		}