Esempio n. 1
0
 public void ExecuteSyncActions(int packageId, FileSyncAction[] actions)
 {
     FilesController.ExecuteSyncActions(packageId, actions);
 }
 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;
     }
 }
Esempio n. 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);
        }
Esempio n. 4
0
 /// <remarks/>
 public void ExecuteSyncActionsAsync(int packageId, FileSyncAction[] actions) {
     this.ExecuteSyncActionsAsync(packageId, actions, null);
 }
Esempio n. 5
0
 /// <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);
 }
Esempio n. 6
0
 /// <remarks/>
 public System.IAsyncResult BeginExecuteSyncActions(int packageId, FileSyncAction[] actions, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("ExecuteSyncActions", new object[] {
                 packageId,
                 actions}, callback, asyncState);
 }
Esempio n. 7
0
 public void ExecuteSyncActions(int packageId, FileSyncAction[] actions) {
     this.Invoke("ExecuteSyncActions", new object[] {
                 packageId,
                 actions});
 }
Esempio n. 8
0
        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);
                }
            }
        }
 /// <remarks/>
 public void ExecuteSyncActionsAsync(FileSyncAction[] actions) {
     this.ExecuteSyncActionsAsync(actions, null);
 }
 public void ExecuteSyncActions(FileSyncAction[] actions) {
     this.Invoke("ExecuteSyncActions", new object[] {
                 actions});
 }