本文整理汇总了C#中WriteCallback类的典型用法代码示例。如果您正苦于以下问题:C# WriteCallback类的具体用法?C# WriteCallback怎么用?C# WriteCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WriteCallback类属于命名空间,在下文中一共展示了WriteCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SendFileOperation
public SendFileOperation(string filename, WriteCallback callback)
{
this.filename = filename;
this.callback = callback;
Length = -1;
}
开发者ID:JoergEg,项目名称:manos,代码行数:7,代码来源:SendFileOperation.cs
示例2: SendFileOperation
public SendFileOperation(string filename, WriteCallback callback)
{
this.file = new FileStream (file_name, FileMode.Open, FileAccess.Read)
this.callback = callback;
file_length = (int) file.Length;
ReadFile ();
}
开发者ID:JoergEg,项目名称:manos,代码行数:8,代码来源:SendFileOperation_NO_SENDFILE.cs
示例3: SendFileOperation
public SendFileOperation(string filename, long size, WriteCallback callback)
{
this.filename = filename;
this.callback = callback;
// TODO: async. Don't think there is a good reason to do any locking here.
file_length = file.Length;
}
开发者ID:garuma,项目名称:manos,代码行数:8,代码来源:SendFileOperation.cs
示例4: WriteFileOperation
public WriteFileOperation(FileStream file, WriteCallback callback)
{
this.file = file;
this.callback = callback;
file_length = (int) file.Length;
ReadFile ();
}
开发者ID:nickcanz,项目名称:manos,代码行数:8,代码来源:WriteFileOperation_NO_SENDFILE.cs
示例5: SendFileOperation
public SendFileOperation(FileStream file, WriteCallback callback)
{
this.file = file;
this.callback = callback;
// TODO: async. Don't think there is a good reason to do any locking here.
file_length = file.Length;
}
开发者ID:koush,项目名称:manos,代码行数:8,代码来源:SendFileOperation.cs
示例6: WriteBuffer
/// <summary>Initializes a new instance of the <see cref="WriteBuffer"/> class.</summary>
/// <param name="write">The method that is called when the buffer needs to be emptied.</param>
/// <param name="bufferSize">The size of the buffer in bytes.</param>
/// <exception cref="ArgumentNullException"><paramref name="write"/> equals <c>null</c>.</exception>
/// <exception cref="ArgumentOutOfRangeException"><paramref name="bufferSize"/> is 0 or negative.</exception>
public WriteBuffer(WriteCallback write, int bufferSize)
: base(bufferSize)
{
if (write == null)
{
throw new ArgumentNullException(nameof(write));
}
this.write = write;
this.writeAsync = (b, o, c, t) => ThrowInvalidAsyncOperationException();
}
开发者ID:Lawo,项目名称:ember-plus-sharp,代码行数:16,代码来源:WriteBuffer.cs
示例7: WriteLineHelper
internal WriteLineHelper(bool lineWrap, WriteCallback wlc, WriteCallback wc, DisplayCells displayCells)
{
if (wlc == null)
{
throw PSTraceSource.NewArgumentNullException("wlc");
}
if (displayCells == null)
{
throw PSTraceSource.NewArgumentNullException("displayCells");
}
this._displayCells = displayCells;
this.writeLineCall = wlc;
this.writeCall = (wc != null) ? wc : wlc;
this.lineWrap = lineWrap;
}
开发者ID:nickchal,项目名称:pash,代码行数:15,代码来源:WriteLineHelper.cs
示例8: FlacWriter
public FlacWriter(Stream output, int bitDepth, int channels, int sampleRate)
{
stream = output;
writer = new BinaryWriter(stream);
inputBitDepth = bitDepth;
inputChannels = channels;
inputSampleRate = sampleRate;
context = FLAC__stream_encoder_new();
if (context == IntPtr.Zero)
throw new ApplicationException("FLAC: Could not initialize stream encoder!");
Check(
FLAC__stream_encoder_set_channels(context, channels),
"set channels");
Check(
FLAC__stream_encoder_set_bits_per_sample(context, bitDepth),
"set bits per sample");
Check(
FLAC__stream_encoder_set_sample_rate(context, sampleRate),
"set sample rate");
Check(
FLAC__stream_encoder_set_compression_level(context, 5),
"set compression level");
//Check(
// FLAC__stream_encoder_set_blocksize(context, 8192),
// "set block size");
write = new WriteCallback(Write);
seek = new SeekCallback(Seek);
tell = new TellCallback(Tell);
if (FLAC__stream_encoder_init_stream(context,
write, seek, tell,
null, IntPtr.Zero) != 0)
throw new ApplicationException("FLAC: Could not open stream for writing!");
}
开发者ID:jeetu17,项目名称:RealTimeVoiceRecognizer,代码行数:43,代码来源:FlacWriter.cs
示例9: FlacReader
public FlacReader(string input, WavWriter output)
{
if (output == null)
throw new ArgumentNullException("WavWriter");
stream = File.OpenRead(input);
reader = new BinaryReader(stream);
writer = output;
context = FLAC__stream_decoder_new();
if (context == IntPtr.Zero)
throw new ApplicationException("FLAC: Could not initialize stream decoder!");
write = new WriteCallback(Write);
metadata = new MetadataCallback(Metadata);
error = new ErrorCallback(Error);
if (FLAC__stream_decoder_init_file(context,
input, write, metadata, error,
IntPtr.Zero) != 0)
throw new ApplicationException("FLAC: Could not open stream for reading!");
}
开发者ID:aljordan,项目名称:WAME,代码行数:23,代码来源:FlacReader.cs
示例10: SendFinalChunk
public void SendFinalChunk(WriteCallback callback)
{
EnsureMetadata ();
if (!chunk_encode || final_chunk_sent)
return;
final_chunk_sent = true;
var bytes = new List<ByteBuffer> ();
WriteChunk (bytes, 0, true);
var write_bytes = new SendBytesOperation (bytes, callback);
QueueWriteOperation (write_bytes);
}
开发者ID:JoergEg,项目名称:manos,代码行数:16,代码来源:HttpStream.cs
示例11: FLAC__stream_encoder_init_stream
static extern int FLAC__stream_encoder_init_stream(IntPtr context, WriteCallback write, SeekCallback seek, TellCallback tell, MetadataCallback metadata, IntPtr userData);
开发者ID:jeetu17,项目名称:RealTimeVoiceRecognizer,代码行数:1,代码来源:FlacWriter.cs
示例12: WriteOperation
public WriteOperation(int index, WriteCallback callback)
{
this.index = index;
this.callback = callback;
}
开发者ID:jcbozonier,项目名称:manos,代码行数:5,代码来源:IOStream.cs
示例13: FinishWrite
private void FinishWrite()
{
WriteCallback callback = write_callback;
write_data = null;
write_callback = null;
callback ();
}
开发者ID:jcbozonier,项目名称:manos,代码行数:9,代码来源:IOStream.cs
示例14: FinishSendFile
private void FinishSendFile()
{
WriteCallback callback = write_callback;
write_callback = null;
send_file.Close ();
send_file = null;
send_file_count = 0;
send_file_offset = 0;
callback ();
}
开发者ID:jcbozonier,项目名称:manos,代码行数:13,代码来源:IOStream.cs
示例15: Write
public void Write(IList<ArraySegment<byte>> data, WriteCallback callback)
{
CheckCanWrite ();
write_data = data;
write_callback = callback;
EnableWriting ();
}
开发者ID:jcbozonier,项目名称:manos,代码行数:9,代码来源:IOStream.cs
示例16: SendFile
public void SendFile(string file, WriteCallback callback)
{
CheckCanRead ();
write_callback = callback;
send_file = new FileStream (file, FileMode.Open, FileAccess.Read);
send_file_offset = 0;
send_file_count = send_file.Length;
EnableWriting ();
}
开发者ID:jcbozonier,项目名称:manos,代码行数:12,代码来源:IOStream.cs
示例17: Write
public void Write(byte[] data, WriteCallback callback)
{
var writeDelegate = new WriteDelegate(Write);
var asyncState = new HidAsyncState(writeDelegate, callback);
writeDelegate.BeginInvoke(data, EndWrite, asyncState);
}
开发者ID:GotenXiao,项目名称:blink1,代码行数:6,代码来源:HidDevice.cs
示例18: BeginWrite
/// <summary>
/// Starts writing specified data to source stream.
/// </summary>
/// <param name="data">Data what to write to source stream.</param>
/// <param name="callback">Callback to be callled if write completes.</param>
/// <exception cref="ArgumentNullException">Raised when <b>data</b> is null.</exception>
/// <exception cref="InvalidOperationException">Raised when there already is pending write operation.</exception>
public void BeginWrite(byte[] data,WriteCallback callback)
{
if(data == null){
throw new ArgumentNullException("data");
}
BeginWrite(data,0,data.Length,callback);
}
开发者ID:janemiceli,项目名称:authenticated_mail_server,代码行数:15,代码来源:StreamHelper.cs
示例19: SetupIOEntry
private void SetupIOEntry(ushort port, ReadCallback read, WriteCallback write)
{
var entry = new IOEntry {Read = read, Write = write};
ioPorts.Add(port, entry);
}
开发者ID:cryogen,项目名称:VM86CS,代码行数:6,代码来源:Machine.cs
示例20: SendBufferedOps
public void SendBufferedOps(WriteCallback callback)
{
if (write_ops != null) {
IWriteOperation [] ops = write_ops.ToArray ();
for (int i = 0; i < ops.Length; i++) {
SocketStream.QueueWriteOperation (ops [i]);
}
write_ops.Clear ();
}
SocketStream.QueueWriteOperation (new NopWriteOperation (callback));
}
开发者ID:JoergEg,项目名称:manos,代码行数:13,代码来源:HttpStream.cs
注:本文中的WriteCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论