本文整理汇总了C#中IOutput类的典型用法代码示例。如果您正苦于以下问题:C# IOutput类的具体用法?C# IOutput怎么用?C# IOutput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IOutput类属于命名空间,在下文中一共展示了IOutput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Report
public void Report(IOutput output)
{
JavaScriptSerializer s = new JavaScriptSerializer();
string serialize = s.Serialize(_qs);
output.Out(serialize);
}
示例2: Report
public void Report(IOutput output)
{
foreach (var q in _qs)
{
output.Out(q.ToString());
}
}
示例3: ScoreControl
public ScoreControl(IUnityContainer container, IOutput output, IMidiInput midiInput, IInputEvents inputEvents, IMediaServiceHost mediaServiceHost,
IVirtualKeyBoard virtualKeyboard, ILogger logger, XScore musicScore)
: this()
{
_container = container;
_output = output;
_intputEvents = inputEvents;
_midiInput = midiInput;
_virtualKeyboard = virtualKeyboard;
_musicScore = musicScore;
_mediaServiceHost = mediaServiceHost;
_logger = logger;
_updateScrollTimer = new Timer(ScrollTimerHandler, null, Timeout.Infinite, _scrollTimingPerdiod);
_scoreParser = new ScoreParser(_musicScore, ScoreGrid);
_scoreParser.Render();
ScoreGrid.Width = _scoreParser.GetMaxHorizontalPosition();
nextBarDetails = new BarDetails();
nextBarDetails.NoteTime = 0;
nextBarDetails.XCoord = 0;
_intputEvents.MessageReceived += HandleInputEvent;
_midiInput.StartRecording();
ConfigureSongEventController();
}
示例4: ChangelogBuilder
public ChangelogBuilder([NotNull] ReleaseDirInfo[] releaseDirs, [NotNull] IOutput output)
{
if (releaseDirs == null) throw new ArgumentNullException("releaseDirs");
if (output == null) throw new ArgumentNullException("output");
this.releaseDirs = releaseDirs;
this.output = output;
}
示例5: RecordSession
/// <summary>
/// Creates a new recording session object
/// </summary>
/// <param name="midiInput">Expected to be injected</param>
public RecordSession(IMidiInput midiInput, IOutput output, IVirtualKeyBoard virtualKeyboard)
{
_midiInput = midiInput;
_output = output;
_virtualKeyboard = virtualKeyboard;
Init();
}
示例6: EvaluateFormat
public void EvaluateFormat(object current, Format format, ref bool handled, IOutput output, FormatDetails formatDetails)
{
if (format != null && format.HasNested) return;
var formatText = format != null ? format.Text : "";
TimeSpan fromTime;
if (current is TimeSpan)
{
fromTime = (TimeSpan)current;
}
else if (current is DateTime && formatText.StartsWith("timestring"))
{
formatText = formatText.Substring(10);
fromTime = DateTime.Now.Subtract((DateTime)current);
}
else
{
return;
}
var timeTextInfo = GetTimeTextInfo(formatDetails.Provider);
if (timeTextInfo == null)
{
return;
}
var formattingOptions = TimeSpanFormatOptionsConverter.Parse(formatText);
var timeString = TimeSpanUtility.ToTimeString(fromTime, formattingOptions, timeTextInfo);
output.Write(timeString, formatDetails);
handled = true;
}
示例7: RaceModule
public RaceModule(IRaceData raceDataStream, IOutput output)
{
Before += ctx => {
String message = String.Format("{0} : [Host: {1}] {2}",
DateTime.Now,
ctx.Request.UserHostAddress,
ctx.Request.Url.ToString());
output.WriteLine(message);
String token = ctx.Request.Headers["X-Hamstring-Token"].SingleOrDefault();
if (token == null || token.Trim() != SERVICE_TOKEN) {
output.WriteLine("=== ACCESS DENIED ===");
return HttpStatusCode.Forbidden;
}
return ctx.Response;
};
Get["/races"] = routeParameters => {
var races = raceDataStream.UpcomingRaces();
return Response.AsJson(races);
};
After += ctx => {
//http://en.wikipedia.org/wiki/List_of_HTTP_header_fields
ctx.Response.Headers.Add("X-Powered-By", "HamstringFX.RaceService");
ctx.Response.Headers.Add("X-Version", "1.0");
};
}
示例8: MsDeployPackage
public MsDeployPackage(ILog log, IShell shell, TemplateConfigurer config, IOutput output)
{
_log = log;
_shell = shell;
_config = config;
_output = output;
}
示例9: InteractiveMode
internal InteractiveMode(ICmdArguments cmdArguments, ISelectionMenu selectionMenu, IOutput output, IInteractiveModeMenuEntry[] interactiveModeMenuEntries)
{
_cmdArguments = cmdArguments;
_selectionMenu = selectionMenu;
_output = output;
_interactiveModeMenuEntries = interactiveModeMenuEntries;
}
示例10: Execute
public bool Execute(string subject, IQueueTools tools, IOutput log)
{
IEnumerable<QueueDescriptor> queueDescriptors;
if(_options.Public)
{
queueDescriptors = tools.GetPublicQueuesByMachine(_options.Machine, TransactionFromFlags(_options.Transactional, _options.NonTransactional));
}
else
{
queueDescriptors = tools.GetPrivateQueues(_options.Machine, TransactionFromFlags(_options.Transactional, _options.NonTransactional));
}
if(!string.IsNullOrEmpty(_options.Filter))
{
queueDescriptors = Filter(_options.Filter, queueDescriptors);
}
IReporter r;
if(!string.IsNullOrEmpty(_options.DumpFile))
{
r = new JsonFileReporter(queueDescriptors, _options.DumpFile);
}
else
{
r = new LineReporter(queueDescriptors);
}
r.Report(log);
return true;
}
示例11: RunListener
public RunListener(IConsole console, IOutput output, TimingRunListener timer)
{
_console = console;
_timer = timer;
_output = output;
_summary = new FailedSpecificationsSummary(new VerboseOutput(console), console);
}
示例12: CommandLine
internal CommandLine(IBuildEnvironment buildEnvironment, ICmdParser cmdParser, ICmdArguments cmdArguments, IOutput output)
{
_buildEnvironment = buildEnvironment;
_cmdParser = cmdParser;
_cmdArguments = cmdArguments;
_output = output;
}
示例13: Server
public Server(
IHttpListener listener,
IEndpointProvider endpointProvider,
IOutput output,
ISoapDecoder soapDecoder,
ILogger logger,
IContentTypeProvider contentTypeProvider,
IWebRequestFactory webRequestFactory)
{
this.listener = listener;
this.endpointProvider = endpointProvider;
this.output = output;
this.soapDecoder = soapDecoder;
this.logger = logger;
this.contentTypeProvider = contentTypeProvider;
this.webRequestFactory = webRequestFactory;
try
{
listener.Prefixes.Add(endpointProvider.ServerBaseUrl);
}
catch (ArgumentException ex)
{
throw new FailException(
string.Format(
"While attempting to listen on URL '{1}': {0}",
ex.Message,
endpointProvider.ServerBaseUrl),
ex);
}
logger.Info("Listening on: {0}", endpointProvider.ServerBaseUrl);
}
示例14: SocketSniffer
public SocketSniffer(NetworkInterfaceInfo nic, Filters<IPPacket> filters, IOutput output)
{
this.outputQueue = new BlockingCollection<TimestampedData>();
this.filters = filters;
this.output = output;
this.bufferManager = new BufferManager(BUFFER_SIZE, MAX_RECEIVE);
this.receivePool = new ConcurrentStack<SocketAsyncEventArgs>();
var endPoint = new IPEndPoint(nic.IPAddress, 0);
// IPv4
this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
this.socket.Bind(endPoint);
this.socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, true);
// Enter promiscuous mode
try
{
this.socket.IOControl(IOControlCode.ReceiveAll, BitConverter.GetBytes(1), new byte[4]);
}
catch (Exception ex)
{
Console.WriteLine("Unable to enter promiscuous mode: {0}", ex);
throw;
}
}
示例15: OutputLogViewModel
public OutputLogViewModel(IOutput writer, OutputLog control)
{
// Store values.
Writer = writer;
Control = control;
// Create objects.
Strings = new StringLibrary();
Lines = new ObservableCollection<OutputLineViewModel>();
scrollDelay = new DelayedAction(0.1, ScrollToBottom);
// Create brushes.
dividerColor = new SolidColorBrush(Colors.Black) { Opacity = 0.1 };
lineBreakColor = new SolidColorBrush(Color.FromArgb(255, 255, 0, 228)) { Opacity = 0.4 };
// Create commands.
ClearCommand = new DelegateCommand<Button>(m => Clear(), m => IsClearButtonEnabled);
// Wire up events.
writer.WrittenTo += HandleWrittenTo;
writer.Cleared += delegate { Clear(); };
writer.BreakInserted += delegate { InsertBreak(); };
// Finish up.
UpdateLineMargin();
}