Пример #1
0
        internal unsafe static AckEventArgs FromACKDATA(IntPtr pAckData)
        {
            if (pAckData == IntPtr.Zero)
                throw new ArgumentNullException("pAckData");

            ACKDATA ackData = *(ACKDATA*)pAckData.ToPointer();
            AckEventArgs ackArgs = new AckEventArgs();

            ackArgs.contact = ContactInfo.FromHandle(ackData.ContactHandle);
            ackArgs.lParam = ackData.LParam;
            ackArgs.processHandle = ackData.ProcessHandle;            
            ackArgs.result = (AckResult)ackData.Result;
            ackArgs.type = (AckType)ackData.Type;

            if (ackData.ModuleName != IntPtr.Zero)
                ackArgs.protocol = MirandaContext.Current.Protocols[Translate.ToString(ackData.ModuleName, StringEncoding.Ansi)];

            return ackArgs;
        }
Пример #2
0
        private static bool AckRouter_AckReceived(object sender, AckEventArgs e)
        {
            if (e.Type == AckType.Status)
            {
                if (StatusChangedEventHandler != null)
                    StatusChangedEventHandler(e.Protocol, new ProtocolStatusChangeEventArgs(e.Protocol, (StatusMode)e.LParam));
            }

            return EventResult.HonourEventChain;
        }