當前位置: 首頁>>代碼示例>>C#>>正文


C# Chat類代碼示例

本文整理匯總了C#中Chat的典型用法代碼示例。如果您正苦於以下問題:C# Chat類的具體用法?C# Chat怎麽用?C# Chat使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Chat類屬於命名空間,在下文中一共展示了Chat類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Chat類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。