コード例 #1
0
        public void AssertGotSingleFileEvent(MetaDataChangeType metaType, ContentChangeType contentType) {
            Assert.That(this.List.Count, Is.EqualTo(1));
            Assert.That(this.List[0], Is.TypeOf(typeof(FileEvent)));
            var fileEvent = this.List[0] as FileEvent;

            Assert.That(fileEvent.Remote, Is.EqualTo(metaType), "MetaDataChangeType incorrect");
            Assert.That(fileEvent.RemoteContent, Is.EqualTo(contentType), "ContentChangeType incorrect");
        }
コード例 #2
0
ファイル: ObservableHandler.cs プロジェクト: sunxk/CmisSync
        public void AssertGotSingleFolderEvent(MetaDataChangeType metaType)
        {
            Assert.That(this.List.Count, Is.EqualTo(1));
            Assert.That(this.List[0], Is.TypeOf(typeof(FolderEvent)));
            var folderEvent = this.List[0] as FolderEvent;

            Assert.That(folderEvent.Remote, Is.EqualTo(metaType), "MetaDataChangeType incorrect");
        }
コード例 #3
0
ファイル: ObservableHandler.cs プロジェクト: sunxk/CmisSync
        public void AssertGotSingleFileEvent(MetaDataChangeType metaType, ContentChangeType contentType)
        {
            Assert.That(this.List.Count, Is.EqualTo(1));
            Assert.That(this.List[0], Is.TypeOf(typeof(FileEvent)));
            var fileEvent = this.List[0] as FileEvent;

            Assert.That(fileEvent.Remote, Is.EqualTo(metaType), "MetaDataChangeType incorrect");
            Assert.That(fileEvent.RemoteContent, Is.EqualTo(contentType), "ContentChangeType incorrect");
        }
コード例 #4
0
 /// <summary>
 /// Creates the event.
 /// </summary>
 /// <returns>The event.</returns>
 /// <param name="isFile">If set to <c>true</c> is file.</param>
 /// <param name="remoteObject">Remote object.</param>
 /// <param name="localObject">Local object.</param>
 /// <param name="remoteChange">Remote change.</param>
 /// <param name="localChange">Local change.</param>
 /// <param name="oldRemotePath">Old remote path.</param>
 /// <param name="oldLocalObject">Old local object.</param>
 /// <param name="src">Source of the creation.</param>
 public static AbstractFolderEvent CreateEvent(
     bool isFile,
     IFileableCmisObject remoteObject = null,
     IFileSystemInfo localObject = null,
     MetaDataChangeType remoteChange = MetaDataChangeType.NONE,
     MetaDataChangeType localChange = MetaDataChangeType.NONE,
     string oldRemotePath = null,
     IFileSystemInfo oldLocalObject = null,
     object src = null) {
     if (localChange != MetaDataChangeType.MOVED &&
         remoteChange != MetaDataChangeType.MOVED) {
         if (isFile) {
             return new FileEvent(
                 localObject as IFileInfo,
                 remoteObject as IDocument) {
                 Local = localChange,
                 Remote = remoteChange
             };
         } else {
             return new FolderEvent(
                 localObject as IDirectoryInfo,
                 remoteObject as IFolder,
                 src) {
                 Local = localChange,
                 Remote = remoteChange
             };
         }
     } else {
         if (isFile) {
             return new FileMovedEvent(
                 oldLocalObject as IFileInfo,
                 localObject as IFileInfo,
                 oldRemotePath,
                 remoteObject as IDocument) {
                 Local = localChange,
                 Remote = remoteChange
             };
         } else {
             return new FolderMovedEvent(
                 oldLocalObject as IDirectoryInfo,
                 localObject as IDirectoryInfo,
                 oldRemotePath,
                 remoteObject as IFolder,
                 src) {
                 Local = localChange,
                 Remote = remoteChange
             };
         }
     }
 }
