Esempio n. 1
0
        private void Add(OclAny item)
        {
            int count;

            map.TryGetValue(item, out count);
            map[item] = count + 1;
        }
Esempio n. 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('_', '-')));
 }
Esempio n. 3
0
 public static T OclUnwrap <T>(this OclObject o)
     where T : class
 {
     if (OclAny.IsNull(o))
     {
         return(null);
     }
     return(OclObject.Get <T>(o));
 }
Esempio n. 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;
 }
Esempio n. 6
0
 public static TuplePart Part(string name, OclAny value)
 {
     return(new TuplePart {
         name = name, type = null, value = value
     });
 }
Esempio n. 7
0
 public static TuplePart Part(string name, OclClassifier type, OclAny value)
 {
     return(new TuplePart {
         name = name, type = type, value = value
     });
 }
Esempio n. 8
0
 private bool Contains(OclAny item)
 {
     return(map.ContainsKey(item));
 }
Esempio n. 9
0
 internal static bool IsNull(OclAny o)
 {
     return(object.ReferenceEquals(o, null));
 }
Esempio n. 10
0
 public OclBoolean op_Equality(OclAny b)
 {
     return((OclBoolean)Equals(b));
 }