CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.SetLastModifiedDate C# (CSharp) Method

SetLastModifiedDate() private method

Set the last modification date of a local file to whatever a remote document's last modfication date is.
private SetLastModifiedDate ( IDocument remoteDocument, string filepath, string[]>.Dictionary metadata ) : void
remoteDocument IDocument
filepath string
metadata string[]>.Dictionary
return void
            private void SetLastModifiedDate(IDocument remoteDocument, string filepath, Dictionary<string, string[]> metadata)
            {
                try
                {
                    if (remoteDocument.LastModificationDate != null)
                    {
                        File.SetLastWriteTimeUtc(filepath, (DateTime)remoteDocument.LastModificationDate);
                    }
                    else
                    {
                        string[] cmisModDate;
                        if (metadata.TryGetValue("cmis:lastModificationDate", out cmisModDate) && cmisModDate.Length == 3) // TODO explain 3 and 2 in following line
                        {
                            DateTime modDate = DateTime.Parse(cmisModDate[2]);
                            File.SetLastWriteTimeUtc(filepath, modDate);
                        }
                    }
                }
                catch (Exception e)
                {
                    Logger.Debug(String.Format("Failed to set last modified date for the local file: {0}", filepath), e);
                }
            }

Same methods

CmisRepo.SynchronizedFolder::SetLastModifiedDate ( IFolder remoteFolder, string folderpath, string[]>.Dictionary metadata ) : void