Example #1
0
        private void Add(OclAny item)
        {
            int count;

            map.TryGetValue(item, out count);
            map[item] = count + 1;
        }
Example #2
0
 /// <summary>
 /// Get CultureInfo specified by OCL locale name
 /// </summary>
 /// <param name="name">OCL locale name (example: 'en_US')</param>
 /// <returns>The requested culture.</returns>
 public static System.Globalization.CultureInfo GetLocale(OclString name)
 {
     if (OclAny.IsNull(name))
     {
         throw new ArgumentNullException();
     }
     return(System.Globalization.CultureInfo.GetCultureInfo(((string)name).Replace('_', '-')));
 }
Example #3
0
 public static T OclUnwrap <T>(this OclObject o)
     where T : class
 {
     if (OclAny.IsNull(o))
     {
         return(null);
     }
     return(OclObject.Get <T>(o));
 }
Example #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 21;
         foreach (KeyValuePair <OclAny, int> pair in map)
         {
             OclAny item = pair.Key;
             hash += pair.Value * (IsNull(item) ? 0 : item.GetHashCode());
         }
         return(hash);
     }
 }
 public OclCollectionLiteralPartItem(OclAny to)
 {
     this.item = to;
 }
Example #6
0
 public static TuplePart Part(string name, OclAny value)
 {
     return(new TuplePart {
         name = name, type = null, value = value
     });
 }
Example #7
0
 public static TuplePart Part(string name, OclClassifier type, OclAny value)
 {
     return(new TuplePart {
         name = name, type = type, value = value
     });
 }
Example #8
0
 private bool Contains(OclAny item)
 {
     return(map.ContainsKey(item));
 }
Example #9
0
 internal static bool IsNull(OclAny o)
 {
     return(object.ReferenceEquals(o, null));
 }
Example #10
0
 public OclBoolean op_Equality(OclAny b)
 {
     return((OclBoolean)Equals(b));
 }