コード例 #5
0
 /// <summary>
 /// Creates the event.
 /// </summary>
 /// <returns>The event.</returns>
 /// <param name="remoteObject">Remote object.</param>
 /// <param name="localObject">Local object.</param>
 /// <param name="remoteChange">Remote change.</param>
 /// <param name="localChange">Local change.</param>
 /// <param name="oldRemotePath">Old remote path.</param>
 /// <param name="oldLocalObject">Old local object.</param>
 /// <param name="src">Source of the creation.</param>
 public static AbstractFolderEvent CreateEvent(
     IFileableCmisObject remoteObject = null,
     IFileSystemInfo localObject = null,
     MetaDataChangeType remoteChange = MetaDataChangeType.NONE,
     MetaDataChangeType localChange = MetaDataChangeType.NONE,
     string oldRemotePath = null,
     IFileSystemInfo oldLocalObject = null,
     object src = null) {
     return CreateEvent(
         remoteObject is IDocument || localObject is IFileInfo,
         remoteObject,
         localObject,
         remoteChange,
         localChange,
         oldRemotePath,
         oldLocalObject,
         src);
 }
コード例 #6
0
 /// <summary>
 /// Creates the event.
 /// </summary>
 /// <returns>The event.</returns>
 /// <param name="remoteObject">Remote object.</param>
 /// <param name="localObject">Local object.</param>
 /// <param name="remoteChange">Remote change.</param>
 /// <param name="localChange">Local change.</param>
 /// <param name="oldRemotePath">Old remote path.</param>
 /// <param name="oldLocalObject">Old local object.</param>
 /// <param name="src">Source of the creation.</param>
 public static AbstractFolderEvent CreateEvent(
     IFileableCmisObject remoteObject = null,
     IFileSystemInfo localObject      = null,
     MetaDataChangeType remoteChange  = MetaDataChangeType.NONE,
     MetaDataChangeType localChange   = MetaDataChangeType.NONE,
     string oldRemotePath             = null,
     IFileSystemInfo oldLocalObject   = null,
     object src = null)
 {
     return(CreateEvent(
                remoteObject is IDocument || localObject is IFileInfo,
                remoteObject,
                localObject,
                remoteChange,
                localChange,
                oldRemotePath,
                oldLocalObject,
                src));
 }
コード例 #7
0
 public void AssertGotSingleFolderEvent(MetaDataChangeType metaType) {
     Assert.That(this.List.Count, Is.EqualTo(1));
     Assert.That(this.List[0], Is.TypeOf(typeof(FolderEvent)));
     var folderEvent = this.List[0] as FolderEvent;
     Assert.That(folderEvent.Remote, Is.EqualTo(metaType), "MetaDataChangeType incorrect");
 }
コード例 #8
0
 /// <summary>
 /// Creates the event.
 /// </summary>
 /// <returns>The event.</returns>
 /// <param name="isFile">If set to <c>true</c> is file.</param>
 /// <param name="remoteObject">Remote object.</param>
 /// <param name="localObject">Local object.</param>
 /// <param name="remoteChange">Remote change.</param>
 /// <param name="localChange">Local change.</param>
 /// <param name="oldRemotePath">Old remote path.</param>
 /// <param name="oldLocalObject">Old local object.</param>
 /// <param name="src">Source of the creation.</param>
 public static AbstractFolderEvent CreateEvent(
     bool isFile,
     IFileableCmisObject remoteObject = null,
     IFileSystemInfo localObject      = null,
     MetaDataChangeType remoteChange  = MetaDataChangeType.NONE,
     MetaDataChangeType localChange   = MetaDataChangeType.NONE,
     string oldRemotePath             = null,
     IFileSystemInfo oldLocalObject   = null,
     object src = null)
 {
     if (localChange != MetaDataChangeType.MOVED &&
         remoteChange != MetaDataChangeType.MOVED)
     {
         if (isFile)
         {
             return(new FileEvent(
                        localObject as IFileInfo,
                        remoteObject as IDocument)
             {
                 Local = localChange,
                 Remote = remoteChange
             });
         }
         else
         {
             return(new FolderEvent(
                        localObject as IDirectoryInfo,
                        remoteObject as IFolder,
                        src)
             {
                 Local = localChange,
                 Remote = remoteChange
             });
         }
     }
     else
     {
         if (isFile)
         {
             return(new FileMovedEvent(
                        oldLocalObject as IFileInfo,
                        localObject as IFileInfo,
                        oldRemotePath,
                        remoteObject as IDocument)
             {
                 Local = localChange,
                 Remote = remoteChange
             });
         }
         else
         {
             return(new FolderMovedEvent(
                        oldLocalObject as IDirectoryInfo,
                        localObject as IDirectoryInfo,
                        oldRemotePath,
                        remoteObject as IFolder)
             {
                 Local = localChange,
                 Remote = remoteChange
             });
         }
     }
 }