コード例 #1
0
        //Send a message to the game window
        protected void Write(string msg)
        {
            //GameWindow.Write(msg);

            //msg += Environment.NewLine;
            OnWriting?.Invoke(msg);
        }
コード例 #2
0
ファイル: AdbStream.cs プロジェクト: sp0x/ApkLoader
        public AdbStream(IAdbSocket sock, uint localId)
        {
            _sock        = sock;
            this.LocalId = localId;

            _outputBlock = new BufferBlock <byte[]>();
            _inputBlock  = new ActionBlock <byte[]>(bytes =>
            {
                var buff = Command.CreateWriteCommand(LocalId, RemoteId, bytes);
                OnWriting?.Invoke(this, EventArgs.Empty);
                if (RemoteId == 0)
                {
                    throw new Exception("Remote stream not established yet!");
                }
                _sock.Send(buff, buff.Length);
            });
            Block = DataflowBlock.Encapsulate(_inputBlock, _outputBlock);
        }
コード例 #3
0
ファイル: AdbLocalStream.cs プロジェクト: sp0x/ApkLoader
        public AdbLocalStream(IAdbSocket sock, uint localId, Encoding encoding, CancellationToken ct)
        {
            _sock        = sock;
            _oStream     = sock.GetShellStream();
            _outputBlock = new BufferBlock <byte[]>();
            _inputBlock  = new ActionBlock <byte[]>(bytes =>
            {
                var buff = Command.CreateWriteCommand(LocalId, RemoteId, bytes);
                OnWriting?.Invoke(this, EventArgs.Empty);
                if (RemoteId == 0)
                {
                    throw new Exception("Remote stream not established yet!");
                }
                _sock.Send(buff, buff.Length);
            });
            Block = DataflowBlock.Encapsulate(_inputBlock, _outputBlock);

            HandleData(encoding, ct).ConfigureAwait(false);
        }
コード例 #4
0
 //Send a message to the game window
 void Write(string msg)
 {
     OnWriting?.Invoke(msg);
 }
コード例 #5
0
ファイル: ConsoleWindow.cs プロジェクト: jiailiuyan/jiper
 public override void WriteLine(string message)
 {
     OnWriting?.Invoke(message);
 }
コード例 #6
0
ファイル: ListeningTextWriter.cs プロジェクト: Fresa/Test.It
 public override void Write(char value)
 {
     OnWriting?.Invoke(value);
 }