internal void ProcessData(BinaryReader data) { // [ContentPlainText String][ContentHTMLText String] ContentPlainText = BBProtocol.ReadString(data); ContentHtmlText = BBProtocol.ReadString(data); IsValid = true; }
internal void ProcessData(BinaryReader data) { // [Text String][Type String] Text = BBProtocol.ReadString(data); Type = BBProtocol.ReadString(data); IsValid = true; }
internal void ProcessData(BinaryReader data) { // [FileID 4][Filesize 8][Name String][Type String] FileID = data.ReadInt32(); FileSize = data.ReadUInt64(); FileName = BBProtocol.ReadString(data); FileType = BBProtocol.ReadString(data); IsValid = true; }
internal void ProcessData(BinaryReader data) { // [Text String][CursorPos 4][LastInputID 4] Text = BBProtocol.ReadString(data); CursorPos = data.ReadInt32(); LastProcessedInputID = data.ReadInt32(); if (CursorPos < 0 || CursorPos > Text.Length) { Log.e(TAG, "Invalid Cursor pos on InputFocusChange received" + CursorPos); CursorPos = Text.Length; } IsValid = true; }
internal void ProcessData(BinaryReader data) { // [FileID 4][Command 1][IsSender 1][ErrorMsg String] try { FileID = data.ReadInt32(); Command = (EFileCommand)data.ReadByte(); IsSender = data.ReadByte() != 0; ErrorMessage = BBProtocol.ReadString(data); } catch (Exception) { IsValid = false; return; } IsValid = true; }
internal void ProcessData(BinaryReader data) { // [ImeOptions 4][InputType 4][Hint String][PackageName String][Text String][CursorPos 4][FieldID 4] ImeOptions = data.ReadInt32(); InputType = data.ReadInt32(); Hint = BBProtocol.ReadString(data); PackageName = BBProtocol.ReadString(data); Text = BBProtocol.ReadString(data); CursorPos = data.ReadInt32(); FieldID = data.ReadInt32(); if (CursorPos < 0 || CursorPos > Text.Length) { Log.e(TAG, "Invalid Cursor pos on InputFocusChange received" + CursorPos); CursorPos = Text.Length; } IsValid = true; }
internal void ProcessData(BinaryReader data) { // [MaxVer 1][MinVer 1][ReqPassword 1][Desc String][ServerGUID 4] MaxSupportedVersion = data.ReadByte(); MinSupportedVersion = data.ReadByte(); RequiresPassword = data.ReadByte() > 0; Desc = BBProtocol.ReadString(data); ServerGUID = data.ReadInt32(); if (MaxSupportedVersion >= 2) { // [SupportsScreenCapture 1][ProVersion 1] SupportsScreenCapture = data.ReadByte() > 0; IsProVersion = data.ReadByte() > 0; } IsValid = true; }
internal void ProcessData(BinaryReader buf) { // [Header 5] [UsedProtVer 1] [IP InetAddress] [tcpPort 2] [DeviceName String] [FlagPassword 1] [ProtocolMin 1] [ProtocolMax 1][ServerGUID 4] ProtocolVersion = buf.ReadByte(); if (ProtocolVersion < 0x01 || ProtocolVersion > BBProtocol.REQUESTED_DISCOVERY_PROTOCOL_VERSION) { ParseError = "Protocolversion unsupported"; return; } ServerIP = BBProtocol.ReadInetAddress(buf); ServerPort = buf.ReadUInt16(); ServerName = BBProtocol.ReadString(buf); PasswordRequired = buf.ReadByte() != 0; MinProtocolVer = buf.ReadByte(); MaxProtocolVer = buf.ReadByte(); ServerGUID = buf.ReadInt32(); IsValid = true; }
internal void ProcessData(BinaryReader data) { PackageName = BBProtocol.ReadString(data); MemoryStream bs = (MemoryStream)data.BaseStream; try { Image = new BitmapImage(); Image.BeginInit(); Image.DecodeFailed += (x, e) => { throw e.ErrorException; }; Image.StreamSource = new MemoryStream(bs.GetBuffer(), (int)bs.Position, (int)bs.Remaining()); Image.EndInit(); Image.Freeze(); Log.d(TAG, "Loaded received image for package " + PackageName); } catch (Exception e) { // don't disconnect just because we fail to decode an image Image = null; Log.w(TAG, "Failed to load/decode received image for package " + PackageName + " - " + e.Message); } IsValid = true; }