public TypeProvidersContext(TypeProvidersConnection connection)
 {
     Connection = connection;
     ProvidedCustomAttributeProvider = new ProvidedCustomAttributeProvider(connection);
     ProvidedTypesCache      = new ProvidedTypesCache(this);
     ProvidedAssembliesCache = new ProvidedAssembliesCache(this);
 }
        private ProxyProvidedAssembly(RdProvidedAssembly assembly, TypeProvidersConnection typeProvidersConnection)
            : base(null)
        {
            myAssembly = assembly;
            myTypeProvidersConnection = typeProvidersConnection;

            myManifestModuleContent = new InterruptibleLazy <byte[]>(() =>
                                                                     myTypeProvidersConnection.ExecuteWithCatch(() =>
                                                                                                                RdProvidedAssemblyProcessModel.GetManifestModuleContents.Sync(EntityId, RpcTimeouts.Maximal)));
        }
        public static T ExecuteWithCatch <T>(this TypeProvidersConnection connection, Func <T> func)
        {
            try
            {
                return(connection.Execute(func));
            }
            catch (RdFault ex)
            {
                if (ex.ReasonTypeFqn == TypeProvidersInstantiationException.ReasonTypeFqn)
                {
                    throw new TypeProvidersInstantiationException(ex.ReasonMessage, ex.ReasonText);
                }

                throw new ProvidedTypeException(ex.ReasonMessage);
            }
        }
 public ProvidedCustomAttributeProvider(TypeProvidersConnection connection)
 {
     myConnection = connection;
 }
 public static ProxyProvidedAssembly Create(RdProvidedAssembly assembly, TypeProvidersConnection connection) =>
 new ProxyProvidedAssembly(assembly, connection);