VsTeXProject.VisualStudio.Project.Automation.OAProperties.AddPropertiesFromType C# (CSharp) Method

AddPropertiesFromType() protected method

Add properties to the collection of properties filtering only those properties which are com-visible and AutomationBrowsable
protected AddPropertiesFromType ( Type targetType ) : void
targetType System.Type The type of NodeProperties the we should filter on
return void
        protected void AddPropertiesFromType(Type targetType)
        {
            Debug.Assert(targetType != null);

            if (targetType == null)
            {
                throw new ArgumentNullException("targetType");
            }

            // If the type is not COM visible, we do not expose any of the properties
            if (!IsComVisible(targetType))
                return;

            // Add all properties being ComVisible and AutomationVisible 
            var propertyInfos = targetType.GetProperties();
            foreach (var propertyInfo in propertyInfos)
            {
                if (!IsInMap(propertyInfo) && IsComVisible(propertyInfo) && IsAutomationVisible(propertyInfo))
                {
                    AddProperty(propertyInfo);
                }
            }
        }