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


C# IMessage.Clear方法代码示例

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


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

示例1: Release

        /// <summary>
        /// Returns an element back to the pool.
        /// </summary>
        /// <param name="rEdge"></param>
        public static new void Release(IMessage rInstance)
        {
            if (rInstance == null) { return; }

            // We should never release an instance unless we're
            // sure we're done with it. So clearing here is fine
            rInstance.Clear();

            // Reset the sent flags. We do this so messages are flagged as 'completed'
            // and removed by default.
            rInstance.IsSent = true;
            rInstance.IsHandled = true;

            // Make it available to others.
            if (rInstance is MyCustomMessage)
            {
                sPool.Release((MyCustomMessage)rInstance);
            }
        }
开发者ID:yoyo2004cn,项目名称:VWCarFactory,代码行数:23,代码来源:MyCustomMessage.cs

示例2: ClearMessage

 private void ClearMessage(IMessage message)
 {
     message.Clear();
 }
开发者ID:Phrynohyas,项目名称:margo,代码行数:4,代码来源:ServiceDynamicProxy.cs

示例3: send_to_instrument

        //send to instrument by visacom
        private string send_to_instrument(string fullcmd,string address,string cmd, IMessage ioDmm,int delay = 0)
        {
            WriteTraceText(fullcmd);
            //IVisaSession basesession = null;
            //IMessage talksession = null;

            string strRd = "";
            string instrumentAddress = address;
            //lock
            //this.WriteTraceText("\n");
            lock (_lock_Instrument)
            {

                    ioDmm.Clear();
                    ioDmm.WriteString(cmd);

                    if (delay != 0 && delay > 500)
                        Thread.Sleep(delay);
                    else
                        Thread.Sleep(500);
                    if (cmd.Contains("?"))
                    {
                        for (int i = 0; i < 5; i++)
                        {

                            try
                            {

                                strRd = ioDmm.ReadString(4069);
                                break;
                            }
                            catch (Exception exp)
                            {
                                ioDmm.Clear();
                                if (i != 9)
                                {
                                    Thread.Sleep(200);
                                    continue;

                                }
                                else
                                {
                                    WriteErrorText("write/read to instrumen by visacom error: " + exp.Message);
                                    throw new Exception(exp.Message);
                                }

                            }

                        }

                    }

            }
            strRd = strRd.TrimEnd('\n');
            return strRd;
        }
开发者ID:mahabara,项目名称:RTT,代码行数:57,代码来源:MainForm.cs


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