本文整理汇总了C#中ItemCollection.GetItems方法的典型用法代码示例。如果您正苦于以下问题:C# ItemCollection.GetItems方法的具体用法?C# ItemCollection.GetItems怎么用?C# ItemCollection.GetItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemCollection
的用法示例。
在下文中一共展示了ItemCollection.GetItems方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanonicalContainer
public CanonicalContainer(ItemCollection source, EdmTypeConverter converter)
{
this.converter = converter;
this.containers = source.GetItems<EntityContainer>().ToList();
this.entities = new Lazy<ReadOnlyCollection<EntityInfo>>(() =>
this.GetEntities()
.ToList()
.AsReadOnly());
this.associations = new Lazy<ReadOnlyCollection<AssociationInfo>>(() =>
this.GetAssociations()
.ToList()
.AsReadOnly());
}
示例2: GetSubtypesOf
/// <summary>
/// Returns the subtype of the EntityType in the current itemCollection
/// </summary>
public IEnumerable<EntityType> GetSubtypesOf(EntityType type, ItemCollection itemCollection, bool includeAbstractTypes)
{
if (type != null)
{
IEnumerable<EntityType> typesInCollection = itemCollection.GetItems<EntityType>();
foreach (EntityType typeInCollection in typesInCollection)
{
if (type.Equals(typeInCollection) == false && this.IsSubtypeOf(typeInCollection, type))
{
if (includeAbstractTypes || !typeInCollection.Abstract)
{
yield return typeInCollection;
}
}
}
}
}
示例3: ContainsCascadeDeleteAssociation
/// <summary>
/// True if this entity type participates in any relationships where the other end has an OnDelete
/// cascade delete defined, or if it is the dependent in any identifying relationships
/// </summary>
private bool ContainsCascadeDeleteAssociation(ItemCollection itemCollection, EntityType entity)
{
return itemCollection.GetItems<AssociationType>().Where(a =>
((RefType)a.AssociationEndMembers[0].TypeUsage.EdmType).ElementType == entity && IsCascadeDeletePrincipal(a.AssociationEndMembers[1]) ||
((RefType)a.AssociationEndMembers[1].TypeUsage.EdmType).ElementType == entity && IsCascadeDeletePrincipal(a.AssociationEndMembers[0])).Any();
}
示例4: IncomingPackets_EquippedMobAddedEvent
private static void IncomingPackets_EquippedMobAddedEvent(int client, Mobile mobile, ItemCollection equipment)
{
ClientInfo ci;
if (ClientInfoCollection.GetClient(client, out ci))
{
foreach (Item i in equipment.GetItems())
{
mobile.SetLayer((int)i.Layer, i.Serial);
ci.Items.Add(i);
}
PlayerMobile p = ci.Player;
if (p != null && mobile.Serial == p.Serial)
{
p.Status = mobile.myStatus;
p.ID = mobile.myID;
p.X = mobile.myX;
p.Y = mobile.myY;
p.Z = mobile.myZ;
p.Direction = mobile.myDirection;
p.Hue = mobile.myHue;
p.Notoriety = mobile.myNotoriety;
p.myLayerArray = mobile.myLayerArray;
}
else
{
//mobile.Equipment = equipment;
ci.Mobiles.Add(mobile);
}
}
}