コード例 #1
0
ファイル: EnumAdapter.cs プロジェクト: Ant0ny/bitsharp-dbus
        public static EncryptionTypes Adapt(MonoTorrent.Client.Encryption.EncryptionTypes type)
        {
            EncryptionTypes t = EncryptionTypes.None;

            if (Has(MonoTorrent.Client.Encryption.EncryptionTypes.PlainText, type))
            {
                t |= EncryptionTypes.PlainText;
            }
            if (Has(MonoTorrent.Client.Encryption.EncryptionTypes.RC4Full, type))
            {
                t |= EncryptionTypes.RC4Full;
            }
            if (Has(MonoTorrent.Client.Encryption.EncryptionTypes.RC4Header, type))
            {
                t |= EncryptionTypes.RC4Header;
            }

            return(t);
        }
コード例 #2
0
ファイル: EnumAdapter.cs プロジェクト: Ant0ny/bitsharp-dbus
 private static bool Has(MonoTorrent.Client.Encryption.EncryptionTypes wanted, MonoTorrent.Client.Encryption.EncryptionTypes actual)
 {
     return((wanted & actual) == wanted);
 }