Exemplo n.º 1
0
 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;
        }
Exemplo n.º 3
0
 public AttributeInfo(string name, string value, AttributeOrderRule orderRule)
 {
     Name = name;
     Value = value;
     IsMarkupExtension = MarkupExtensionPattern.IsMatch(value);
     _orderRule = orderRule;
 }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 public AttributeInfo(string name, string value, AttributeOrderRule orderRule, MarkupExtension markupExtension)
 {
     Name            = name;
     Value           = value;
     OrderRule       = orderRule;
     MarkupExtension = markupExtension;
 }
Exemplo n.º 6
0
 public AttributeInfo(string name, string value, AttributeOrderRule orderRule, MarkupExtension markupExtension)
 {
     Name = name;
     Value = value;
     OrderRule = orderRule;
     MarkupExtension = markupExtension;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }