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); }
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; }
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); }