Example #1
0
 /// <summary>
 /// Cleanup message runtime host.
 /// </summary>
 public static void Cleanup()
 {
     if (host != null)
     {
         host = null;
     }
 }
 /// <summary>
 /// Cleanup message runtime host.
 /// </summary>
 public static void Cleanup()
 {
     if (host != null)
     {
         host = null;
     }
 }
        /// <summary>
        /// Initialize message runtime host.
        /// </summary>
        /// <param name="marshallerTrace">If marshaller 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;
                }
            }
        }
Example #4
0
        /// <summary>
        /// Initialize message runtime host.
        /// </summary>
        /// <param name="marshallerTrace">If marshaller 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;
                }
            }
        }