void BeforeChange() { JsonMonitor m = RetrieveMonitor(); if (m != null) { if (m.IsReadOnly) { throw new InvalidOperationException("Marked as read-only"); } m.IsModified = true; } }
public JsonMonitor CreateMonitor() { if (m_Parent != null) { throw new InvalidOperationException("CreateMonitor is only allowed for the root node"); } if (m_Monitor != null) { throw new InvalidOperationException("CreateMonitor must not be called several times"); } m_Monitor = new JsonMonitor(); return(m_Monitor); }