protected override void clearUp() { subscribeToStructure(false); if (m_disposeStructureOnDispose && m_underlyingStructure != null) m_underlyingStructure.Dispose(); m_underlyingStructure = null; }
public RegStatLineCMTStructure(CMTStructure structure_, bool disposeStructureOnDispose_) : base(structure_.Definition.Description) { m_underlyingStructure = structure_; m_disposeStructureOnDispose = disposeStructureOnDispose_; SetValue(StatLineField.Level, m_underlyingStructure.Value); SetValue(StatLineField.Change, m_underlyingStructure.Change); subscribeToStructure(); }
public CMTStructure GetStructureImpl(Focus focus_, CMTStructureDefinition def_) { if (def_ == null) return null; var key = GetKey(focus_, def_); lock (_instance) { if (m_underlyingCache.ContainsKey(key)) return m_underlyingCache[key]; var o = new CMTStructure(focus_, def_); m_underlyingCache.Add(key, o); return o; } }