• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Chat类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Parse

        public NetworkObject Parse(Match match)
        {
            Chat chat = new Chat {
                Now = {
                    Players = new List<Player>() {
                        new Player() {
                            Name = match.Groups["name"].Value,
                            Uid = match.Groups["uniqueid"].Value
                        }
                    },
                    Content = new List<String>() {
                        match.Groups["text"].Value.Replace("\r", "")
                    }
                },
                Origin = ChatOrigin.Player
            };

            if (String.Compare(match.Groups["context"].Value, "say", StringComparison.OrdinalIgnoreCase) == 0) {
                chat.Scope.Groups = new GroupingList();
            }
            else {
                // Can we get a team identifier here?
                chat.Scope.Groups = new GroupingList() {
                    new Grouping() {
                        Type = Grouping.Team
                    }
                };
            }

            return chat;
        }
开发者ID:EBassie,项目名称:Potato,代码行数:31,代码来源:SourceChat.cs


示例2: NetworkWindow

 public NetworkWindow(NetworkInterface nif)
 {
     chat = new Chat(nif);
     chat.togglePos = new Rect(0,30,togglePos.width,25);
     nif.AddMessageRecipient((INetworkMessage)this);
     menus.Add(new MainContent(nif,this));
 }
开发者ID:PxcL,项目名称:Unity_Tic-Tac-Tower,代码行数:7,代码来源:NetworkWindow.cs


示例3: NetworkWindow

 public NetworkWindow(IGUIMessages receiver)
 {
     chat = new Chat(receiver);
     chat.togglePos = new Rect(0,30,togglePos.width,25);
     receiver.AddNetworkMessageRecipient((INetworkMessage)this);
     menus.Add(new MainContent(receiver,this));
 }
开发者ID:Arganato,项目名称:Unity_Tic-Tac-Tower,代码行数:7,代码来源:NetworkWindow.cs


示例4: onChatMessage

	public void onChatMessage(SocketModel model)
	{
		NoticeMessage.MsgChatRep msg = MsgSerializer.Deserialize<NoticeMessage.MsgChatRep>(model);

        Chat chat = new Chat();
        chat.uid = msg.uid;
        chat.name = msg.name;
        chat.type = msg.type;
        chat.data = msg.data;
		chat.targetUid = msg.target;
		if (msg.item != null) {
			chat.goods.guid = msg.item.guid;
			//server changed, client not change
//			chat.goods.number = msg.item.number;	
		}
        chat.targetName = msg.tarname;
        ChatManager chatManager = MonoInstancePool.getInstance<ChatManager>();
        if (chat.type == (int)GlobalDef.CHAT_CHANNEL.ALL_CHANNEL)
        {
            chatManager.setSystemChatList(chat);
			chatManager.setHaveNewSystemChat(true);
        }
        else if (chat.type == (int)GlobalDef.CHAT_CHANNEL.WORLD_CHANNEL)
        {
            chatManager.setWorldChatList(chat);
			chatManager.setHaveNewWorldChat(true);
        }
        else if (chat.type == (int)GlobalDef.CHAT_CHANNEL.PRIVATE_CHANNEL)
        {
            chatManager.setPrivateChatList(chat);
			chatManager.setHaveNewPrivateChat(true);
			//chatManager.setTargetId(chat.uid);
        }
        chatManager.setIsDirty(true);
	}
开发者ID:TrojanFighter,项目名称:U3D-DesignerBehaviorTest1,代码行数:35,代码来源:NoticeModuleMsg.cs


示例5: Start

 void Start()
 {
     game = GameObject.Find("Networking").GetComponent<Game>();
     sender = GameObject.Find("Networking").GetComponent<PacketSender>();
     chat = GameObject.Find("Chat").GetComponent<Chat>();
     side = GameObject.Find("SideObjects").GetComponent<SideObjects>();
 }
开发者ID:Wiebrendh,项目名称:MMORPG,代码行数:7,代码来源:ActionMenu.cs


示例6: RequestNewChat

 public void RequestNewChat(string auctionId, string participant, Message message)
 {
     CurrentChat = new Chat(auctionId, participant);
     CurrentChat.Message = message;
     Chats.Add(CurrentChat);
     OnChatCreated(EventArgs.Empty);
 }
开发者ID:frankidoze,项目名称:GOOS_sample_csharp,代码行数:7,代码来源:ChatManager.cs


示例7: Awake

        protected void Awake()
        {
            // force the twitch libraries to be loaded
            Twitch.Broadcast.UnityBroadcastController.LoadTwitchLibraries();

            m_Chat = new Chat(new CoreChatAPI());
        }
开发者ID:RELO4D3D,项目名称:sdk-dist,代码行数:7,代码来源:UnityChatController.cs


示例8: checkKey

 /// <summary>
 /// Chatオブジェクトが検索keyにHITするかどうかを判定する
 /// 検索keyは以下
 ///  個人チャットの場合     : 相手のskype名
 ///  グループチャットの場合 : 会話のタイトル
 /// </summary>
 /// <param name="key"></param>
 /// <param name="chat"></param>
 /// <returns></returns>
 private bool checkKey(string key, Chat chat)
 {
     try
     {
         textBox1.Text = "chat.Status: " + chat.Status + "\r\n" + textBox1.Text;
         //けっこうあいまいな判定
         switch (chat.Status)
         {
             case TChatStatus.chsDialog: //個人チャットかな~
                 //個人チャットの相手のskype名
                 if (key == chat.DialogPartner)
                 {
                     return true;
                 }
                 break;
             case TChatStatus.chsMultiSubscribed://グループチャットかな~
                 //グループチャットの会話のタイトル
                 if (key == chat.Topic)
                 {
                     return true;
                 }
                 break;
             default://分からん
                 break;
         }
         return false;
     }
     catch (Exception exp)
     {
         return false;
     }
 }
开发者ID:kikakubu-ksg,项目名称:SkypeJimaku,代码行数:41,代码来源:Skype.cs


示例9: Join

        public string[] Join(string name)
        {
            MyChat = new Chat(UserHandler);
            lock (syncObj)
            {
                if (!Chatter.Contains(name)) //이름이 기존 채터에 있는지 검색한다.
                {
                    //이름과 이벤트를 추가한다.
                    this.name = name;
                    Chatter.Add(name);

                    //사용자에게 보내 줄 채널을 설정한다.
                    callback = OperationContext.Current.GetCallbackChannel<IChatCallback>();

                    //현재 접속자 정보를 모두에게 전달
                    BroadcastMessage(name, "", "UserEnter");

                    //델리게이터 추가
                    List += MyChat;

                    //사용자리스트를 보내준다.
                    string[] list = new string[Chatter.Count];
                    lock (syncObj)
                    {
                        Chatter.CopyTo(list);
                    }
                    return list;
                }
                else //이미 사용자가 사용하고 있는 이름일 경우
                {
                    return null;
                }
            }
        }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:34,代码来源:ChatService.cs


示例10: CreateNewChat

 public static Chat CreateNewChat(Visitor v, Operator o)
 {
     Chat c = new Chat();
     c.AccountId = v.AccountId;
     c.OperatorId = o.OperatorId;
     c.VisitorId = v.VisitorId;
     return c;
 }
开发者ID:honj51,项目名称:ideacode,代码行数:8,代码来源:TestTool.cs


示例11: AddChat

 public void AddChat(Chat chatRequest)
 {
     string sql = string.Format("INSERT INTO LiveChat_Chat "+
         "(ChatId,CreateBy,CreateTime,AccountId,VisitorId,Status) "
     +"VALUES('{0}','{1}','{2}','{3}','{4}','{5}')" ,
         chatRequest.ChatId, chatRequest.CreateBy, chatRequest.CreateTime,chatRequest.AccountId, chatRequest.VisitorId, chatRequest.Status);
     DBHelper.ExecuteCommand(sql);
 }
