Beispiel #1
0
 public static FacetCheckResult Check(string s, FacetInfo facet, WhitespaceType whitespace)
 {
     return FacetCheckResult.Success;
 }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
		}
Beispiel #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;
		}
Beispiel #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;
		}