本文整理汇总了C#中IRunner类的典型用法代码示例。如果您正苦于以下问题:C# IRunner类的具体用法?C# IRunner怎么用?C# IRunner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRunner类属于命名空间,在下文中一共展示了IRunner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TextResultWriter
public TextResultWriter (IRunner runner, string fileName)
: base (runner, fileName)
{
if ((fileName == null) || (fileName.Length == 0)) {
writer = System.Console.Out;
string color_override = Environment.GetEnvironmentVariable ("GENDARME_COLOR") ?? "dark";
switch (color_override.ToLowerInvariant ()) {
case "none":
color_scheme = ColorScheme.None;
break;
case "light":
color_scheme = ColorScheme.Light;
break;
case "dark":
default:
color_scheme = ColorScheme.Dark;
break;
}
} else {
color_scheme = ColorScheme.None;
writer = new StreamWriter (fileName);
need_closing = true;
}
}
示例2: XmlResultWriter
public XmlResultWriter (IRunner runner, string fileName)
: base (runner, fileName)
{
writer = XmlWriter.Create (
CreateWriterFor (fileName),
new XmlWriterSettings { Indent = true, CloseOutput = true, CheckCharacters = false });
}
示例3: ScoresController
public ScoresController(IDbContext context, ICompiler compiler, IRunner runner, Participant participant = null)
{
_context = context;
_compiler = compiler;
_runner = runner;
_participant = participant ?? GetCurrentParticipant();
}
示例4: IgnoreFileList
public IgnoreFileList (IRunner runner, string fileName)
: base (runner)
{
if (!String.IsNullOrEmpty (fileName) && File.Exists (fileName)) {
Parse (fileName);
}
}
示例5: RunController
public RunController(IDbContext context, ICompiler compiler, IRunner runner, Participant participant = null)
{
_context = context;
_compiler = compiler;
_runner = runner;
_participant = participant == null ? GetCurrentParticipant() : participant;
}
示例6: FillSectionMap
private static void FillSectionMap(IRunner runner)
{
SectionMap = new Dictionary<string, Section>();
// We may later read the current directory for dlls to load
// 3rd party section handler modules but right now
// there is not such a requirement
// get types inherited from Section
var types =
typeof(Section).Assembly.
GetTypes().
Where(t => typeof(Section).IsAssignableFrom(t)).
ToArray();
foreach (var type in types)
{
var heading = type.GetCustomAttributes(
typeof(SectionHeaderAttribute),
inherit: false).
OfType<SectionHeaderAttribute>().
FirstOrDefault();
// only accept Sections types which have SectionHeader attribute
if (heading != null)
{
var instance = Activator.CreateInstance(type) as Section;
instance.Runner = runner;
// cache the concrete section handler
SectionMap.Add("[" + heading.Header.ToLower() + "]", instance);
}
}
}
示例7: XmlResultWriter
public XmlResultWriter (IRunner runner, string fileName)
: base (runner, fileName)
{
if ((fileName == null) || (fileName.Length == 0))
writer = new XmlTextWriter (System.Console.Out);
else
writer = new XmlTextWriter (fileName, Encoding.UTF8);
}
示例8: RunnerFactory
public RunnerFactory(ICategoryFinderService categoryFinderService,
IResultsParser resultsParser,
IRunner runner)
{
_categoryFinderService = categoryFinderService;
_resultsParser = resultsParser;
_runner = runner;
}
示例9: UpdatesMetadata
/// <summary>
/// Constructor for the updater
/// </summary>
/// <param name="index"></param>
/// <param name="createDate"></param>
/// <param name="description"></param>
/// <param name="createBy"></param>
/// <param name="runner"></param>
public UpdatesMetadata(double index, string createDate, string description, string createBy, IRunner runner)
{
_index = index;
_createDate = createDate;
_description = description;
_createBy = createBy;
_runner = runner;
}
示例10: Initialize
public override void Initialize (IRunner runner)
{
base.Initialize (runner);
// avoid checking all methods unless the type has some properties
Runner.AnalyzeType += delegate (object o, RunnerEventArgs e) {
Active = e.CurrentType.HasProperties;
};
}
示例11: Initialize
public override void Initialize (IRunner runner)
{
base.Initialize (runner);
// Nullable cannot be used if the assembly target runtime is earlier than 2.0
Runner.AnalyzeModule += delegate (object o, RunnerEventArgs e) {
Active = (e.CurrentModule.Runtime >= TargetRuntime.Net_2_0);
};
}
示例12: Initialize
public override void Initialize (IRunner runner)
{
base.Initialize (runner);
Runner.AnalyzeModule += (object o, RunnerEventArgs e) => {
Active = (e.CurrentAssembly.Name.Name == "mscorlib" ||
e.CurrentModule.HasTypeReference ("System.ArgIterator"));
};
}
示例13: PausableTask
internal PausableTask(IEnumerator enumerator, IRunner runner)
{
if (enumerator is SingleTask || enumerator is PausableTask || enumerator is AsyncTask)
throw new ArgumentException("Use of incompatible Enumerator, cannot be SingleTask/PausableTask/AsyncTask");
_enumerator = enumerator;
_runner = runner;
}
示例14: PausableTask
public PausableTask(IEnumerator enumerator, IRunner runner)
{
if (enumerator is SingleTask || enumerator is PausableTask || enumerator is AsyncTask)
throw new ArgumentException("Internal task used outside the framework scope");
_enumerator = enumerator;
_runner = runner;
}
示例15: Initialize
public override void Initialize (IRunner runner)
{
base.Initialize (runner);
Runner.AnalyzeType += (object sender, RunnerEventArgs e) =>
{
Active = e.CurrentType.Implements ("Gendarme.Framework", "IRule");
};
}