/// <summary> /// Cleanup message runtime host. /// </summary> public static void Cleanup() { if (host != null) { host = null; } }
/// <summary> /// Initialize the message runtime host. /// </summary> /// <param name="marshallerTrace">If marshaler tracing is enabled</param> /// <param name="disablevalidation">If validation is disabled</param> public static void Initialize(bool marshallerTrace, bool disablevalidation) { if (host == null) { host = new DefaultRuntimeHost(marshallerTrace, disablevalidation); host.AssertChecker += new EventHandler <MessageLogEventArgs>(HostAssertChecker); host.AssumeChecker += new EventHandler <MessageLogEventArgs>(HostAssumeChecker); host.DebugChecker += new EventHandler <MessageLogEventArgs>(HostDebugChecker); host.MessageLogger += new EventHandler <MessageLogEventArgs>(HostMessageLogger); host.RequirementLogger += new EventHandler <RequirementCaptureEventArgs>(HostRequirementLogger); } else { if (host.marshallerTrace != marshallerTrace) { host.marshallerTrace = marshallerTrace; } if (host.disablevalidation != disablevalidation) { host.disablevalidation = disablevalidation; } } }
/// <summary> /// Initialize the message runtime host. /// </summary> /// <param name="marshallerTrace">If marshaler tracing is enabled</param> /// <param name="disablevalidation">If validation is disabled</param> public static void Initialize(bool marshallerTrace, bool disablevalidation) { if (host == null) { host = new DefaultRuntimeHost(marshallerTrace, disablevalidation); host.AssertChecker += new EventHandler<MessageLogEventArgs>(HostAssertChecker); host.AssumeChecker += new EventHandler<MessageLogEventArgs>(HostAssumeChecker); host.DebugChecker += new EventHandler<MessageLogEventArgs>(HostDebugChecker); host.MessageLogger += new EventHandler<MessageLogEventArgs>(HostMessageLogger); host.RequirementLogger += new EventHandler<RequirementCaptureEventArgs>(HostRequirementLogger); } else { if (host.marshallerTrace != marshallerTrace) { host.marshallerTrace = marshallerTrace; } if (host.disablevalidation != disablevalidation) { host.disablevalidation = disablevalidation; } } }