コード例 #1
0
        public void SetContent(FileInfoContract target, Stream content, ProgressProxy progress)
        {
            if (!string.IsNullOrEmpty(encryptionKey))
            {
                content = content.Encrypt(encryptionKey);
            }

            gateway.SetContent(rootName, target.Id, content, progress);
            target.Size = content.Length;

            InvalidateDrive();
        }
コード例 #2
0
ファイル: CloudDrive.cs プロジェクト: zhang024/DokanCloudFS
        public void SetContent(FileInfoContract target, Stream content)
        {
            ExecuteInSemaphore(() => {
                target.Size        = content.Length;
                var gatewayContent = content.EncryptOrPass(encryptionKey);

#if DEBUG
                gatewayContent = new TraceStream(nameof(target), target.Name, gatewayContent);
#endif
                gateway.SetContent(rootName, target.Id, gatewayContent, null);
            }, nameof(SetContent), true);
        }
コード例 #3
0
        public void SetContent(FileInfoContract target, Stream content)
        {
            ExecuteInSemaphore(() => {
                var gatewayContent = content.EncryptOrPass(_encryptionKey);
                target.Size        = (FileSize)content.Length;

//#if DEBUG
//                CompositionInitializer.SatisfyImports(gatewayContent = new TraceStream(nameof(target), target.Name, gatewayContent));
//#endif
                _gateway.SetContent(_rootName, target.Id, gatewayContent, null);
                if (content != gatewayContent)
                {
                    gatewayContent.Close();
                }
            }, nameof(SetContent), true);
        }