public static void ExecuteMethod_AddProcessObjectToContainerAndStoreBoth(ProcessContainer ownerProcessContainer, Process process) { if(ownerProcessContainer.ProcessIDs == null) ownerProcessContainer.ProcessIDs = new List<string>(); ownerProcessContainer.ProcessIDs.Add(process.ID); ownerProcessContainer.StoreInformation(); process.StoreInformation(); }
public static void ExecuteMethod_ExecuteAndStoreProcessWithLock(string processLockLocation, Process process) { string lockEtag; bool obtainLock = StorageSupport.AcquireLogicalLockByCreatingBlob(processLockLocation, out lockEtag); if (obtainLock == false) return; try { string operationTypeName = process.ExecutingOperation.ItemFullType; OperationSupport.ExecuteOperation(operationTypeName, new Tuple<string, object>("Process", process)); process.StoreInformation(); } finally { StorageSupport.ReleaseLogicalLockByDeletingBlob(processLockLocation, lockEtag); } }