コード例 #1
0
 /// <summary>
 /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
 /// </summary>
 /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
 /// <returns>
 ///   <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
 /// </returns>
 public override bool Equals(object obj)
 {
     if (obj is UserAgentRequest)
     {
         UserAgentRequest request = (UserAgentRequest)obj;
         return(request.Agent == Agent && request.RequestId == RequestId);
     }
     return(base.Equals(obj));
 }
コード例 #2
0
        /// <summary>
        /// Handles the AttributeReply event of the agent.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Acn.Slp.AttributeReplyEventArgs"/> instance containing the event data.</param>
        void agent_AttributeReply(object sender, AttributeReplyEventArgs e)
        {
            SlpDeviceInformation device;

            lock (attributeRequestLog)
            {
                UserAgentRequest requestKey = new UserAgentRequest(sender as SlpUserAgent, e.RequestId);
                if (attributeRequestLog.TryGetValue(requestKey, out device))
                {
                    device.Attributes  = e.Attributes;
                    device.LastContact = DateTime.Now;
                    attributeRequestLog.Remove(requestKey);
                    OnDevicesUpdated();
                }
            }
        }