Ejemplo n.º 1
0
        void ActivateAttributes()         //?? lock was used, why?
        {
            if (_context.Stopping != null && _context.Stopping(null))
            {
                //! ensure at least dummy, a caller expects not null
                _attributes = _emptyAttributes;
                return;
            }

            if (_attributes != null)
            {
                return;
            }

            if (_target is ValueType || _target is string)             //rvk "Linear types". Perhaps we need more.
            {
                // no attributes or children
                _attributes      = _emptyAttributes;
                _elements.Target = _emptyElements;
            }
            else if (_target is SuperFile)
            {
                ActivateSuperFileAttributes();
            }
            else if (_target is IDictionary)             //! before ICollection
            {
                ActivateDictionary();
            }
            else if (_target is ICollection)             //! after IDictionary
            {
                ActivateCollection();
            }
            else
            {
                ActivateSimple();
            }
        }