Ejemplo n.º 1
0
 public SessionProperties(string userAgentName, string apiKey, 
     EncryptionPreferences encryptionPreferences)
 {
     UserAgentName = userAgentName;
     APIKey = apiKey;
     EncryptionPreferences = encryptionPreferences;
 }
Ejemplo n.º 2
0
 public void SetSecurityPreference(EncryptionPreferences preferences, bool secureChannelRequested)
 {
     bool secure;
     switch (preferences)
     {
         case EncryptionPreferences.AlwaysHttp:
             secure = false;
             break;
         case EncryptionPreferences.AlwaysHttps:
             secure = true;
             break;
         case EncryptionPreferences.Default:
             secure = secureChannelRequested;
             break;
         default:
             throw new InvalidOperationException("Invalid enumeration value.");
     }
     _builder.Scheme = secure ? "https" : "http";
 }
Ejemplo n.º 3
0
 public SessionProperties(Assembly assm, string apiKey,
     EncryptionPreferences encryptionPreferences)
     : this(SmugRestHelpers.UserAgentNameFromAssembly(assm), apiKey, encryptionPreferences)
 {
 }