本文整理汇总了C#中Relationship类的典型用法代码示例。如果您正苦于以下问题:C# Relationship类的具体用法?C# Relationship怎么用?C# Relationship使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Relationship类属于命名空间,在下文中一共展示了Relationship类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public Relationship Add(Person person)
{
person.Family = this;
var relationship = new Relationship { A = person };
_relationships.Add(relationship);
return relationship;
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
this.RenderHeader();
this.StripeRows();
cloudRelationship = getCloudRelationship();
if (!Page.IsPostBack)
{
tbIPAddress.Text = GetServerIP();
tbLocalSQL.Text = _siteApi.RequestInformationRef.ConnectionString;
tbLocalSitePath.Text = _siteApi.RequestInformationRef.SitePath;
if (cloudRelationship != null)
{
cloudRelationshipId = cloudRelationship.Id;
tbLocalSitePath.Text = cloudRelationship.LocalSite.SitePath;
tbSQLServer.Text = cloudRelationship.RemoteSite.ConnectionString;
string[] data = cloudRelationship.RemoteSite.Address.Split('|');
tbIPAddress.Text = "";// data[0];
tbBlobStorage.Text = "";//data[1];
tbAccountName.Text = data[1];
tbContainerName.Text = data[0];
tbAccountKey.Text = data[2];
tbCloudDomain.Text = "";//data[5];
}
}
}
示例3: Awake
void Awake()
{
graph = Graph.Instance;
enemyR = new Relationship(RelationshipType.ENEMY);
friendlyR = new Relationship(RelationshipType.FRIEND);
thisEntity = GetComponent<Entity>();
}
示例4: Link
public Link(string name, Relationship relationship, Source source, string target)
{
this.name = name;
this.relationship = relationship;
this.source = source;
this.target = target;
}
示例5: GetRelationship
public Relationship GetRelationship()
{
var relationship = new Relationship(RelationshipName);
relationship.PrimaryEntityRole = Role;
return relationship;
}
示例6: Associate
/// <summary>
/// </summary>
/// <param name="entityName"></param>
/// <param name="entityId"></param>
/// <param name="relationship"></param>
/// <param name="relatedEntities"></param>
/// <exception cref="NotImplementedException"></exception>
public void Associate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)
{
if (this.Original != null)
{
this.Original.Associate(entityName, entityId, relationship, relatedEntities);
}
}
示例7: Disassociate
public virtual void Disassociate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)
{
CapturedInput.EntityId = entityId;
CapturedInput.EntityName = entityName;
CapturedInput.Relationship = relationship;
CapturedInput.RelatedEntities = relatedEntities;
}
示例8: SetRelationsValue
public void SetRelationsValue(Relationship relations)
{
float trustValue = relations.Trust;
string relationshipType = relations.RelationshipState.ToString().ToUpper();
//ButtonText.text = trustValue.ToString("N0");
if (trustValue > 70)
ButtonText.color = Color.green;
else if (trustValue < 30)
ButtonText.color = Color.red;
else
ButtonText.color = Color.yellow;
// set color and text of relationship text
RelationsText.text = relationshipType;
switch (relations.RelationshipState)
{
case Relationship.eRelationshipState.Neutral:
RelationsText.color = Color.white;
break;
case Relationship.eRelationshipState.Allies:
RelationsText.color = Color.green;
break;
case Relationship.eRelationshipState.Friends:
RelationsText.color = Color.green;
break;
case Relationship.eRelationshipState.Superior:
RelationsText.color = new Color(.9f, .67f, .15f); // orange
break;
case Relationship.eRelationshipState.Inferior:
RelationsText.color = Color.yellow;
break;
case Relationship.eRelationshipState.Challenger:
RelationsText.color = Color.magenta;
break;
case Relationship.eRelationshipState.Challengee:
RelationsText.color = Color.yellow;
break;
case Relationship.eRelationshipState.Rivals:
RelationsText.color = Color.red;
break;
case Relationship.eRelationshipState.Vengeance:
RelationsText.color = Color.red;
break;
case Relationship.eRelationshipState.VengeanceUpon:
RelationsText.color = Color.yellow;
break;
case Relationship.eRelationshipState.Vendetta:
RelationsText.color = Color.red;
break;
case Relationship.eRelationshipState.HangerOn:
RelationsText.color = Color.cyan;
break;
case Relationship.eRelationshipState.HungUpon:
RelationsText.color = Color.cyan;
break;
default:
RelationsText.color = Color.white;
break;
}
}
示例9: RelationMap
internal RelationMap(Relationship relationship, string member, string field, string type, string alias, bool queryOnly,
bool lazy, bool cascade, string filter, string sortOrder, string selectSP, CustomProvider provider) : base(member, field)
{
if (type == null || type.Length == 0) {
throw new MappingException("Mapping: Relation type was Missing");
}
if (alias == null || alias.Length == 0) { // Should never happend since alias defaults to member
throw new MappingException("Mapping: Relation alias was Missing");
}
this.fields = field.Replace(", ", ",").Split(',');
this.relationship = relationship;
this.type = type;
this.alias = alias;
this.queryOnly = queryOnly;
this.lazy = lazy;
this.cascade = cascade;
this.filter = filter;
this.sortOrder = sortOrder;
this.selectSP = selectSP;
if (selectSP != null && selectSP.Length > 0) {
for (int index = 0; index < this.fields.Length; index++) {
this.fields[index] = provider.GetParameterDefault(this.fields[index]);
}
}
}
示例10: AtomLink
/// <summary>
/// Represents an <see cref="AtomLink"/> instance initialized with the given <see cref="Uri"/>,
/// title, <see cref="Relationship"/> and <see cref="Type"/>.
/// </summary>
/// <param name="href">The <see cref="Uri"/> of the link.</param>
/// <param name="rel">The <see cref="Relationship"/> of the link.</param>
/// <param name="type">The <see cref="Type"/> of the link.</param>
/// <param name="title">The <see cref="Title"/> of the link.</param>
public AtomLink(Uri href, Relationship rel, MediaType type, string title)
{
this.HRef = href;
this.Title = title;
this.Rel = rel;
this.Type = type;
}
示例11: HistoryWithCastMember
public void HistoryWithCastMember()
{
SetActiveCastMember();
Demo3Character leadCharacter = castLead.GetComponent<Demo3Character>();
Demo3Character activeCharacter = activeCastMember.GetComponent<Demo3Character>();
Relationship checkRelationship = new Relationship(activeRelationshipType);
string text;
if(graph.HaveRelationshipHistory(leadCharacter, activeCharacter, checkRelationship))
{
RelationshipType recentRelationshipType = graph.GetConnection(leadCharacter, activeCharacter).Relationship.RelationshipType;
if (recentRelationshipType == activeRelationshipType)
{
text = "Yes, " + activeCastMember.name + " is my " + activeRelationshipType;
}
else
{
text = "Yes, " + activeCastMember.name + " used to be my " + activeRelationshipType;
}
}
else
{
text = "I have no history like that with " + activeCastMember.name;
}
gs.SetResponse(Responses.MESSAGE, text);
}
示例12: UnderEAControl
public static bool UnderEAControl(Relationship ths)
{
SimDescription simA = ths.SimDescriptionA;
SimDescription simB = ths.SimDescriptionB;
if ((((simA != null) && (simB != null)) && (SimTypes.IsSelectable(simA) || SimTypes.IsSelectable(simB))) && (simA.IsHuman && simB.IsHuman))
{
if ((simA.Service is GrimReaper) || (simB.Service is GrimReaper))
{
return true;
}
else
{
switch (ths.LTR.CurrentLTR)
{
case LongTermRelationshipTypes.Spouse:
case LongTermRelationshipTypes.Fiancee:
return false;
}
if (simA.CanHaveRomanceWith(simB) && simA.CheckAutonomousGenderPreference(simB))
{
return true;
}
}
}
return false;
}
示例13: SetupBase
protected void SetupBase(string resourcePath)
{
loader = new EntityLoader(MockRepository.GenerateStub<IFileController>());
database = new Database("DB1");
table1 = new Table("Table1");
table1.AddColumn(new Column("ID") { Datatype = "int" });
table1.AddColumn(new Column("BasicClass2_Index") { Datatype = "int" });
database.AddEntity(table1);
table2 = new Table("Table2");
table2.AddColumn(new Column("ID") { Datatype = "int" });
table2.AddColumn(new Column("BASIC_CLASS_1_ID"));
database.AddEntity(table2);
tableManyToMany = new Table("Class1Class2");
tableManyToMany.AddColumn(new Column("Class1ID") { Datatype = "int" });
tableManyToMany.AddColumn(new Column("Class2ID") { Datatype = "int" });
database.AddTable(tableManyToMany);
relationship = table1.CreateRelationshipTo(table2);
relationship.PrimaryKey.AddColumn("ID");
relationship.ForeignKey.AddColumn("BASIC_CLASS_1_ID");
// Call we are testing
mappingSet = loader.GetEntities(new[] { Path.Combine("Resources", resourcePath) }, database);
}
示例14: HandleMessage
/// <summary>
/// Accepts IMessage's sent to the GRoup
/// </summary>
/// <param name="message"></param>
/// <returns>true if successfully broadcasted to RelationshipType.MEMBER's</returns>
/// <remarks>
/// Overrides the default HandleMessage Behaviour for Group-like behaviour
/// </remarks>
public override bool HandleMessage(IMessage message)
{
// Check the message type
if (message.GetType() == typeof(StringMessage))
{
// pass the message on
Relationship members = new Relationship(RelationshipType.MEMBER);
// broadcast the message using Graph methods
Connections.Instance.SendMessageTo(this, members, message);
return true;
}
// if it's a connection message, try to learn about the connection
if (message.GetType() == typeof(ConnectionMessage))
{
// convert the message
ConnectionMessage msg = message as ConnectionMessage;
// pass the message
Learn(msg.Connection);
return true;
}
// didn't do anything.
return false;
}
示例15: Association
public Association(string name, Entity parent, Entity child, Relationship relationship, bool isRequired)
: base(name)
{
this.parent = parent;
this.child = child;
this.relationship = relationship;
this.isRequired = isRequired;
}