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");
}
}