public FileTransmissionObject(TransmissionType type, IFileInfo localFile, IDocument remoteFile) {
if (localFile == null) {
throw new ArgumentNullException("localFile");
}
if (!localFile.Exists) {
throw new ArgumentException(string.Format("'{0} file does not exist", localFile.FullName), "localFile");
}
if (remoteFile == null) {
throw new ArgumentNullException("remoteFile");
}
if (remoteFile.Id == null) {
throw new ArgumentNullException("remoteFile.Id");
}
if (string.IsNullOrEmpty(remoteFile.Id)) {
throw new ArgumentException("empty string", "remoteFile.Id");
}
this.Type = type;
this.LocalPath = localFile.FullName;
this.LastContentSize = localFile.Length;
this.LastLocalWriteTimeUtc = localFile.LastWriteTimeUtc;
this.RemoteObjectId = remoteFile.Id;
this.LastChangeToken = remoteFile.ChangeToken;
this.RemoteObjectPWCId = remoteFile.VersionSeriesCheckedOutId;
this.LastRemoteWriteTimeUtc = remoteFile.LastModificationDate;
if (this.LastRemoteWriteTimeUtc != null) {
this.LastRemoteWriteTimeUtc = this.LastRemoteWriteTimeUtc.GetValueOrDefault().ToUniversalTime();
}
}