/// <summary> /// Checks writeback flag and, if it is set, starts an asynchronous writeback to WMIS process /// </summary> /// <returns>true if successful; else, false</returns> private bool DoWriteBack(SharedWriteBackLibrary p_swbl) { try { JobManager jobManager = new JobManager(); // ALM 1566 - Requests removal of the check for the write back flag. // Future design change will check for this in a different way // but leaving the conditional statement for clarity until // that change is implemented. if (true /*jobManager.WriteBackNeeded*/) { // The shared library does the actual writeback. // Asynchronous call to perform the writeback. Guid taskID = Guid.NewGuid(); p_swbl.UpdateWriteBack(jobManager.ActiveJob, taskID); // Subscribed to writeback completed event so no longer need a pointer to the library object. p_swbl = null; } return(true); } catch (Exception ex) { string exMsg = string.Format("Error occurred in {0} of {1}.{2}{3}", System.Reflection.MethodBase.GetCurrentMethod().Name, this.ToString(), Environment.NewLine, ex.Message); throw new Exception(exMsg); } }
/// <summary> /// Starts an asynchronous writeback to WMIS process /// </summary> private void DoWriteBack(SharedWriteBackLibrary p_swbl) { try { // The shared library does the actual writeback. // Once complete, it will call the WriteBackProcessCompleted event. //SharedWriteBackLibrary swbl = new SharedWriteBackLibrary(); // p_swbl.WriteBackProcessCompleted += swbl_WriteBackProcessCompleted; // Asynchronous call to perform the writeback. Guid taskID = Guid.NewGuid(); JobManager jobManager = new JobManager(); p_swbl.UpdateWriteBack(jobManager.ActiveJob, taskID); // Subscribed to writeback completed event so no longer need a pointer to the library object. p_swbl = null; // Deactivate the active job. // The argument determines whether to keep the job associated with the workspace in read-only mode. // Design doesn't state one way or the other but going with true. jobManager.DeactivateJob(true); } catch (Exception ex) { string exMsg = string.Format("Error occurred in {0} of {1}.{2}{3}", System.Reflection.MethodBase.GetCurrentMethod().Name, this.ToString(), Environment.NewLine, ex.Message); throw new Exception(exMsg); } }
/// <summary> /// Calls the shared writeback code to perform the actual writeback. /// Displays the confirmation dialog box which the user can dismiss if desired (writeback will continue). /// Subscribes to the WriteBackProcessCompleted event so user can be notified when process completes. /// </summary> private void startWriteback(SharedWriteBackLibrary p_swbl) { JobManager jm = new JobManager(); // The shared library does the actual writeback. IGTApplication app = GTClassFactory.Create <IGTApplication>(); // Asynchronous call to perform the writeback. Guid taskID = Guid.NewGuid(); p_swbl.UpdateWriteBack(jm.ActiveJob, taskID); p_swbl = null; // Deactivate the active job. // The argument determines whether to keep the job associated with the workspace in read-only mode. // Design doesn't state one way or the other but going with true. jm.DeactivateJob(true); jm = null; }
/// <summary> /// Checks writeback flag and, if it is set, starts an asynchronous writeback to WMIS process /// </summary> /// <returns>true if successful; else, false</returns> private bool DoWriteBack(SharedWriteBackLibrary p_swbl) { try { JobManager jobManager = new JobManager(); // ALM 1566 - Requests removal of the check for the write back flag. // Future design change will check for this in a different way // but leaving the conditional statement for clarity until // that change is implemented. if (true /*jobManager.WriteBackNeeded*/) { // The shared library does the actual writeback. // Once complete, it will call the WriteBackProcessCompleted event. // SharedWriteBackLibrary swbl = new SharedWriteBackLibrary(); // swbl.WriteBackProcessCompleted += swbl_WriteBackProcessCompleted; // Asynchronous call to perform the writeback. Guid taskID = Guid.NewGuid(); p_swbl.UpdateWriteBack(jobManager.ActiveJob, taskID); // Subscribed to writeback completed event so no longer need a pointer to the library object. p_swbl = null; // Deactivate the active job. // The argument determines whether to keep the job associated with the workspace in read-only mode. // Design doesn't state one way or the other but going with true. jobManager.DeactivateJob(true); } return(true); } catch (Exception ex) { string exMsg = string.Format("Error occurred in {0} of {1}.{2}{3}", System.Reflection.MethodBase.GetCurrentMethod().Name, this.ToString(), Environment.NewLine, ex.Message); throw new Exception(exMsg); } }