Ejemplo n.º 1
0
        private void Add(TypeName item)
        {
            var position = item.GetHashCode() & TypeNamesMask;
            var nodes    = _TypeNames[position];

            if (nodes == null)
            {
                _TypeNames[position] = nodes = new TypeNameCollection();
            }
            nodes.Add(item);
        }
Ejemplo n.º 2
0
 public FlyweightFactory()
 {
     GlobalNamespaceName = new GlobalNamespaceName();
     _NamespaceNames     = new NamespaceNameCollection[NamespaceNamesSize];
     _NamespaceNamesMask = _NamespaceNames.Length - 1;
     _TypeNames          = new TypeNameCollection[TypeNamesSize];
     Add(PrimitiveTypeName.@char());
     Add(PrimitiveTypeName.@sbyte());
     Add(PrimitiveTypeName.@short());
     Add(PrimitiveTypeName.@int());
     Add(PrimitiveTypeName.@long());
     Add(PrimitiveTypeName.@byte());
     Add(PrimitiveTypeName.@ushort());
     Add(PrimitiveTypeName.@uint());
     Add(PrimitiveTypeName.@ulong());
     Add(PrimitiveTypeName.@float());
     Add(PrimitiveTypeName.@double());
     Add(PrimitiveTypeName.@decimal());
     Add(PrimitiveTypeName.@bool());
     Add(PrimitiveTypeName.@string());
     Add(PrimitiveTypeName.@object());
     Add(PrimitiveTypeName.@void());
 }