예제 #1
0
            public void SetOperationResult(OperationResult resultEOperationResult)
            {
                Debug.WriteLine("ArchiveCallback->SetOperationResult: " + resultEOperationResult);
                if (_fileStream != null)
                {
                    _fileStream.Dispose();

                    // should pass-thru?
                    var fileInfo = new FileInfo(_currentFileName);
                    // set creation time
                    if (fileInfo.Exists)
                    {
                        //_command.WriteVerbose("Setting creation and lastwrite time of " + _currentFileName + " to: " + _modificationTimes[_currentIndex].ToLocalTime());
                        File.SetCreationTime(_currentFileName, _modificationTimes[_currentIndex]);
                        File.SetLastWriteTime(_currentFileName, _modificationTimes[_currentIndex]);
                        File.SetLastAccessTime(_currentFileName, _modificationTimes[_currentIndex]);
                    }
                    if (_passThru && fileInfo.Exists)
                    {
                        _command.WriteObject(fileInfo);
                    }
                }
            }
예제 #2
0
            public void SetOperationResult(OperationResult resultEOperationResult)
            {
                Debug.WriteLine("ArchiveCallback->SetOperationResult: " + resultEOperationResult);
                if (_fileStream != null)
                {                    
                    _fileStream.Dispose();

                    // should pass-thru?
                    var fileInfo = new FileInfo(_currentFileName);
                    // set creation time
                    if (fileInfo.Exists) {
                        //_command.WriteVerbose("Setting creation and lastwrite time of " + _currentFileName + " to: " + _modificationTimes[_currentIndex].ToLocalTime());
                        File.SetCreationTime(_currentFileName,_modificationTimes[_currentIndex]);
                        File.SetLastWriteTime(_currentFileName, _modificationTimes[_currentIndex]);
                        File.SetLastAccessTime(_currentFileName, _modificationTimes[_currentIndex]);
                    }
                    if (_passThru && fileInfo.Exists)
                    {
                        _command.WriteObject(fileInfo);
                    }
                }
            }