本文整理汇总了C#中RelationType类的典型用法代码示例。如果您正苦于以下问题:C# RelationType类的具体用法?C# RelationType怎么用?C# RelationType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RelationType类属于命名空间,在下文中一共展示了RelationType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProvidedAssociationAttribute
public ProvidedAssociationAttribute(string associationName,string providedPropertyName, RelationType relationType,
string attributesFactory) {
_associationName = associationName;
_relationType = relationType;
_attributesFactoryProperty = attributesFactory;
_providedPropertyName = providedPropertyName;
}
示例2: Person
//Constructor
public Person(RelationType theirRelation, MoodType theirMood,
string aName, int theirAffection, int theirTrust)
{
acquaintances = new List<int>();
relation = theirRelation; curMood = theirMood; name = aName;
playerAffection = theirAffection; playerTrust = theirTrust;
}
示例3: RelationAttribute
/// <summary>
/// Constructor de clase
/// </summary>
/// <param name="relationType"><see cref="RelationType"/></param>
/// <param name="targetEntity">Entidad destino de la relación</param>
public RelationAttribute( RelationType relationType, Type targetEntity )
{
Verify.ArgumentNotNull(relationType, "relationType");
Verify.ArgumentNotNull(targetEntity, "relationType");
Type = relationType;
TargetEntity = targetEntity;
}
示例4: DefineRelationshipTo
public Relationship DefineRelationshipTo(Faction otherFaction, RelationType currentRelation)
{
var newRelationship = new Relationship(this, otherFaction, currentRelation);
relationships.Add(otherFaction, newRelationship);
return newRelationship;
}
示例5: Player
public Player(RelationType theirRelation, MoodType theirMood,
string aName, int theirAffection, int theirTrust)
: base(theirRelation, theirMood, aName, theirAffection, theirTrust)
{
energy = 0;
happiness = 0;
GameManager.People.OnChangeStatus += People_OnChangeStatus;
}
示例6: Relationship
public Relationship(Faction fromFaction, Faction toFaction, RelationType currentRelation)
{
this.fromFaction = fromFaction;
this.toFaction = toFaction;
fromFactionName = fromFaction.name;
toFactionName = toFaction.name;
this.currentRelation = currentRelation;
}
示例7: Relation
public Relation(Type left_model, Type right_model,
RelationType relation_type, string left_identifier,
string right_identifier)
{
this.left_model = left_model;
this.right_model = right_model;
this.relation_type = relation_type;
this.left_identifier = left_identifier;
this.right_identifier = right_identifier;
}
示例8: FromBin
public bool is_online; //是否在线
public void FromBin(NetSocket.ByteArray bin)
{
bin.Get_(out char_idx);
char_name = bin.GetStringData((int)twp.app.unit.EUnitLimit.LIMIT_NAME_STR_LENGTH+1);
byte v;
bin.Get_(out v);
relation_type = (RelationType)v;
bin.Get_(out battle_integral);
sbyte isonline;
bin.Get_(out isonline);
is_online = (isonline == 0)? false : true;
}
示例9: RelationDescription
public RelationDescription(String fromPropertyName, RelationType relationType, String toEntityName,
String mappedByPropertyName, IIdMapper idMapper,
IPropertyMapper fakeBidirectionalRelationMapper,
IPropertyMapper fakeBidirectionalRelationIndexMapper, bool insertable) {
this.FromPropertyName = fromPropertyName;
this.RelationType = relationType;
this.ToEntityName = toEntityName;
this.MappedByPropertyName = mappedByPropertyName;
this.IdMapper = idMapper;
this.FakeBidirectionalRelationMapper = fakeBidirectionalRelationMapper;
this.FakeBidirectionalRelationIndexMapper = fakeBidirectionalRelationIndexMapper;
this.Insertable = insertable;
this.Bidirectional = false;
}
示例10: Add
public void Add(GObject target, RelationType relationType, bool usePercent)
{
foreach (RelationItem item in _items)
{
if (item.target == target)
{
item.Add(relationType, usePercent);
return;
}
}
RelationItem newItem = new RelationItem(_owner);
newItem.target = target;
newItem.Add(relationType, usePercent);
_items.Add(newItem);
}
示例11: Relation
public Relation(int Id)
{
using (SqlDataReader dr = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(GlobalSettings.DbDSN, CommandType.Text, "select * from umbracoRelation where id = @id", new SqlParameter("@id", Id)))
{
if(dr.Read())
{
this._id = int.Parse(dr["id"].ToString());
this._parentNode = new CMSNode(int.Parse(dr["parentId"].ToString()));
this._childNode = new CMSNode(int.Parse(dr["childId"].ToString()));
this._relType = RelationType.GetById(int.Parse(dr["relType"].ToString()));
this._comment = dr["comment"].ToString();
this._datetime = DateTime.Parse(dr["datetime"].ToString());
}
}
}
示例12: Relation
/// <summary>
/// creates a new relation between two nodes
/// </summary>
/// <param name="start">classifier where the relation starts</param>
/// <param name="end">classifier where the relation ends</param>
/// <param name="startName">optional name of the start node of the relation</param>
/// <param name="endName">optional name of the end node of the relation</param>
/// <param name="relation">type of the relation</param>
public Relation(
Classifier start,
Classifier end,
RelationType relation = RelationType.Association,
string startName = "",
string endName = "")
{
Requires(start != null);
Requires(end != null);
Start = new StartNode(start,startName);
End = new EndNode(end, endName);
Type = relation;
IsVisible = true;
}
示例13: RelatedEntityInfo
public RelatedEntityInfo(RelationType relationType, string relationName, CodeProperty relationProperty, CodeType relatedEntityType, string relatedEntityPrimaryKeyName, CodeProperty lazyLoadingProperty)
{
if (string.IsNullOrEmpty(relationName)) throw new ArgumentException("'relationName' cannot be null or empty.");
if (relationProperty == null) throw new ArgumentNullException("relationProperty");
if (relatedEntityType == null) throw new ArgumentNullException("relatedEntityType");
if ((relationType == RelationType.Parent) && string.IsNullOrEmpty(relatedEntityPrimaryKeyName)) throw new ArgumentException("'relatedEntityPrimaryKeyName' cannot be null or empty for parent entities.");
RelationType = relationType;
RelationName = relationName;
RelationNamePlural = Pluralize(relationName);
RelationProperty = relationProperty;
RelatedEntityType = relatedEntityType;
RelatedEntityTypeNamePlural = Pluralize(relatedEntityType.Name);
RelatedEntityPrimaryKeyName = relatedEntityPrimaryKeyName;
LazyLoadingProperty = lazyLoadingProperty;
}
示例14: ProfileData
public ProfileData(
string id, string name = null, string iconImageUrl = null, AccountStatus? status = null,
string firstName = null, string lastName = null, string introduction = null, string braggingRights = null,
string occupation = null, string greetingText = null, string nickName = null, RelationType? relationship = null,
GenderType? genderType = null, LookingFor lookingFor = null, EmploymentInfo[] employments = null,
EducationInfo[] educations = null, ContactInfo[] contactsInHome = null, ContactInfo[] contactsInWork = null,
UrlInfo[] otherProfileUrls = null, UrlInfo[] contributeUrls = null, UrlInfo[] recommendedUrls = null,
string[] placesLived = null, string[] otherNames = null,
ProfileUpdateApiFlag loadedApiTypes = ProfileUpdateApiFlag.Unloaded,
DateTime? lastUpdateLookupProfile = null, DateTime? lastUpdateProfileGet = null)
{
if (id == null)
throw new ArgumentNullException("ProfileDataの引数idをnullにする事はできません。");
//idが数字になるならばProfileIdとして正しい。違うならばG+を始めていないアカウントのEMailAddressと見なす
//また、スタブモード時は先頭に"Id"の2文字が入るため、テストコード用に先頭2文字を省いてParse()する。
double tmp;
if (status == AccountStatus.Active && double.TryParse(id.Substring(2), out tmp) == false)
throw new ArgumentException("ProfileDataの引数idがメアド状態で引数statusをActiveにする事はできません。");
LoadedApiTypes = loadedApiTypes;
Status = status;
Id = id;
Name = name;
FirstName = firstName;
LastName = lastName;
Introduction = introduction;
BraggingRights = braggingRights;
Occupation = occupation;
GreetingText = greetingText;
NickName = nickName;
IconImageUrl = iconImageUrl;
Relationship = relationship;
Gender = genderType;
LookingFor = lookingFor;
Employments = employments;
Educations = educations;
ContactsInHome = contactsInHome;
ContactsInWork = contactsInWork;
OtherProfileUrls = otherProfileUrls;
ContributeUrls = contributeUrls;
RecommendedUrls = recommendedUrls;
PlacesLived = placesLived;
OtherNames = otherNames;
LastUpdateLookupProfile = lastUpdateLookupProfile ?? DateTime.MinValue;
LastUpdateProfileGet = lastUpdateProfileGet ?? DateTime.MinValue;
}
示例15: Add
/// <summary>
///
/// </summary>
/// <param name="target"></param>
/// <param name="relationType"></param>
/// <param name="usePercent"></param>
public void Add(GObject target, RelationType relationType, bool usePercent)
{
int cnt = _items.Count;
for (int i = 0; i < cnt; i++)
{
RelationItem item = _items[i];
if (item.target == target)
{
item.Add(relationType, usePercent);
return;
}
}
RelationItem newItem = new RelationItem(_owner);
newItem.target = target;
newItem.Add(relationType, usePercent);
_items.Add(newItem);
}