public AttributeInfo(string name, string value, AttributeOrderRule orderRule)
 {
     Name              = name;
     Value             = value;
     IsMarkupExtension = MarkupExtensionPattern.IsMatch(value);
     _orderRule        = orderRule;
 }
        private AttributeOrderRules Populate(string option, AttributeTokenTypeEnum tokenType)
        {
            if (!String.IsNullOrWhiteSpace(option))
            {
                int priority = 1;

                string[] attributeNames = option.Split(',')
                    .Where(x => !String.IsNullOrWhiteSpace(x))
                    .Select(x => x.Trim())
                    .ToArray();

                foreach (string attributeName in attributeNames)
                {
                    _internalDictionary[attributeName] = new AttributeOrderRule
                                                             {
                                                                 AttributeTokenType = tokenType,
                                                                 Priority = priority
                                                             };

                    priority++;
                }
            }

            return this;
        }
Beispiel #3
0
 public AttributeInfo(string name, string value, AttributeOrderRule orderRule)
 {
     Name = name;
     Value = value;
     IsMarkupExtension = MarkupExtensionPattern.IsMatch(value);
     _orderRule = orderRule;
 }
Beispiel #4
0
        private AttributeOrderRules Populate(string option, AttributeTokenTypeEnum tokenType)
        {
            if (!String.IsNullOrWhiteSpace(option))
            {
                int priority = 1;

                string[] attributeNames = option.Split(',')
                                          .Where(x => !String.IsNullOrWhiteSpace(x))
                                          .Select(x => x.Trim())
                                          .ToArray();

                foreach (string attributeName in attributeNames)
                {
                    _internalDictionary[attributeName] = new AttributeOrderRule
                    {
                        AttributeTokenType = tokenType,
                        Priority           = priority
                    };

                    priority++;
                }
            }

            return(this);
        }
Beispiel #5
0
 public AttributeInfo(string name, string value, AttributeOrderRule orderRule, MarkupExtension markupExtension)
 {
     Name            = name;
     Value           = value;
     OrderRule       = orderRule;
     MarkupExtension = markupExtension;
 }
 public AttributeInfo(string name, string value, AttributeOrderRule orderRule, MarkupExtension markupExtension)
 {
     Name = name;
     Value = value;
     OrderRule = orderRule;
     MarkupExtension = markupExtension;
 }
Beispiel #7
0
        public AttributeInfo(string name, string value, AttributeOrderRule orderRule)
        {
            Name              = name;
            Value             = value;
            IsMarkupExtension = MarkupExtensionPattern.IsMatch(value);
            OrderRule         = orderRule;

            if (IsMarkupExtension)
            {
                MatchCollection mc = MarkupTypePattern.Matches(value);
                foreach (Match m in mc)
                {
                    MarkupExtension = m.Groups["type"].Value;
                }
            }
        }
        public AttributeOrderRule GetRuleFor(string attributeName)
        {
            AttributeOrderRule result;

            if (_internalDictionary.Keys.Contains(attributeName))
            {
                result = _internalDictionary[attributeName];
            }
            else
            {
                AttributeTokenTypeEnum tempAttributeTokenType = attributeName.StartsWith("xmlns") ? 
                    AttributeTokenTypeEnum.OTHER_NAMESPACE : AttributeTokenTypeEnum.OTHER;

                result = new AttributeOrderRule
                             {
                                 AttributeTokenType = tempAttributeTokenType,
                                 Priority = 0
                             };
            }

            return result;
        }
Beispiel #9
0
        public AttributeOrderRule GetRuleFor(string attributeName)
        {
            AttributeOrderRule result;

            if (_internalDictionary.Keys.Contains(attributeName))
            {
                result = _internalDictionary[attributeName];
            }
            else
            {
                AttributeTokenTypeEnum tempAttributeTokenType = attributeName.StartsWith("xmlns") ?
                                                                AttributeTokenTypeEnum.OTHER_NAMESPACE : AttributeTokenTypeEnum.OTHER;

                result = new AttributeOrderRule
                {
                    AttributeTokenType = tempAttributeTokenType,
                    Priority           = 0
                };
            }

            return(result);
        }