public static FacetCheckResult Check(string s, FacetInfo facet, WhitespaceType whitespace) { return FacetCheckResult.Success; }
public static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization) { if (LengthFacetCheckHelper.ComputeLength(value, whitespaceNormalization) >= facet.intValue) return FacetCheckResult.Success; return FacetCheckResult.Fail; }
public static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization) { if (LengthFacetCheckHelper.IsEqual(value, facet.stringValue, whitespaceNormalization)) return FacetCheckResult.EnumSuccess; return FacetCheckResult.EnumFail; }
string[] GetAllFacets(FacetInfo[] facets, string name) { System.Collections.ArrayList result = new System.Collections.ArrayList(); if (facets != null) { foreach (FacetInfo facet in facets) { if (facet.facetName == name) result.Add(facet.stringValue); } } if (result.Count > 0) return (string[]) result.ToArray(typeof(string)); return null; }
static string GetFacetString(FacetInfo[] facets, string facetName) { if (facets == null) return null; foreach (FacetInfo facet in facets) { if (facet.facetName == facetName) return facet.stringValue; } return null; }
static int GetFacetIntFallback(FacetInfo[] facets, string facetName, string fallbackName, int defaultValue) { if (facets == null) return defaultValue; int value = defaultValue; foreach (FacetInfo facet in facets) { if (facet.facetName == facetName) return facet.intValue; if (fallbackName != null && facet.facetName == fallbackName) value = facet.intValue; } return value; }