本文整理汇总了C#中Affiliation类的典型用法代码示例。如果您正苦于以下问题:C# Affiliation类的具体用法?C# Affiliation怎么用?C# Affiliation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Affiliation类属于命名空间,在下文中一共展示了Affiliation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Link
public static void Link(ActionBy actionBy, Affiliation affiliation)
{
actionBy.Affiliation = affiliation;
actionBy.AffiliationID = affiliation.AffiliationID;
affiliation.ActionBies.Add(actionBy);
}
示例2: getColorForAffiliation
private Color getColorForAffiliation(Affiliation affiliation)
{
switch (affiliation)
{
case Affiliation.Light: return Color.Gold;
case Affiliation.Darkness: return Color.Black;
case Affiliation.Doom: return Color.DarkRed;
default: return Color.White;
}
}
示例3: Scaffold
public void Scaffold()
{
var esdatModel = new ESDATModel();
var mockDb = new Mock<IDbContext>();
var mockDbContext = mockDb.Object;
var duplicateChecker = new ODM2DuplicateChecker(mockDbContext);
var defaultValueProvider = new StaticWQDefaultValueProvider();
var wayToHandleNewData = WayToHandleNewData.ThrowExceptionForNewData;
var results = new List<IResult>();
var mapper = new PersonMapper(duplicateChecker, defaultValueProvider, wayToHandleNewData, results);
var affiliation = new Affiliation();
var person = mapper.Draft(esdatModel);
Assert.AreEqual(defaultValueProvider.DefaultPersonFirstName, person.PersonFirstName);
Assert.AreEqual(defaultValueProvider.DefaultPersonMiddleName, person.PersonMiddleName);
Assert.AreEqual(defaultValueProvider.DefaultPersonLastName, person.PersonLastName);
}
示例4: Update
// Update is called once per frame
void Update () {
if (affiliation != oldAffiliation)
{
switch (affiliation)
{
case Affiliation.Red:
currentMaterial = unitMaterials[(int)Affiliation.Red];
break;
case Affiliation.Green:
currentMaterial = unitMaterials[(int)Affiliation.Green];
break;
case Affiliation.Blue:
currentMaterial = unitMaterials[(int)Affiliation.Blue];
break;
}
renderer.color = currentMaterial;
}
oldAffiliation = affiliation;
}
示例5: GetNewProfilesDefinition
/// <summary>
/// Initialize all of the internal objects inside of the query definition
/// </summary>
/// <returns>A new instance of type QueryDefinition</returns>
public static Profiles GetNewProfilesDefinition()
{
QueryDefinition qd = new QueryDefinition();
Profiles profiles = new Profiles();
Name name = new Name();
name.FirstName = new FirstName();
name.LastName = new LastName();
qd.Name = name;
OutputOptions oo = new OutputOptions();
oo.SortType = OutputOptionsSortType.QueryRelevance;
oo.StartRecord = "0";
Affiliation affiliation = new Affiliation();
AffiliationList affList = new AffiliationList();
//affiliations.AffiliationList = affList;
affList.Affiliation = new List<Affiliation>();
affList.Affiliation.Add(affiliation);
FacultyRankList ftList = new FacultyRankList();
ftList.FacultyRank = new List<string>();
KeywordString kws = new KeywordString();
Keywords kw = new Keywords();
kw.KeywordString = new KeywordString();
kw.KeywordString = kws;
profiles.QueryDefinition = qd;
profiles.QueryDefinition.AffiliationList = affList;
profiles.QueryDefinition.Keywords = kw;
profiles.QueryDefinition.Name = name;
profiles.OutputOptions = oo;
//its hard wired for 2 in this version.
profiles.Version = 2;
return profiles;
}
示例6: CanChangeAffilation
public bool CanChangeAffilation(Affiliation affiliationCurrent, Affiliation affiliationSetting, Affiliation affiliationFrom)
{
if (affiliationFrom == Affiliation.owner)
{
//can change
if (affiliationCurrent != Affiliation.owner)
{
//Can change definitly
return true;
}
}
else if (affiliationFrom == Affiliation.admin)
{
//can change
if (affiliationCurrent != Affiliation.owner || affiliationCurrent != Affiliation.admin)
{
//Can change definitly
return true;
}
}
return false;
}
示例7: AddUnit
/// <summary>
/// This method for calculating the winner of a district.
/// Runs once for each member in a district.
/// </summary>
/// <param name="faction">Faction.</param>
public void AddUnit(int faction)
{
++NumUnits;
rgb[faction]++;
if (rgb [0] > rgb [1] && rgb [0] > rgb [2]) {
winner = Affiliation.Red;
this.gameObject.GetComponent<Renderer> ().material.color = Color.red;
} else if (rgb [1] > rgb [0] && rgb [1] > rgb [2]) {
winner = Affiliation.Green;
this.gameObject.GetComponent<Renderer> ().material.color = Color.green;
} else if (rgb [2] > rgb [0] && rgb [2] > rgb [1]) {
winner = Affiliation.Blue;
this.gameObject.GetComponent<Renderer> ().material.color = Color.blue;
} else {
winner = Affiliation.None;
this.gameObject.GetComponent<Renderer> ().material.color = Color.grey;
}
//Debug.Log (winner);
}
示例8: ChangeAffiliation
private void ChangeAffiliation(Affiliation affiliation, Jid room, Jid user, string nickname, string reason, IqCB cb, object cbArg)
{
var aIq = new AdminIq();
aIq.To = room;
aIq.Type = IqType.set;
agsXMPP.protocol.x.muc.iq.admin.Item itm = new agsXMPP.protocol.x.muc.iq.admin.Item();
itm.Affiliation = affiliation;
if (user != null)
itm.Jid = user;
if (nickname != null)
itm.Nickname = nickname;
if (reason != null)
itm.Reason = reason;
aIq.Query.AddItem(itm);
if (cb == null)
m_connection.Send(aIq);
else
m_connection.IqGrabber.SendIq(aIq, cb, cbArg);
}
示例9: RequestList
public void RequestList(Affiliation affiliation, Jid room, IqCB cb, object cbArg)
{
AdminIq aIq = new AdminIq();
aIq.To = room;
aIq.Type = IqType.get;
aIq.Query.AddItem(new agsXMPP.protocol.x.muc.iq.admin.Item(affiliation));
if (cb == null)
m_connection.Send(aIq);
else
m_connection.IqGrabber.SendIq(aIq, cb, cbArg);
}
示例10: Item
/// <summary>
///
/// </summary>
/// <param name="affiliation"></param>
/// <param name="role"></param>
public Item(Affiliation affiliation, Role role)
: this(affiliation)
{
this.Role = role;
}
示例11: Item
/// <summary>
/// </summary>
/// <param name="affiliation"> </param>
/// <param name="role"> </param>
/// <param name="reason"> </param>
public Item(Affiliation affiliation, Role role, string reason) : this(affiliation, role)
{
Reason = reason;
}
示例12: GetMemeberRole
public Role GetMemeberRole(Affiliation affiliation)
{
Role proposedRole = Role.visitor;
if (Moderated)
{
if (affiliation == Affiliation.owner || affiliation == Affiliation.admin)
{
proposedRole = Role.moderator;
}
else if (affiliation == Affiliation.member)
{
proposedRole = Role.participant;
}
else if (affiliation != Affiliation.outcast)
{
proposedRole = Role.visitor;
}
else
{
proposedRole = Role.none;
}
}
else
{
if (affiliation == Affiliation.owner || affiliation == Affiliation.admin)
{
proposedRole = Role.moderator;
}
else
{
proposedRole = Role.participant;
}
}
return proposedRole;
}
示例13: UpdateMemberInfo
internal void UpdateMemberInfo(Jid jid, Affiliation affiliation, Role role)
{
MucRoomMemberInfo info = GetMemberInfo(jid);
if (info == null)
{
info = new MucRoomMemberInfo();
Members.Add(info);
}
info.Jid = new Jid(jid.Bare);
info.Affiliation = affiliation;
info.Role = role;
Room.SettingsSave();
}
示例14: ChangeAffiliation
/// <summary>
/// </summary>
/// <param name="affiliation">
/// </param>
/// <param name="room">
/// </param>
/// <param name="user">
/// </param>
/// <param name="nickname">
/// </param>
/// <param name="reason">
/// </param>
/// <param name="cb">
/// </param>
/// <param name="cbArg">
/// </param>
private void ChangeAffiliation(Affiliation affiliation,
Jid room,
Jid user,
string nickname,
string reason,
IqCB cb,
object cbArg)
{
AdminIq aIq = new AdminIq();
aIq.To = room;
aIq.Type = IqType.set;
iq.admin.Item itm = new iq.admin.Item();
itm.Affiliation = affiliation;
if (user != null)
{
itm.Jid = user;
}
if (nickname != null)
{
itm.Nickname = nickname;
}
if (reason != null)
{
itm.Reason = reason;
}
aIq.Query.AddItem(itm);
if (cb == null)
{
m_connection.Send(aIq);
}
else
{
m_connection.IqGrabber.SendIq(aIq, cb, cbArg);
}
}
示例15: CanChangeRole
public bool CanChangeRole(Role roleCurrent, Role roleSetting, Role roleFrom, Affiliation affiliationFrom)
{
if (roleFrom == Role.moderator || affiliationFrom == Affiliation.admin || affiliationFrom == Affiliation.owner)
{
//can change
if (roleCurrent != Role.moderator)
{
//Can change definitly
return true;
}
}
return false;
}