示例#1
0
文件: OclBag.cs 项目: mff-uk/exolutio
        private void Add(OclAny item)
        {
            int count;

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