Exemplo n.º 1
0
 public PacketRecv(RecvType recvType, int address, string recv, string message)
 {
     this.recvType = recvType;
     this.address  = address;
     this.message  = message;
     this.recv     = recv;
 }
Exemplo n.º 2
0
 public PacketRecv(RecvType recvType, int address, string recv, string message)
 {
     this.recvType = recvType;
     this.address = address;
     this.message = message;
     this.recv = recv;
 }
Exemplo n.º 3
0
        private byte[] GetDisplayName(RecvType type)
        {
            if (RecipientProperties.Count == 0)
                return new byte[0];
            List<byte> result = new List<byte>();

            foreach (var recvStruct in RecipientProperties)
            {
                var recvTypeProp = recvStruct.Properties.GetProperty(0x0C150003);
                var recvType = BitConverter.ToInt32(recvTypeProp.PropValue.BytesForMsg, 0);
                if (recvType == (int)type)
                {
                    IPropValue recvDisplayName = null;
                    if (recvStruct.Properties.ContainProperty(0x3001001F))
                    {
                        recvDisplayName = recvStruct.Properties.GetProperty(0x3001001F);
                    }
                    else if (recvStruct.Properties.ContainProperty(0x3A20001F))
                    {
                        recvDisplayName = recvStruct.Properties.GetProperty(0x3A20001F);
                    }
                    else
                        throw new InvalidProgramException();

                    result.AddRange(recvDisplayName.PropValue.BytesForMsg);
                    result.AddRange(BitConverter.GetBytes((short)0x003B));
                    result.AddRange(BitConverter.GetBytes((short)0x0020));

                }
            }

            if (result.Count > 0)
            {
                result.RemoveAt(result.Count - 1);
                result.RemoveAt(result.Count - 1);
                result.RemoveAt(result.Count - 1);
                result.RemoveAt(result.Count - 1);
            }

            return result.ToArray();
        }