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


C# Friend类代码示例

本文整理汇总了C#中Friend的典型用法代码示例。如果您正苦于以下问题:C# Friend类的具体用法?C# Friend怎么用?C# Friend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Friend类属于命名空间,在下文中一共展示了Friend类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddFriend

	public void AddFriend(string name)
	{
		Friend friend = new Friend();
		friend.Name = name;
		friends.Add(friend);

	}
开发者ID:reaganq,项目名称:MagnetBots_unity,代码行数:7,代码来源:SocialManager.cs

示例2: AddFriend

 public void AddFriend(Friend f, bool program = false)
 {
     if (!friends.Contains(f, (new FriendsComparer())))
     {
         friends.Add(f);
         TabItem t = new TabItem();
         t.Header = f.NickName;
         MyTabItem m = new MyTabItem(ref f, nickname,program);
         t.Content = m;
         tabControl1.Items.Add(t);
         
         if (!program || tabControl1.Items.Count == 1)
         {
             ((TabItem)tabControl1.Items[tabControl1.Items.Count - 1]).Focus();
             tabControl1.SelectedIndex = tabControl1.Items.Count - 1;
         }
     }
     else
     {
         bool find = false;
         for (int i = 0; i < friends.Count && !find; i++)
         {
             if (friends[i].Thread_Id == f.Thread_Id)
             {
                 find = true;
                 ((TabItem)tabControl1.Items[i]).Focus();                     
             }
         }
     }
     Show();
 }
开发者ID:Chevron94,项目名称:Messager,代码行数:31,代码来源:Dialogs.xaml.cs

示例3: HashSetTest

    // No duplicate entries
    public void HashSetTest()
    {
        Friend chris = new Friend("Chris",10,1230,1);
        Friend john = new Friend("John",5,234,3);
        Friend annie = new Friend("Annie",7,902,2);
        Friend rosy = new Friend("Rosy",1,10,4);

        HashSet<Friend> friend_list = new HashSet<Friend>();
        friend_list.Add(chris);
        friend_list.Add(john);
        friend_list.Add(annie);
        friend_list.Add(rosy);

        StringBuilder str = new StringBuilder();

        foreach(Friend friend in friend_list)
        {
            str.Append("Name: ");str.Append(friend.name);
            str.Append(" / ");
            str.Append("Level: ");str.Append(friend.level);
            str.Append(" / ");
            str.Append("Point: ");str.Append(friend.point);
            str.Append(" / ");
            str.Append("Rank: ");str.Append(friend.rank);
            str.Append("\n");
        }
        textResult.text = str.ToString();
    }
开发者ID:chris-chris,项目名称:Chapter9,代码行数:29,代码来源:CollectionTest.cs

示例4: StartByInvitation

    public void StartByInvitation(Friend friend, OperationCompleteEvent opCompleteEvent, object tag)
    {
        object[] objs = (object[])tag;
        string sbIP = (string)objs[0];
        int sbPort = (int)objs[1];
        string hash = (string)objs[2];
        string sessionID = (string)objs[3];

        try
        {
            Proxy.IConnection conn = this.control.CreateConnection();
            conn.Connect("", 0, sbIP, sbPort, Proxy.ConnectionType.Tcp);
            sbRouter = new MessageRouter(this.protocol, conn, null, null);

            RegisterCodeEvents();

            sbRouter.SendMessage(Message.ConstructMessage("ANS",
                this.settings.Username + " " + hash + " " + sessionID),
                new ResponseReceivedHandler(OnAnswerResponse), opCompleteEvent);
        }
        catch
        {
            opCompleteEvent.Execute(new OperationCompleteArgs("Could not connect", true));
        }
    }
开发者ID:peteward44,项目名称:nbm-messenger,代码行数:25,代码来源:Conversation.cs

示例5: OnClick

    void OnClick()
    {
        var friendContentUIManager = (FriendContentUIManager)FindObjectOfType<FriendContentUIManager>();
        if (friendContentUIManager)
        {
            friendContentUIManager.hideFriendContentWindow();
        }
        string friendName = Title.text;
        long uid = 0;
        Friend f = new Friend();
        List<Friend> applyLsit = MonoInstancePool.getInstance<FriendManager>().applyLsit;
        foreach (Friend friend in applyLsit)
        {
            if (friend.friendName == friendName)
            {
                uid = friend.fiendId;
                f = friend;

            }
        }
		MonoInstancePool.getInstance<FriendManager>().applyLsit.Remove(f);
		MonoInstancePool.getInstance<SendFriendSystemHander>().SendAgreeOrDisagree(uid, true);
		var inviteListUIManager = (InviteListUIManager)FindObjectOfType<InviteListUIManager> ();
		inviteListUIManager.deleteInviteFriendObject (uid);
        //MonoInstancePool.getInstance<FriendManager>().inviteObject.Remove(transform.parent.gameObject);
        //Destroy(transform.parent.gameObject);
        //for(int i =0; i < MonoInstancePool.getInstance<FriendManager>().inviteObject.Count; i++)
        //{
       //     MonoInstancePool.getInstance<FriendManager>().inviteObject[i].transform.localPosition = new Vector3(-370, 90 - (i * 108), 0);
        //}
    }
