Ejemplo n.º 1
0
 public static FacetCheckResult Check(string s, FacetInfo facet, WhitespaceType whitespace)
 {
     return FacetCheckResult.Success;
 }
Ejemplo n.º 2
0
 public static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization)
 {
     if (LengthFacetCheckHelper.ComputeLength(value, whitespaceNormalization) >= facet.intValue)
         return FacetCheckResult.Success;
     return FacetCheckResult.Fail;
 }
Ejemplo n.º 3
0
 public static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization)
 {
     if (LengthFacetCheckHelper.IsEqual(value, facet.stringValue, whitespaceNormalization))
         return FacetCheckResult.EnumSuccess;
     return FacetCheckResult.EnumFail;
 }
Ejemplo n.º 4
0
		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;
		}
Ejemplo n.º 5
0
		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;
		}
Ejemplo n.º 6
0
		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;
		}