System.Xml.UniqueId.TryGetGuid C# (CSharp) Méthode

TryGetGuid() public méthode

public TryGetGuid ( System.Guid &guid ) : bool
guid System.Guid
Résultat bool
        public bool TryGetGuid(out Guid guid)
        {
            byte[] buffer = new byte[guidLength];
            if (!TryGetGuid(buffer, 0))
            {
                guid = Guid.Empty;
                return false;
            }

            guid = new Guid(buffer);
            return true;
        }

Same methods

UniqueId::TryGetGuid ( System &guid ) : bool
UniqueId::TryGetGuid ( byte buffer, int offset ) : bool

Usage Example

Exemple #1
0
 public bool IsNotSeenBefore(Message message, out byte[] id, out int cacheHit)
 {
     cacheHit = -1;
     id       = PeerNodeImplementation.DefaultId;
     if (message is SecurityVerifiedMessage)
     {
         id = (message as SecurityVerifiedMessage).PrimarySignatureValue;
     }
     else
     {
         System.Xml.UniqueId messageId = PeerMessageHelpers.GetHeaderUniqueId(message.Headers, PeerStrings.MessageId, PeerStrings.Namespace);
         if (messageId == null)
         {
             return(false);
         }
         if (messageId.IsGuid)
         {
             id = new byte[16];
             messageId.TryGetGuid(id, 0);
         }
         else
         {
             return(false);
         }
     }
     cacheHit = messageIds.AddForLookup(id);
     if (cacheHit == -1)
     {
         return(true);
     }
     return(false);
 }
All Usage Examples Of System.Xml.UniqueId::TryGetGuid