public static byte[] WriteTypingNotify(uint uin, TypingNotifyType type, ushort length = 0) { using (PacketWriter writer = new PacketWriter()) { writer.Write((length >= 1 ? length : Utils.ToInternalTypingNotify(type))); //type or structHeader writer.Write(uin); //gg num return(BuildHeader(Container.GG_TYPING_NOTIFY, writer.Data)); } }
internal static ushort ToInternalTypingNotify(TypingNotifyType type) { switch (type) { case TypingNotifyType.Start: return(Container.GG_TYPING_NOTIFY_TYPE_START); case TypingNotifyType.Stop: return(Container.GG_TYPING_NOTIFY_TYPE_STOP); default: return(0); } }
public static void ReadTypingNotify(byte[] data, out uint uin, out TypingNotifyType type, out ushort length) { using (PacketReader reader = new PacketReader(data)) { length = reader.ReadUInt16(); //type or structHeader type = (length >= 1 ? TypingNotifyType.Start : TypingNotifyType.Stop); uin = reader.ReadUInt32(); //gg num reader.Close(); } }
/// <summary> /// Stwórz argumenty dla powiadomienia o pisaniu. /// </summary> /// <param name="uin">Numer GG</param> /// <param name="type">Typ powiadomienia</param> /// <param name="length">Długość wpisanego tekstu</param> public TypingNotifyEventArgs(uint uin, TypingNotifyType type, ushort length) { _uin = uin; _type = type; _length = length; }
/// <summary> /// Stwórz argumenty dla powiadomienia o pisaniu. /// </summary> /// <param name="uin">Numer GG</param> /// <param name="type">Typ powiadomienia</param> public TypingNotifyEventArgs(uint uin, TypingNotifyType type) : this(uin, type, 0) { }