public CLVComponentNode(MetadataDefinition definition, IGetCLNode componentsLibrary)
            : base()
        {
            if (definition == null)
                throw new ArgumentNullException("definition");
            if (componentsLibrary == null)
                throw new ArgumentNullException("componentsLibrary");

            m_definition = definition;
            m_componentsLibrary = componentsLibrary;

            if (m_definition.Tags != null)
            {
                if (m_definition.Tags.Values.Count == 0)
                {
                    AddTag("Uncategorized");
                }
                else
                {
                    foreach (string tag in m_definition.Tags.Values)
                    {
                        AddTag(tag);
                    }
                }

                m_definition.Tags.TagAdded += OnTagAdded;
                m_definition.Tags.TagRemoved += OnTagRemoved;
            }

            PartialId = m_definition.ID.Substring(m_definition.ID.Length - 5);
        }
Пример #2
0
        public CLVComponentNode(MetadataDefinition definition, IGetCLNode componentsLibrary)
            : base()
        {
            if (definition == null)
            {
                throw new ArgumentNullException("definition");
            }
            if (componentsLibrary == null)
            {
                throw new ArgumentNullException("componentsLibrary");
            }

            m_definition        = definition;
            m_componentsLibrary = componentsLibrary;

            if (m_definition.Tags != null)
            {
                if (m_definition.Tags.Values.Count == 0)
                {
                    AddTag("Uncategorized");
                }
                else
                {
                    foreach (string tag in m_definition.Tags.Values)
                    {
                        AddTag(tag);
                    }
                }

                m_definition.Tags.TagAdded   += OnTagAdded;
                m_definition.Tags.TagRemoved += OnTagRemoved;
            }

            PartialId = m_definition.ID.Substring(m_definition.ID.Length - 5);
        }