コード例 #1
0
ファイル: CSyncFile.cs プロジェクト: doctorgu/MadeIn9
        public CSyncFile(string[] aFullPathSrc, string RootFolderSrc, CFtpInfoSync[] aFtpInfo, SyncTypes SyncType,
                         bool MinifyJs, string[] aFullPathReferencingJs, string[] aJsFullPathRefered, DateTime DateTimeAfter, string LogFolder)
        {
            this._aFullPathSrc = aFullPathSrc;

            this._RootFolderSrc = RootFolderSrc;
            this._aFtpInfoDest  = aFtpInfo;
            this._SyncType      = SyncType;
            this._MinifyJs      = MinifyJs;

            if (aFullPathReferencingJs.Length > 0)
            {
                this._aFullPathReferencingJs = aFullPathReferencingJs;
            }
            if (aJsFullPathRefered.Length > 0)
            {
                this._aJsFullPathRefered = aJsFullPathRefered;
            }

            this._DateTimeAfter = DateTimeAfter;
            this._LogFolder     = LogFolder;

            //{
            this.mWatcher.IncludeSubdirectories = true;
            this.mWatcher.EnableRaisingEvents   = this.mEnableWatcher;
            this.mWatcher.NotifyFilter
                = NotifyFilters.DirectoryName
                  | NotifyFilters.FileName
                  | NotifyFilters.CreationTime
                  | NotifyFilters.LastWrite;

            this.mWatcher.Path = RootFolderSrc;

            this.mWatcher.Changed += new FileSystemEventHandler(mWatcher_Changed);
            this.mWatcher.Created += new FileSystemEventHandler(mWatcher_Created);
            this.mWatcher.Renamed += new RenamedEventHandler(mWatcher_Renamed);
            this.mWatcher.Deleted += new FileSystemEventHandler(mWatcher_Deleted);
            //}

            _aFtp = new CFtp2[aFtpInfo.Length];
            for (int i = 0; i < _aFtp.Length; i++)
            {
                _aFtp[i] = new CFtp2(aFtpInfo[i]);
                _aFtp[i].BeforeDirectoryUpload += new EventHandler <CBeforeDirectoryUploadEventArgs>(ftp_BeforeDirectoryUpload);
                _aFtp[i].BeforeFileUpload      += new EventHandler <CBeforeFileUploadEventArgs>(ftp_BeforeFileUpload);
                _aFtp[i].AfterFileUpload       += new EventHandler <CAfterFileUploadEventArgs>(ftp_AfterFileUpload);
                _aFtp[i].FileUploadFailed      += new EventHandler <CFileUploadFailedEventArgs>(ftp_FileUploadFailed);
            }

            _DestType = DestTypes.Ftp;
        }
コード例 #2
0
ファイル: CSyncFile.cs プロジェクト: doctorgu/MadeIn9
        public CSyncFile(string[] aFullPathSrc, string RootFolderSrc, string[] aRootFolderDest, SyncTypes SyncType,
                         bool MinifyJs, string[] aFullPathReferencingJs, string[] aJsFullPathRefered, DateTime DateTimeAfter, string LogFolder)
        {
            this._aFullPathSrc    = aFullPathSrc;
            this._RootFolderSrc   = RootFolderSrc;
            this._aRootFolderDest = aRootFolderDest;
            this._SyncType        = SyncType;
            this._MinifyJs        = MinifyJs;

            if (aFullPathReferencingJs.Length > 0)
            {
                this._aFullPathReferencingJs = aFullPathReferencingJs;
            }
            if (aJsFullPathRefered.Length > 0)
            {
                this._aJsFullPathRefered = aJsFullPathRefered;
            }

            this._DateTimeAfter = DateTimeAfter;
            this._LogFolder     = LogFolder;

            //{
            this.mWatcher.IncludeSubdirectories = true;
            this.mWatcher.EnableRaisingEvents   = this.mEnableWatcher;
            this.mWatcher.NotifyFilter
                = NotifyFilters.DirectoryName
                  | NotifyFilters.FileName
                  | NotifyFilters.CreationTime
                  | NotifyFilters.LastWrite;

            this.mWatcher.Path = RootFolderSrc;

            this.mWatcher.Changed += new FileSystemEventHandler(mWatcher_Changed);
            this.mWatcher.Created += new FileSystemEventHandler(mWatcher_Created);
            this.mWatcher.Renamed += new RenamedEventHandler(mWatcher_Renamed);
            this.mWatcher.Deleted += new FileSystemEventHandler(mWatcher_Deleted);
            //}

            _File.BeforeDirectoryCopy += new EventHandler <CBeforeDirectoryCopyEventArgs>(_File_BeforeDirectoryCopy);
            _File.BeforeFileCopy      += new EventHandler <CBeforeFileCopyEventArgs>(f_BeforeFileCopy);
            _File.AfterFileCopy       += new EventHandler <CAfterFileCopyEventArgs>(f_AfterFileCopy);

            _DestType = DestTypes.FileSystem;
        }