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


C# Client.Equals方法代码示例

本文整理汇总了C#中Client.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Client.Equals方法的具体用法?C# Client.Equals怎么用?C# Client.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Client的用法示例。


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

示例1: Contains

 /// <summary>
 /// Extending the Contains method
 /// </summary>
 /// <param name="list"></param>
 /// <param name="client"></param>
 /// <returns></returns>
 public bool Contains(Client client)
 {
     bool contains = false;
     foreach (Client c1 in Tamers)
         if (client.Equals(c1))
         {
             contains = true;
             break;
         }
     return contains;
 }
开发者ID:jimmy210309,项目名称:Digital-World,代码行数:17,代码来源:GameMap.cs

示例2: GetListViewItemByClient

        /// <summary>
        /// Gets the Listview item which belongs to the client. 
        /// </summary>
        /// <param name="c">The client to get the Listview item of.</param>
        /// <returns>Listview item of the client.</returns>
        private ListViewItem GetListViewItemByClient(Client c)
        {
            ListViewItem itemClient = null;

            lstClients.Invoke((MethodInvoker) delegate
            {
                itemClient = lstClients.Items.Cast<ListViewItem>()
                    .FirstOrDefault(lvi => lvi != null && lvi.Tag is Client && c.Equals((Client)lvi.Tag));
            });

            return itemClient;
        }
开发者ID:Nusec,项目名称:xRAT,代码行数:17,代码来源:FrmMain.cs

示例3: RemoveClientFromListview

 /// <summary>
 /// Removes a connected client from the Listview.
 /// </summary>
 /// <param name="c">The client to remove.</param>
 public void RemoveClientFromListview(Client c)
 {
     try
     {
         lstClients.Invoke((MethodInvoker) delegate
         {
             lock (_lockClients)
             {
                 foreach (ListViewItem lvi in lstClients.Items.Cast<ListViewItem>()
                     .Where(lvi => lvi != null && (lvi.Tag as Client) != null && c.Equals((Client) lvi.Tag)))
                 {
                     lvi.Remove();
                     ConServer.ConnectedAndAuthenticatedClients--;
                     break;
                 }
             }
         });
         UpdateWindowTitle();
     }
     catch (InvalidOperationException)
     {
     }
 }
开发者ID:Nusec,项目名称:xRAT,代码行数:27,代码来源:FrmMain.cs

示例4: RemoveClientFromListview

        /// <summary>
        /// Removes a connected client from the Listview.
        /// </summary>
        /// <param name="client">The client to remove.</param>
        private void RemoveClientFromListview(Client client)
        {
            if (client == null) return;

            try
            {
                lstClients.Invoke((MethodInvoker) delegate
                {
                    lock (_lockClients)
                    {
                        foreach (ListViewItem lvi in lstClients.Items.Cast<ListViewItem>()
                            .Where(lvi => lvi != null && client.Equals(lvi.Tag)))
                        {
                            lvi.Remove();
                            break;
                        }
                    }
                });
                UpdateWindowTitle();
            }
            catch (InvalidOperationException)
            {
            }
        }
开发者ID:hmitev,项目名称:QuasarRAT,代码行数:28,代码来源:FrmMain.cs

示例5: GetListViewItemByClient

        /// <summary>
        /// Gets the Listview item which belongs to the client. 
        /// </summary>
        /// <param name="client">The client to get the Listview item of.</param>
        /// <returns>Listview item of the client.</returns>
        private ListViewItem GetListViewItemByClient(Client client)
        {
            if (client == null) return null;

            ListViewItem itemClient = null;

            lstClients.Invoke((MethodInvoker) delegate
            {
                itemClient = lstClients.Items.Cast<ListViewItem>()
                    .FirstOrDefault(lvi => lvi != null && client.Equals(lvi.Tag));
            });

            return itemClient;
        }
开发者ID:hmitev,项目名称:QuasarRAT,代码行数:19,代码来源:FrmMain.cs

示例6: onAnswer

        private void onAnswer(Client client)
        {
            string[] kpc = client.flush();
            if (!this.playing)
            {
                client.sendMsg("X\n");  // DAMEDESU
                client.NowState = Client.State.Neet;
                return;
            }

            client.sendMsg("O\n");  // OK
            client.NowState = Client.State.WORKING;


            // 反映処理
            client.Board.reset();
            bool flg = true;
            for (int i=0; (flg && i<kpc.Length); i++)
            {
                if (kpc[i] == "")
                    continue;

                string[] tmp = kpc[i].Split(' ');
                flg = client.Board.place(this.problem.Stones[i], (tmp[0] == "H"), int.Parse(tmp[1]), int.Parse(tmp[2]), int.Parse(tmp[3]));
            }

            if (!flg)
            {
                clientEvent("もう許さねぇからな?", client.Name);
                return;
            }

            client.Board.Time = DateTime.Now - this.stime;
            client.Board.Pass = true;
            clientEvent("バァン!(回答)", client.Name);

            if (this.best != null && !client.Equals(this.best) && !(client.CompareTo(this.best) < 0))
                return;

            this.best = client;

            // 送信処理
            this.tmpclient = client;
            this.tmpans = kpc;

            if (this.timer.Enabled)
            {
                this.timer.Stop();
            }

            this.timer.Interval = 2000;
            this.timer.Start();
            //postAnswerAsync(client, kpc);
        }
开发者ID:KNCT-KPC,项目名称:Bungo,代码行数:54,代码来源:Form.cs


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