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


C# IQueue.ToList方法代码示例

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


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

示例1: Initialize


//.........这里部分代码省略.........
            {
                portname = new StringBuilder(node.PortName);
                pduMode = false;
                pduMode = node.PDUMode; 
                if (!string.IsNullOrEmpty(node.ServiceCenter))
                {
                    serviceCenter = new StringBuilder(countryCode + node.ServiceCenter.Substring(1, node.ServiceCenter.Length - 1));
                } 

                baudrate = Convert.ToInt32(node.BaudRate);
                databits = Convert.ToInt32(node.DataBits);
                parity = new Parity();
                sparity = new StringBuilder(node.Parity.ToLower());
                if (sparity.ToString() == "even")
                    parity = Parity.Even;
                else
                    if (sparity.ToString() == "mark")
                        parity = Parity.Mark;
                    else
                        if (sparity.ToString() == "none")
                            parity = Parity.None;
                        else
                            if (sparity.ToString() == "odd")
                                parity = Parity.Odd;
                            else
                                if (sparity.ToString() == "space")
                                    parity = Parity.Space; 
                stopBits = new StopBits();
                sstop = new StringBuilder(node.StopBits.ToLower());
                if (sstop.ToString() == "none")
                    stopBits = StopBits.None;
                else
                    if (sstop.ToString() == "one")
                        stopBits = StopBits.One;
                    else
                        if (sstop.ToString() == "onepointfive")
                            stopBits = StopBits.OnePointFive;
                        else
                            if (sstop.ToString() == "two")
                                stopBits = StopBits.Two;
                handshake = new Handshake();
                shand = new StringBuilder(node.Handshake.ToLower());
                if (shand.ToString() == "none")
                    handshake = Handshake.None;
                else
                    if (shand.ToString() == "requesttosend")
                        handshake = Handshake.RequestToSend;
                    else
                        if (shand.ToString() == "RequestToSendXOnXOff")
                            handshake = Handshake.RequestToSendXOnXOff;
                        else
                            if (shand.ToString() == "xonxoff")
                                handshake = Handshake.XOnXOff;

                /// check whether port there is in collection?
                if (ports.Where(b => b.ToLower().Equals(portname.ToString().ToLower())).SingleOrDefault() != null)
                {
                    connection = new BasicInformation(portname.ToString(), baudrate, parity, stopBits, databits, handshake, serviceCenter.ToString(), pduMode);
                    InitSerialPort(connection);
                }
            }
                  
            GSMServer.Plugin.Plugin plugin;
            foreach (PluginElement pluginElement in ((ApplicationSettings)settings).Plugins.Items)
            {
                plugin = PluginActivator.Create(pluginElement.AssemblyFile, pluginElement.Type);
                if (plugin != null)
                {
                    pluginMap.Add(pluginElement.AssemblyFile, plugin);
                }
            } 

            availableConnections = portColletion.ToList();
            if (portColletion.Count > 0)
            { 
                intervalProcessQueue = (intervalProcessQueue / portColletion.Count) + TimeConstant.DEFAULT_INTERVAL_QUEUE;
            }
            else
            {
                intervalProcessQueue = (intervalProcessQueue) + TimeConstant.DEFAULT_INTERVAL_QUEUE;
            }

            timerReadQueue = new System.Timers.Timer(intervalReadMessage);
            timerReadQueue.Elapsed += timerReadQueue_Elapsed;

            timerProcessRequestQueue = new System.Timers.Timer(intervalProcessQueue);
            timerProcessRequestQueue.Elapsed += TimerProcessingRequest_Elapsed;

            if (portColletion.Count > 0)
            {
                if (!this.Active) 
                    this.BeginAcceptClient();
            }

            base.PacketReceived += OnPacketReceived;
            base.Connected += OnClientConnected;
            base.Disconnected += OnClientDisconnect;
            base.Closed += OnClosed;
            base.Open += OnOpen;
        }
开发者ID:sandalkuilang,项目名称:texto,代码行数:101,代码来源:Server.cs


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