本文整理汇总了C#中TypedEntity类的典型用法代码示例。如果您正苦于以下问题:C# TypedEntity类的具体用法?C# TypedEntity怎么用?C# TypedEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypedEntity类属于命名空间,在下文中一共展示了TypedEntity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MapTypedEntity
public static TypedEntity MapTypedEntity(XElement xElement)
{
Mandate.ParameterNotNull(xElement, "xElement");
var attribs = new HashSet<TypedAttribute>();
var ordinal = 0;
foreach (var childElement in xElement.Elements().Where(x => !x.HasAttributes))
{
var typedAttribute = new TypedAttribute(new AttributeDefinition()
{
Alias = childElement.Name.LocalName,
Name = childElement.Name.LocalName,
Ordinal = ordinal,
Id = HiveId.Empty
}, childElement.Value)
{
Id = HiveId.Empty
};
attribs.Add(typedAttribute);
ordinal++;
}
var nodeId = (int)xElement.Attribute("id");
var returnValue = new TypedEntity
{
// TODO: Replace provider id with injected value inside UoWFactory
Id = new HiveId("content", "r-xmlstore-01", new HiveIdValue(nodeId))
};
returnValue.Attributes.Reset(attribs);
return returnValue;
}
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:32,代码来源:XmlToModelMapper.cs
示例2: CompositeTypedEntity
public CompositeTypedEntity(TypedEntity entity)
{
Attributes.Clear();
entity.Attributes.ForEach(x => Attributes.Add(x));
RelationProxies.LazyLoadDelegate = entity.RelationProxies.LazyLoadDelegate;
}
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:7,代码来源:CompositeTypedEntity.cs
示例3: GetIdPath_Returns_In_Correct_Order_For_Entities
public void GetIdPath_Returns_In_Correct_Order_For_Entities()
{
//mock hive
IReadonlyEntityRepositoryGroup<IContentStore> readonlyEntitySession;
IReadonlySchemaRepositoryGroup<IContentStore> readonlySchemaSession;
IEntityRepositoryGroup<IContentStore> entityRepository;
ISchemaRepositoryGroup<IContentStore> schemaSession;
var hive = MockHiveManager.GetManager().MockContentStore(out readonlyEntitySession, out readonlySchemaSession, out entityRepository, out schemaSession);
var entity = new TypedEntity {Id = new HiveId(100)};
entityRepository.Get<TypedEntity>(Arg.Any<bool>(), Arg.Any<HiveId[]>()).Returns(new[] {entity});
entityRepository.GetAncestorRelations(new HiveId(100), FixedRelationTypes.DefaultRelationType)
.Returns(new[]
{
new Relation(FixedRelationTypes.DefaultRelationType, new TypedEntity{Id = new HiveId(99)}, entity),
new Relation(FixedRelationTypes.DefaultRelationType, new TypedEntity{Id = new HiveId(98)}, new TypedEntity{Id = new HiveId(99)}),
new Relation(FixedRelationTypes.DefaultRelationType, new TypedEntity{Id = new HiveId(97)}, new TypedEntity{Id = new HiveId(98)}),
});
using (var uow = hive.OpenWriter<IContentStore>())
{
var path = uow.Repositories.GetEntityPath<TypedEntity>(new HiveId(100), FixedRelationTypes.DefaultRelationType);
Assert.AreEqual(new HiveId(97), path.ElementAt(0));
Assert.AreEqual(new HiveId(98), path.ElementAt(1));
Assert.AreEqual(new HiveId(99), path.ElementAt(2));
Assert.AreEqual(new HiveId(100), path.ElementAt(3));
}
}
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:28,代码来源:SessionTests.cs
示例4: CreateTooltipContentsViaTask
/// <summary>
/// Returns the TooltipContents after proxying through the task system to allow developers to modify the output
/// </summary>
/// <param name="ds"></param>
/// <param name="sender"></param>
/// <param name="entity"> </param>
/// <param name="htmlContent"></param>
/// <param name="width"></param>
/// <param name="height"></param>
/// <returns></returns>
public static TooltipContents CreateTooltipContentsViaTask(this INodeSelectorDataSource ds,
object sender,
TypedEntity entity,
string htmlContent,
int width = -1,
int height = -1)
{
var args = new NodeSelectorTooltipEventArgs(entity, htmlContent)
{
Height = height,
Width = width
};
//launch task to modify the contents
ds.FrameworkContext.TaskManager
.ExecuteInContext(
NodeSelectorTaskTriggers.GetTooltipContents,
sender,
new TaskEventArgs(ds.FrameworkContext, args));
return new TooltipContents(args.HtmlContents)
{
Height = args.Height,
Width = args.Width
};
}
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:36,代码来源:NodeSelectorDataSourceExtensions.cs
示例5: EntityVillager
public EntityVillager(TypedEntity e)
: base(e)
{
EntityVillager e2 = e as EntityVillager;
if (e2 != null) {
_profession = e2._profession;
}
}
开发者ID:vfioox,项目名称:ENULib,代码行数:8,代码来源:EntityVillager.cs
示例6: EntityPrimedTnt
public EntityPrimedTnt(TypedEntity e)
: base(e)
{
EntityPrimedTnt e2 = e as EntityPrimedTnt;
if (e2 != null) {
_fuse = e2._fuse;
}
}
开发者ID:StevilKnevil,项目名称:Substrate,代码行数:8,代码来源:EntityPrimedTnt.cs
示例7: EntityFallingSand
public EntityFallingSand(TypedEntity e)
: base(e)
{
EntityFallingSand e2 = e as EntityFallingSand;
if (e2 != null) {
_tile = e2._tile;
}
}
开发者ID:hach-que,项目名称:Substrate,代码行数:8,代码来源:EntityFallingSand.cs
示例8: EntityCreeper
public EntityCreeper(TypedEntity e)
: base(e)
{
EntityCreeper e2 = e as EntityCreeper;
if (e2 != null) {
_powered = e2._powered;
}
}
开发者ID:StevilKnevil,项目名称:Substrate,代码行数:8,代码来源:EntityCreeper.cs
示例9: EntityMinecart
public EntityMinecart (TypedEntity e)
: base(e)
{
EntityMinecart e2 = e as EntityMinecart;
if (e2 != null) {
_type = e2._type;
}
}
开发者ID:tofurama3000,项目名称:Substrate,代码行数:8,代码来源:EntityMinecart.cs
示例10: EntityPigZombie
public EntityPigZombie(TypedEntity e)
: base(e)
{
EntityPigZombie e2 = e as EntityPigZombie;
if (e2 != null) {
_anger = e2._anger;
}
}
开发者ID:vfioox,项目名称:ENULib,代码行数:8,代码来源:EntityPigZombie.cs
示例11: EntityGuardian
public EntityGuardian (TypedEntity e)
: base(e)
{
EntityGuardian e2 = e as EntityGuardian;
if (e2 != null) {
_elder = e2._elder;
}
}
开发者ID:tofurama3000,项目名称:substrate-minecraft,代码行数:8,代码来源:EntityGuardian.cs
示例12: EntityMinecartChest
public EntityMinecartChest (TypedEntity e)
: base(e)
{
EntityMinecartChest e2 = e as EntityMinecartChest;
if (e2 != null) {
_items = e2._items.Copy();
}
}
开发者ID:tofurama3000,项目名称:Substrate,代码行数:8,代码来源:EntityMinecartChest.cs
示例13: EntitySlime
public EntitySlime(TypedEntity e)
: base(e)
{
EntitySlime e2 = e as EntitySlime;
if (e2 != null) {
_size = e2._size;
}
}
开发者ID:vfioox,项目名称:ENULib,代码行数:8,代码来源:EntitySlime.cs
示例14: EntityPig
public EntityPig(TypedEntity e)
: base(e)
{
EntityPig e2 = e as EntityPig;
if (e2 != null) {
_saddle = e2._saddle;
}
}
开发者ID:StevilKnevil,项目名称:Substrate,代码行数:8,代码来源:EntityPig.cs
示例15: EntitySheep
public EntitySheep (TypedEntity e)
: base(e)
{
EntitySheep e2 = e as EntitySheep;
if (e2 != null) {
_sheared = e2._sheared;
_color = e2._color;
}
}
开发者ID:tofurama3000,项目名称:Substrate,代码行数:9,代码来源:EntitySheep.cs
示例16: EntityArrow
public EntityArrow(TypedEntity e)
: base(e)
{
EntityArrow e2 = e as EntityArrow;
if (e2 != null) {
_inData = e2._inData;
_player = e2._player;
}
}
开发者ID:vfioox,项目名称:ENULib,代码行数:9,代码来源:EntityArrow.cs
示例17: EntityEndermite
public EntityEndermite(TypedEntity e)
: base(e)
{
EntityEndermite e2 = e as EntityEndermite;
if (e2 != null) {
_life = e2._life;
_player = e2._player;
}
}
开发者ID:tofurama3000,项目名称:substrate-minecraft,代码行数:9,代码来源:EntityEndermite.cs
示例18: EntityAnimal
public EntityAnimal(TypedEntity e)
: base(e)
{
EntityAnimal e2 = e as EntityAnimal;
if (e2 != null) {
_age = e2._age;
_inLove = e2._inLove;
}
}
开发者ID:vfioox,项目名称:ENULib,代码行数:9,代码来源:EntityAnimal.cs
示例19: EntityChicken
public EntityChicken (TypedEntity e)
: base(e)
{
EntityChicken e2 = e as EntityChicken;
if (e2 != null)
{
_eggTime = e2._eggTime;
}
}
开发者ID:tofurama3000,项目名称:substrate-minecraft,代码行数:9,代码来源:EntityChicken.cs
示例20: EntityBat
public EntityBat(TypedEntity e)
: base(e)
{
EntityBat e2 = e as EntityBat;
if (e2 != null)
{
_flag = e2._flag;
}
}
开发者ID:tofurama3000,项目名称:substrate-minecraft,代码行数:9,代码来源:EntityBat.cs
注:本文中的TypedEntity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论