예제 #1
0
 public void SetProtocol(string protocol)
 {
     if (protocol != null)
     {
         try {
             Protocol = (SecurityProtocolType)Enum.Parse(typeof(SecurityProtocolType), protocol);
         }
         catch (Exception e) {
             string message = String.Format("The value '{0}' given for security protocol is invalid.", protocol);
             throw new CryptographicException(message, e);
         }
     }
     else
     {
         Protocol = SecurityProtocolType.Default;
     }
 }
예제 #2
0
		public void SetProtocol (string protocol)
		{
			if (protocol != null) {
				try {
					Protocol = (SecurityProtocolType) Enum.Parse (typeof (SecurityProtocolType), protocol);
				}
				catch (Exception e) {
					string message = String.Format ("The value '{0}' given for security protocol is invalid.", protocol);
					throw new CryptographicException (message, e);
				}
			} else {
				Protocol = SecurityProtocolType.Default;
			}
		}