开发者ID:honj51,项目名称:ideacode,代码行数:8,代码来源:SqlChatProvider.cs


示例12: CreateChat

 public Chat CreateChat(string auctionId, string participant, IMessageListener messageListener)
 {
     CurrentChat = new Chat(auctionId, participant);
     CurrentChat.AddIMessageListener(messageListener);
     Chats.Add(CurrentChat);
     OnChatCreated(EventArgs.Empty);
     return CurrentChat;
 }
开发者ID:frankidoze,项目名称:GOOS_sample_csharp,代码行数:8,代码来源:ChatManager.cs


示例13: ChatInterface

        public ChatInterface()
        {
            m_chat = new Chat();
            m_chat.Visible = true;
            m_chat.OnInput += OnChatInput;

            Overlay.System.Register(m_chat);
        }
开发者ID:imGoose,项目名称:SkyrimOnline,代码行数:8,代码来源:ChatInterface.cs


示例14: Accept

        public void Accept(Chat chat)
        {
            this.chat = chat;
            visitor = operatorServiceAgent.GetVisitorById(chat.VisitorId);
            initChat();

            operatorServiceAgent.AcceptChatRequest(chat.ChatId);
        }
开发者ID:honj51,项目名称:ideacode,代码行数:8,代码来源:ChatForm.cs


示例15: Awake

    void Awake()
    {
        Instance = this;

        mClient = LobbyManager.s_Singleton.client;

        NetworkServer.RegisterHandler(MSG_TYPE, OnServerPostChatMessage);
    }
开发者ID:kyousuke916,项目名称:Keep-Alive,代码行数:8,代码来源:Chat.cs


示例16: Start

	void Start()
	{
		moveL.x = Resolution.width;
		moveR.y = Resolution.height;
		multiPlayer = GetComponent<MultiPlayer>();
		multiPlayer.Refresh();
		chat = GetComponent<Chat>();
		multiPlayer.playerName = "Player"+Random.Range(1,255);
	}
开发者ID:MizzKii,项目名称:WarB,代码行数:9,代码来源:Lobby.cs


示例17: SendMessageToRoom

        public void SendMessageToRoom(Chat chat, string message, string[] rooms)
        {
            string msg = string.Format("{0}: {1}", chat.Context.ConnectionId, message);

            for (int i = 0; i < rooms.Length; i++)
            {
                chat.Clients.Group(rooms[i]).addMessage(msg);
            }
        }
开发者ID:King-Survival-3,项目名称:HQC-Teamwork-2015,代码行数:9,代码来源:Visitor.cs


示例18: UserJoinedChatEvent

 public UserJoinedChatEvent(
     User user,
     Chat chat,
     DomainModel sender)
     : base(user,
     sender)
 {
     Chat = chat;
 }
开发者ID:Bowerbird,项目名称:bowerbird-web,代码行数:9,代码来源:UserJoinedChatEvent.cs


示例19: Add

        /// <summary>
        /// When we join a chatroom add a new tab.
        /// </summary>
        /// <param name="chatroomName">Chatroom name.</param>
        /// <param name="chat">Chat to add.</param>
        public override void Add(string chatroomName, Chat chat)
        {
            base.Add(chatroomName, chat);

            // add to main window
            MainWindow.Dispatcher.Invoke((Action)delegate
            {
                MainWindow.AddChatTab((UIChat)chat);
            });
        }
开发者ID:gbrusella,项目名称:oberon-bot,代码行数:15,代码来源:UIChatProvider.cs


示例20: removeChat

 public static void removeChat(Chat chat)
 {
     lock (typeof(Chat)) {
         List<Chat> chats = ((List<Chat>)HttpContext.Current.Application["Chats"]);
         if (!chat.Equals(chats[0])) {
             chats.Remove(chat);
             HttpContext.Current.Application["Chats"] = chats;
         }
     }
 }
开发者ID:Andi1986,项目名称:ChatApp,代码行数:10,代码来源:Chat.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ChatCommand类代码示例发布时间:2022-05-24
下一篇:
C# ChartArea类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap