当前位置: 首页>>代码示例>>C#>>正文


C# Affiliation类代码示例

本文整理汇总了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);
        }
开发者ID:kgarsuta,项目名称:Hatfield.EnviroData.DataAcquisition,代码行数:7,代码来源:ODM2EntityLinker.cs

示例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;
     }
 }
开发者ID:supermaximo93,项目名称:SuperFantasticSteampunk,代码行数:10,代码来源:ItemWithAttributes.cs

示例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);
        }
开发者ID:kgarsuta,项目名称:Hatfield.EnviroData.DataAcquisition,代码行数:19,代码来源:PersonMapperTest.cs

示例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;
	}
开发者ID:RIT-SMCS,项目名称:Gerrymander,代码行数:20,代码来源:Unit.cs

示例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;
    }
开发者ID:EricMeeks,项目名称:ProfilesRNSBeta,代码行数:45,代码来源:ProfileHelper.cs

示例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;
 }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:22,代码来源:MucRoomSettings.cs

示例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); 
	}
开发者ID:RIT-SMCS,项目名称:Gerrymander,代码行数:25,代码来源:DistrictCollider2.cs

示例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);
        }
开发者ID:jptoto,项目名称:argsxmpp,代码行数:25,代码来源:MucManager.cs

示例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);
        }
开发者ID:jptoto,项目名称:argsxmpp,代码行数:13,代码来源:MucManager.cs

示例10: Item

 /// <summary>
 /// 
 /// </summary>
 /// <param name="affiliation"></param>
 /// <param name="role"></param>
 public Item(Affiliation affiliation, Role role)
     : this(affiliation)
 {
     this.Role = role;
 }
开发者ID:wraithkings,项目名称:wmtalk,代码行数:10,代码来源:Item.cs

示例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;
 }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:9,代码来源:Item.cs

示例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;
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:36,代码来源:MucRoomSettings.cs

示例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();
 }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:13,代码来源:MucRoomSettings.cs

示例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);
            }
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:57,代码来源:MucManager.cs

示例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;
 }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:13,代码来源:MucRoomSettings.cs


注:本文中的Affiliation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。