internal static EncryptedType GetTrackedType(Type type, EncryptionProxyConfiguration configuration = null)
        {
            var encryptedType = GetTrackedTypeByEncrypted(type);

            if (encryptedType != null)
            {
                return(encryptedType);
            }

            var existingType = GetTrackedTypeOrNull(type);

            if (existingType == null)
            {
                if (configuration == null)
                {
                    configuration = new EncryptionProxyConfiguration();
                }
                existingType = new EncryptedType(type, configuration);
                Types.Add(existingType);
                TypesByProxy.Add(existingType.ProxyType.FullName, existingType);
                TypesByOriginal.Add(type.FullName, existingType);
            }
            return(existingType);
        }
예제 #2
0
 internal EncryptedInstance(EncryptedType type, object instance)
 {
     EncryptedType   = type;
     Reference       = new WeakReference(instance);
     InstanceKeyring = new Keyring();
 }