System.ComponentModel.Design.DesignerOptionService.GetOptionProperty C# (CSharp) Method

GetOptionProperty() private method

Retrieves the property descriptor for the given page / value name. Returns null if the property couldn't be found.
private GetOptionProperty ( string pageName, string valueName ) : PropertyDescriptor
pageName string
valueName string
return PropertyDescriptor
        private PropertyDescriptor GetOptionProperty(string pageName, string valueName)
        {
            if (pageName == null)
            {
                throw new ArgumentNullException(nameof(pageName));
            }

            if (valueName == null)
            {
                throw new ArgumentNullException(nameof(valueName));
            }

            string[] optionNames = pageName.Split(new char[] { '\\' });

            DesignerOptionCollection options = Options;
            foreach (string optionName in optionNames)
            {
                options = options[optionName];
                if (options == null)
                {
                    return null;
                }
            }

            return options.Properties[valueName];
        }