コード例 #1
0
        protected override void BeginProcessing()
        {
            CompositionInitializer.Initialize(CloudProvider.COMPOSITION_DIRECTORY);
            CompositionInitializer.SatisfyImports(this);

            base.BeginProcessing();
        }
コード例 #2
0
        protected override ProviderInfo Start(ProviderInfo providerInfo)
        {
            Environment.CurrentDirectory = SessionState.Path.CurrentFileSystemLocation.Path;

            CompositionInitializer.Preload(typeof(Interface.Composition.ICloudGateway));
            CompositionInitializer.Initialize(COMPOSITION_DIRECTORY);

            return(base.Start(providerInfo));
        }
コード例 #3
0
        protected override PSDriveInfo NewDrive(PSDriveInfo drive)
        {
            if (drive == null)
            {
                throw new ArgumentNullException(nameof(drive));
            }

            var factory = new CloudDriveFactory();

            CompositionInitializer.SatisfyImports(factory);

            var parameters = DynamicParameters as CloudDriveParameters;

            if (string.IsNullOrEmpty(parameters?.EncryptionKey))
            {
                WriteWarning(string.Format(CultureInfo.CurrentCulture, Resources.UnencryptedDrive, drive.Name, drive.Credential.UserName, drive.Root));
            }

            return(base.NewDrive(factory.CreateCloudDrive(drive, parameters)));
        }
コード例 #4
0
        public void OnImport()
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            CompositionInitializer.HostInitialized += (s, e) => CompositionInitializer.SatisfyImports(this);
        }