本文整理汇总了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;
}