Opc.Ua.Server.Subscription.SetPublishingMode C# (CSharp) Method

SetPublishingMode() public method

Enables/disables publishing for the subscription.
public SetPublishingMode ( OperationContext context, bool publishingEnabled ) : void
context OperationContext
publishingEnabled bool
return void
		public void SetPublishingMode(
            OperationContext context,
			bool             publishingEnabled)
        {
            lock (m_lock)
            {
                // check session.
                VerifySession(context);

                // clear lifetime counter.
                ResetLifetimeCount();

                // update publishing interval.
                if (publishingEnabled != m_publishingEnabled)
                {
                    m_publishingEnabled = publishingEnabled;

                    // update diagnostics
                    lock (m_diagnostics)
                    {
                        m_diagnostics.PublishingEnabled = m_publishingEnabled;

                        if (m_publishingEnabled)
                        {
                            m_diagnostics.EnableCount++;
                        }
                        else
                        {
                            m_diagnostics.DisableCount++;
                        }
                    }
                }     
           
                // TraceState((publishingEnabled)?"ENABLED":"DISABLED");
            }
        }