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


C# Queue.DequeueArgument方法代码示例

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


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

示例1: OutputOptions

            internal OutputOptions(Queue<String> queue)
            {
                Boolean parsingComplete = false;
                while (queue.Count > 0 && !parsingComplete)
                {
                  var field = queue.Peek();
                  switch (field)
                  {
                case "-fm":
                {
                  queue.Dequeue();
                  this.FileMatched = queue.DequeueArgument("-fm");
                  break;
                }

                case "-fu":
                {
                  queue.Dequeue();
                  this.FileUnmatched = queue.DequeueArgument("-fu");
                  break;
                }

                default:
                {
                  parsingComplete = true;
                  break;
                }
                  }
                }

                if (this.FileMatched == null && this.FileUnmatched == null)
                {
                  throw new Exception("Missing required file term. Use either '-fm' or '-fu' or both.");
                }
            }
开发者ID:toyners,项目名称:Siftan,代码行数:35,代码来源:Options.cs

示例2: LogOptions

            internal LogOptions(Queue<String> queue)
            {
                Boolean parsingComplete = false;
                while (queue.Count > 0 && !parsingComplete)
                {
                  var field = queue.Peek();
                  switch (field)
                  {
                case "-a":
                {
                  queue.Dequeue();
                  this.ApplicationLogFilePath = queue.DequeueArgument("-a");
                  break;
                }

                case "-j":
                {
                  queue.Dequeue();
                  this.JobLogFilePath = queue.DequeueArgument("-j");
                  break;
                }

                default:
                {
                  parsingComplete = true;
                  break;
                }
                  }
                }
            }
开发者ID:toyners,项目名称:Siftan,代码行数:30,代码来源:Options.cs

示例3: FixedWidthOptions

            internal FixedWidthOptions(Queue<String> queue)
            {
                Boolean parsingComplete = false;
                Boolean gotLineStart = false;
                Boolean gotLineLength = false;
                Boolean gotTermStart = false;
                Boolean gotTermLength = false;
                while (queue.Count > 0 && !parsingComplete)
                {
                  var field = queue.Peek();
                  switch (field)
                  {
                case "-h":
                {
                  queue.Dequeue();
                  this.HeaderLineID = queue.DequeueArgument("-h");
                  break;
                }

                case "-ls":
                {
                  queue.Dequeue();
                  this.LineIDStart = queue.DequeueUInt32("-hs");
                  gotLineStart = true;
                  break;
                }

                case "-ll":
                {
                  queue.Dequeue();
                  this.LineIDLength = queue.DequeueUInt32("-hl");
                  gotLineLength = true;
                  break;
                }

                case "-t":
                {
                  queue.Dequeue();
                  this.TermLineID = queue.DequeueArgument("-t");
                  break;
                }

                case "-ts":
                {
                  queue.Dequeue();
                  this.TermStart = queue.DequeueUInt32("-ts");
                  gotTermStart = true;
                  break;
                }

                case "-tl":
                {
                  queue.Dequeue();
                  this.TermLength = queue.DequeueUInt32("-tl");
                  gotTermLength = true;
                  break;
                }

                default:
                {
                  parsingComplete = true;
                  break;
                }
                  }
                }

                if (this.HeaderLineID == null)
                {
                  throw new Exception("Missing required term 'Header ID' (-h).");
                }

                if (this.TermLineID == null)
                {
                  throw new Exception("Missing required term 'Term Line ID' (-t).");
                }

                if (!gotLineStart)
                {
                  throw new Exception("Missing required term 'Line ID Start' (-ls).");
                }

                if (!gotLineLength)
                {
                  throw new Exception("Missing required term 'Line ID Length' (-ll).");
                }

                if (!gotTermStart)
                {
                  throw new Exception("Missing required term 'Term Start' (-ts).");
                }

                if (!gotTermLength)
                {
                  throw new Exception("Missing required term 'Term Length' (-tl).");
                }
            }
开发者ID:toyners,项目名称:Siftan,代码行数:96,代码来源:Options.cs

示例4: InListOptions

            internal InListOptions(Queue<String> queue)
            {
                Boolean parsingComplete = false;
                while (queue.Count > 0 && !parsingComplete)
                {
                  var field = queue.Peek();
                  switch (field)
                  {
                case "-f":
                {
                  queue.Dequeue();
                  this.FilePath = queue.DequeueArgument("-f");
                  break;
                }

                case "-m":
                {
                  queue.Dequeue();
                  this.MatchQuota = queue.DequeueEnum<InListExpression.MatchQuotas>("-m");
                  break;
                }

                case "-v":
                {
                  queue.Dequeue();
                  this.Values = queue.DequeueArray(':', "-v");
                  break;
                }

                default:
                {
                  parsingComplete = true;
                  break;
                }
                  }
                }

                if (this.FilePath != null && this.Values != null)
                {
                  throw new Exception("Cannot have both 'File Path' (-f) and 'Value List' (-v) terms.");
                }

                if (this.FilePath == null && this.Values == null)
                {
                  throw new Exception("Missing one required term. Must have 'File Path' (-f) or 'Value List' (-v) but not both.");
                }
            }
开发者ID:toyners,项目名称:Siftan,代码行数:47,代码来源:Options.cs

示例5: DelimitedOptions

            internal DelimitedOptions(Queue<String> queue)
            {
                Boolean parsingComplete = false;
                while (queue.Count > 0 && !parsingComplete)
                {
                  var field = queue.Peek();
                  switch (field)
                  {
                case "-d":
                {
                  queue.Dequeue();
                  this.Delimiter = queue.DequeueArgument("-d");
                  break;
                }

                case "-q":
                {
                  queue.Dequeue();
                  this.Qualifier = queue.DequeueChar("-q");
                  break;
                }

                case "-h":
                {
                  queue.Dequeue();
                  this.HeaderLineID = queue.DequeueArgument("-h");
                  break;
                }

                case "-ti":
                {
                  queue.Dequeue();
                  this.TermIndex = queue.DequeueUInt32("-ti");
                  break;
                }

                case "-li":
                {
                  queue.Dequeue();
                  this.LineIDIndex = queue.DequeueUInt32("-li");
                  break;
                }

                case "-t":
                {
                  queue.Dequeue();
                  this.TermLineID = queue.DequeueArgument("-t");
                  break;
                }

                default:
                {
                  parsingComplete = true;
                  break;
                }
                  }
                }

                if (this.Delimiter == null)
                {
                  this.Delimiter = ",";
                }

                if (this.HeaderLineID == null)
                {
                  throw new Exception("Missing required term 'Header ID' (-h).");
                }

                if (this.TermLineID == null)
                {
                  throw new Exception("Missing required term 'Term Line ID' (-t).");
                }
            }
开发者ID:toyners,项目名称:Siftan,代码行数:73,代码来源:Options.cs


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