コード例 #1
0
 public void ExecuteSyncActions(int packageId, FileSyncAction[] actions)
 {
     FilesController.ExecuteSyncActions(packageId, actions);
 }
コード例 #2
0
 public void ExecuteSyncActions(FileSyncAction[] actions)
 {
     try
     {
         Log.WriteStart("'{0}' ExecuteSyncActions", ProviderSettings.ProviderName);
         OsProvider.ExecuteSyncActions(actions);
         Log.WriteEnd("'{0}' ExecuteSyncActions", ProviderSettings.ProviderName);
     }
     catch (Exception ex)
     {
         Log.WriteError(String.Format("'{0}' ExecuteSyncActions", ProviderSettings.ProviderName), ex);
         throw;
     }
 }
コード例 #3
0
        public static void ExecuteSyncActions(int packageId, FileSyncAction[] actions)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return;

            OS.OperatingSystem os = GetOS(packageId);

            // update actions
            foreach (FileSyncAction action in actions)
            {
                if (!String.IsNullOrEmpty(action.SrcPath))
                    action.SrcPath = GetFullPackagePath(packageId, action.SrcPath);
                if (!String.IsNullOrEmpty(action.DestPath))
                    action.DestPath = GetFullPackagePath(packageId, action.DestPath);
            }

            // perform sync
            os.ExecuteSyncActions(actions);
        }
コード例 #4
0
ファイル: FilesProxy.cs プロジェクト: lwhitelock/Websitepanel
 /// <remarks/>
 public void ExecuteSyncActionsAsync(int packageId, FileSyncAction[] actions) {
     this.ExecuteSyncActionsAsync(packageId, actions, null);
 }
コード例 #5
0
ファイル: FilesProxy.cs プロジェクト: lwhitelock/Websitepanel
 /// <remarks/>
 public void ExecuteSyncActionsAsync(int packageId, FileSyncAction[] actions, object userState) {
     if ((this.ExecuteSyncActionsOperationCompleted == null)) {
         this.ExecuteSyncActionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExecuteSyncActionsOperationCompleted);
     }
     this.InvokeAsync("ExecuteSyncActions", new object[] {
                 packageId,
                 actions}, this.ExecuteSyncActionsOperationCompleted, userState);
 }
コード例 #6
0
ファイル: FilesProxy.cs プロジェクト: lwhitelock/Websitepanel
 /// <remarks/>
 public System.IAsyncResult BeginExecuteSyncActions(int packageId, FileSyncAction[] actions, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("ExecuteSyncActions", new object[] {
                 packageId,
                 actions}, callback, asyncState);
 }
コード例 #7
0
ファイル: FilesProxy.cs プロジェクト: lwhitelock/Websitepanel
 public void ExecuteSyncActions(int packageId, FileSyncAction[] actions) {
     this.Invoke("ExecuteSyncActions", new object[] {
                 packageId,
                 actions});
 }
コード例 #8
0
ファイル: Windows2003.cs プロジェクト: jordan49/websitepanel
        public void ExecuteSyncActions(FileSyncAction[] actions)
        {
            // perform all operations but not delete ones
            foreach (FileSyncAction action in actions)
            {
                if (action.ActionType == SyncActionType.Create)
                {
                    FileUtils.CreateDirectory(action.DestPath);
                    continue;
                }
                else if (action.ActionType == SyncActionType.Copy)
                {
                    FileUtils.CopyFile(action.SrcPath, action.DestPath);
                }
                else if (action.ActionType == SyncActionType.Move)
                {
                    FileUtils.MoveFile(action.SrcPath, action.DestPath);
                }
            }

            // unzip file
            // ...after delete

            // delete files
            foreach (FileSyncAction action in actions)
            {
                if (action.ActionType == SyncActionType.Delete)
                {
                    FileUtils.DeleteFile(action.DestPath);
                }
            }
        }
コード例 #9
0
 /// <remarks/>
 public void ExecuteSyncActionsAsync(FileSyncAction[] actions) {
     this.ExecuteSyncActionsAsync(actions, null);
 }
コード例 #10
0
 public void ExecuteSyncActions(FileSyncAction[] actions) {
     this.Invoke("ExecuteSyncActions", new object[] {
                 actions});
 }