开发者ID:TrojanFighter,项目名称:U3D-DesignerBehaviorTest1,代码行数:31,代码来源:ClickAgreeCallback.cs

示例6: GetStatusColor

        public Color GetStatusColor(Friend steamid)
        {
            Color inGame = this.settings.Color.StatusIngameFore;
            Color online = this.settings.Color.StatusOnlineFore;
            Color offline = this.settings.Color.StatusOfflineFore;
            Color blocked = this.settings.Color.StatusBlockedFore;
            Color invited = this.settings.Color.StatusInvitedFore;
            Color requesting = this.settings.Color.StatusInvitedBack;

            if (steamid.IsAcceptingFriendship())
            {
                return invited;
            }
            else if (steamid.IsRequestingFriendship())
            {
                return requesting;
            }
            else if (steamid.IsBlocked())
            {
                return blocked;
            }
            else if (steamid.IsInGame())
            {
                return inGame;
            }
            else if (!steamid.IsOnline())
            {
                return offline;
            }
            
            return online;
        }
开发者ID:hekar,项目名称:Vaporized,代码行数:32,代码来源:StatusColor.cs

示例7: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {

            m_FriendUserID = _Request.Get<int>("uid", Method.Get, 0);

            if (_Request.IsClick("shieldfriend"))
            {
                Shield();
                return;
            }

            using (ErrorScope es = new ErrorScope())
            {
                m_FriendToShield = FriendBO.Instance.GetFriend(MyUserID, m_FriendUserID);
                WaitForFillSimpleUser<Friend>(m_FriendToShield);

                if (es.HasUnCatchedError)
                {
                    es.CatchError<ErrorInfo>(delegate(ErrorInfo error)
                    {
                        ShowError(error);
                        return;
                    });
                }
            }

        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:27,代码来源:friend-shield.aspx.cs

示例8: ReadPacket

 public void ReadPacket(PacketReader reader)
 {
     Unknown1 = reader.ReadInt32();
     var count = reader.ReadInt32();
     Friends = new List<Friend>();
     for (int i = 0; i < count; i++)
     {
         Friend friend = new Friend();
         friend.UserID1 = reader.ReadInt64();
         friend.UserID2 = reader.ReadInt64();
         friend.Username = reader.ReadString();
         friend.FacebookID = reader.ReadString();
         friend.Unknown3 = reader.ReadString();
         friend.Unknown4 = reader.ReadInt32();
         friend.Level = reader.ReadInt32();
         friend.Unknown6 = reader.ReadInt32();
         friend.Trophies = reader.ReadInt32();
         friend.HasClan = reader.ReadBoolean();
         if (friend.HasClan)
         {
             friend.ClanID = reader.ReadInt64();
             friend.ClanUnknown1 = reader.ReadInt32();
             friend.ClanName = reader.ReadString();
             friend.ClanRole = reader.ReadInt32();
             friend.ClanLevel = reader.ReadInt32();
         }
         Friends.Add(friend);
     }
 }
开发者ID:maithanhtan,项目名称:CoCSharp,代码行数:29,代码来源:FriendListResponsePacket.cs

示例9: SaveFriend

 public void SaveFriend(Friend friend)
 {
     using (var dataService = _dataServiceCreator())
     {
         dataService.SaveFriend(friend);
     }
 }
开发者ID:pszczesz,项目名称:friendStorages,代码行数:7,代码来源:FriendDataProvider.cs

示例10: FriendshipBaseEvent

 public FriendshipBaseEvent(Friend f)
 {
     this.mFriendRelationId = f.FriendRelationID;
     this.mUser1 = f.User1;
     this.mUser2 = f.User2;
     this.mEventTime = f.FriendsSince;
 }
开发者ID:Youssouf,项目名称:Cykelnet,代码行数:7,代码来源:FriendshipBaseEvent.cs

示例11: onGetFriendList

    //获取好友列表
    public void onGetFriendList(SocketModel module)
    {
		FriendMessage.MsgFriendListRep msg = MsgSerializer.Deserialize<FriendMessage.MsgFriendListRep>(module);

        MonoInstancePool.getInstance<FriendManager>().friendList.Clear();
        MonoInstancePool.getInstance<FriendManager>().applyLsit.Clear();
        for (int i = 0; i < msg.FriendAry.Count; i++)
        {
            Friend friend = new Friend();
            friend.fiendId = msg.FriendAry[i].uid;
            friend.friendName = msg.FriendAry[i].name;
            friend.friendLevel = msg.FriendAry[i].level;
            friend.imageID = msg.FriendAry[i].headid;
            friend.vipLevel = msg.FriendAry[i].vip;
            if (msg.type == (int)GlobalDef.FriendType.FriendList)
            {
                MonoInstancePool.getInstance<FriendManager>().friendList.Add(friend);
            }
            else if (msg.type == (int)GlobalDef.FriendType.InviteList)
            {
                MonoInstancePool.getInstance<FriendManager>().applyLsit.Add(friend);
            }
        }
        if (msg.type == (int)GlobalDef.FriendType.FriendList)       //显示好友列表
        {
            MonoInstancePool.getInstance<FriendManager>().IsDirty = true;
        }
        else if (msg.type == (int)GlobalDef.FriendType.InviteList)  //显示邀请好友列表
        {
            MonoInstancePool.getInstance<FriendManager>().IsDirty = true;
        }
    }
开发者ID:TrojanFighter,项目名称:U3D-DesignerBehaviorTest1,代码行数:33,代码来源:FriendModulMsg.cs

示例12: OnClick

    void OnClick()
    {
        var friendContentUIManager = (FriendContentUIManager)FindObjectOfType<FriendContentUIManager>();
        if (friendContentUIManager)
        {
            friendContentUIManager.hideFriendContentWindow();
        }
        string friendName = Title.text;
        long uid = 0;
        Friend f = new Friend();
        List<Friend> applyLsit = MonoInstancePool.getInstance<FriendManager>().applyLsit;
        foreach (Friend friend in applyLsit)
        {
            if (friend.friendName == friendName)
            {
                uid = friend.fiendId;
                f = friend;
            }
        }
        MonoInstancePool.getInstance<FriendManager>().applyLsit.Remove(f);
		MonoInstancePool.getInstance<SendFriendSystemHander>().SendAgreeOrDisagree(uid, false);
		var inviteListUIManager = (InviteListUIManager)FindObjectOfType<InviteListUIManager> ();
		inviteListUIManager.deleteInviteFriendObject (uid);
        //MonoInstancePool.getInstance<FriendManager>().inviteObject.Remove(transform.parent.gameObject);
        //Destroy(transform.parent.gameObject);
    }
开发者ID:TrojanFighter,项目名称:U3D-DesignerBehaviorTest1,代码行数:26,代码来源:ClickDisagreeCallback.cs

示例13: OnNavigatedTo

		protected override void OnNavigatedTo(NavigationEventArgs e)
		{
			string friendName;
			NavigationContext.QueryString.TryGetValue("friend-name", out friendName);
			if (friendName == null)
			{
				NavigationService.GoBack();
				return;
			}

			Friend friend = App.IsolatedStorage.UserAccount.Friends.First(f => f.Name == friendName);
			if (friend == null || App.IsolatedStorage.FriendsBests == null)
			{
				NavigationService.GoBack();
				return;
			}
			_friend = friend;

			LabelUserName.DataContext = App.IsolatedStorage.UserAccount.Friends.First(f => f.Name == friendName);
			LabelDisplayName.DataContext = App.IsolatedStorage.UserAccount.Friends.First(f => f.Name == friendName);

			Best usersBests;
			App.IsolatedStorage.FriendsBests.TryGetValue(friend.Name, out usersBests);
			if (usersBests == null)
			{
				usersBests = new Best
				{
					BestFriends = new string[] {},
					Score = 0
				};
			}
			DataContext = usersBests;

			base.OnNavigatedTo(e);
		}
开发者ID:0xdeafcafe,项目名称:FapChat,代码行数:35,代码来源:Info.xaml.cs

示例14: GetAllAccount

 public ICollection<Friend> GetAllAccount(Friend acc)
 {
     using (NHibernate.ISession session = SessionFactory.GetNewSession())
     {
         return session.CreateCriteria(typeof(Friend)).List<Friend>();
     }
 }
开发者ID:shah8701,项目名称:faceboard,代码行数:7,代码来源:FriendRepository.cs

示例15: RefreshDynamicElements

 public void RefreshDynamicElements(Player player, Friend friend)
 {
     this.DynamicElements["playerBeerBelly"].Text = player.BeerBelly.ToString();
     this.DynamicElements["playerLife"].Text = player.Life.ToString();
     this.DynamicElements["playerHealth"].Text = player.Health.ToString(CultureInfo.CurrentUICulture);
     this.DynamicElements["friendLife"].Text = friend.Life.ToString();
     this.DynamicElements["friendHealth"].Text = friend.Health.ToString(CultureInfo.CurrentUICulture);
 }
开发者ID:plmng,项目名称:SoftUni_OOP_HWs,代码行数:8,代码来源:Hud.cs


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