Пример #1
0
 public static SharingMessageType GetSharingMessageType(SharingFlavor sharingFlavor)
 {
     EnumValidator.ThrowIfInvalid <SharingFlavor>(sharingFlavor, "sharingFlavor");
     if ((sharingFlavor & SharingFlavor.SharingMessageInvitation) == SharingFlavor.SharingMessageInvitation && (sharingFlavor & SharingFlavor.SharingMessageRequest) == SharingFlavor.SharingMessageRequest)
     {
         return(SharingMessageType.InvitationAndRequest);
     }
     if ((sharingFlavor & SharingFlavor.SharingMessageAccept) == SharingFlavor.SharingMessageAccept)
     {
         return(SharingMessageType.AcceptOfRequest);
     }
     if ((sharingFlavor & SharingFlavor.SharingMessageInvitation) == SharingFlavor.SharingMessageInvitation)
     {
         return(SharingMessageType.Invitation);
     }
     if ((sharingFlavor & SharingFlavor.SharingMessageRequest) == SharingFlavor.SharingMessageRequest)
     {
         return(SharingMessageType.Request);
     }
     if ((sharingFlavor & SharingFlavor.SharingMessageDeny) == SharingFlavor.SharingMessageDeny)
     {
         return(SharingMessageType.DenyOfRequest);
     }
     return(SharingMessageType.Unknown);
 }
Пример #2
0
 private SharingMessageType(string name, SharingFlavor sharingFlavor)
 {
     this.name          = name;
     this.sharingFlavor = sharingFlavor;
 }