本文整理汇总了C#中IAudioService.AssertNotNull方法的典型用法代码示例。如果您正苦于以下问题:C# IAudioService.AssertNotNull方法的具体用法?C# IAudioService.AssertNotNull怎么用?C# IAudioService.AssertNotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAudioService
的用法示例。
在下文中一共展示了IAudioService.AssertNotNull方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetParser
public static Parser<IAction> GetParser(
int indentLevel,
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
if (indentLevel < 0)
{
throw new ArgumentException("indentLevel must be greater than or equal to 0.", "indentLevel");
}
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return BreakActionParser.GetParser(delayService, speechService)
.Or<IAction>(MetronomeActionParser.GetParser(audioService, delayService, loggerService))
.Or<IAction>(PrepareActionParser.GetParser(delayService, speechService))
.Or<IAction>(SayActionParser.GetParser(speechService))
.Or<IAction>(WaitActionParser.GetParser(delayService))
.Or<IAction>(DoNotAwaitActionParser.GetParser(indentLevel, audioService, delayService, loggerService, speechService))
.Or<IAction>(ParallelActionParser.GetParser(indentLevel, audioService, delayService, loggerService, speechService))
.Or<IAction>(SequenceActionParser.GetParser(indentLevel, audioService, delayService, loggerService, speechService));
}
示例2: GetParser
public static Parser<DoNotAwaitAction> GetParser(
int indentLevel,
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
if (indentLevel < 0)
{
throw new ArgumentException("indentLevel must be greater than or equal to 0.", "indentLevel");
}
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return
from _ in Parse.IgnoreCase("don't")
from __ in HorizontalWhitespaceParser.Parser.AtLeastOnce()
from ___ in Parse.IgnoreCase("wait:")
from ____ in VerticalSeparationParser.Parser.AtLeastOnce()
from actions in ActionListParser.GetParser(indentLevel + 1, audioService, delayService, loggerService, speechService)
let child = new SequenceAction(actions)
select new DoNotAwaitAction(
loggerService,
child);
}
示例3: AudioAction
public AudioAction(IAudioService audioService, string audioName)
{
audioService.AssertNotNull(nameof(audioService));
audioName.AssertNotNull(nameof(audioName));
this.audioService = audioService;
this.audioName = audioName;
}
示例4: MetronomeAction
public MetronomeAction(IAudioService audioService, IDelayService delayService, ILoggerService loggerService, IEnumerable<MetronomeTick> ticks)
{
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
ticks.AssertNotNull(nameof(ticks));
this.ticks = ticks.ToImmutableList();
this.innerAction = new SequenceAction(GetInnerActions(audioService, delayService, loggerService, this.ticks));
}
示例5: TryParse
public static IResult<ExercisePrograms> TryParse(
string input,
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
input.AssertNotNull(nameof(input));
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return ExerciseProgramsParser.GetParser(audioService, delayService, loggerService, speechService).TryParse(input);
}
示例6: GetParser
public static Parser<ExerciseProgram> GetParser(
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return
from name in HeadingParser.GetParser(1)
from _ in Parse.WhiteSpace.Many()
from exercises in ExerciseParser.GetParser(audioService, delayService, loggerService, speechService).DelimitedBy(Parse.WhiteSpace.Many()).Optional()
select new ExerciseProgram(loggerService, name, exercises.GetOrElse(Enumerable.Empty<Exercise>()));
}
示例7: GetParser
public static Parser<ExercisePrograms> GetParser(
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return
from _ in VerticalSeparationParser.Parser
from exercisePrograms in ExerciseProgramParser.GetParser(audioService, delayService, loggerService, speechService).DelimitedBy(Parse.WhiteSpace.Many()).Optional()
from __ in Parse.WhiteSpace.Many().End()
select new ExercisePrograms(exercisePrograms.GetOrElse(Enumerable.Empty<ExerciseProgram>()));
}
示例8: GetParser
public static Parser<MetronomeAction> GetParser(
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService)
{
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
return
from _ in Parse.IgnoreCase("metronome")
from __ in HorizontalWhitespaceParser.Parser.AtLeastOnce()
from ___ in Parse.IgnoreCase("at")
from ____ in HorizontalWhitespaceParser.Parser.AtLeastOnce()
from ticks in metronomeTickParser.DelimitedBy(Parse.Char(',').Token(HorizontalWhitespaceParser.Parser))
select new MetronomeAction(
audioService,
delayService,
loggerService,
ticks);
}
示例9: GetParser
public static Parser<IEnumerable<IAction>> GetParser(
int indentLevel,
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
if (indentLevel < 0)
{
throw new ArgumentException("indentLevel must be greater than or equal to 0.", "indentLevel");
}
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return
(from _ in Parse.String(" ").Or(Parse.String("\t")).Repeat(indentLevel)
from __ in Parse.String("* ")
from action in ActionParser.GetParser(indentLevel, audioService, delayService, loggerService, speechService).Token(HorizontalWhitespaceParser.Parser)
select action).DelimitedBy(NewLineParser.Parser);
}
示例10: GetParser
public static Parser<ParallelAction> GetParser(
int indentLevel,
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
if (indentLevel < 0)
{
throw new ArgumentException("indentLevel must be greater than or equal to 0.", "indentLevel");
}
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return
from _ in Parse.IgnoreCase("parallel:")
from __ in VerticalSeparationParser.Parser.AtLeastOnce()
from actions in ActionListParser.GetParser(indentLevel + 1, audioService, delayService, loggerService, speechService)
select new ParallelAction(actions);
}