Exemplo n.º 1
0
 public static string GetCardinalityString(uint lower, UnlimitedInt upper)
 {
     if (lower != upper)
     {
         return(String.Format("{0}..{1}", lower, upper));
     }
     else
     {
         return(lower.ToString());
     }
 }
Exemplo n.º 2
0
 public static bool ParseMultiplicityString(string newCardinality, out uint lower, out UnlimitedInt upper)
 {
     try
     {
         if (newCardinality.Contains(".."))
         {
             int pos = newCardinality.IndexOf("..");
             lower = ParseUint(newCardinality.Substring(0, pos));
             upper = ParseUnlimitedNatural(newCardinality.Substring(pos + 2));
         }
         else
         {
             lower = uint.Parse(newCardinality);
             upper = (UnlimitedInt)lower;
         }
         return(true);
     }
     catch (FormatException)
     {
         lower = 0;
         upper = 0;
         return(false);
     }
 }
Exemplo n.º 3
0
 public static bool IsMultiplicityValid(uint?lower, UnlimitedInt upper)
 {
     return(!lower.HasValue || lower <= upper);
 }