public static WebMachine CreateWebMachine(int Id, global::System.DateTime lastUsed, byte[] rowVersion) { WebMachine webMachine = new WebMachine(); webMachine.Id = Id; webMachine.LastUsed = lastUsed; webMachine.RowVersion = rowVersion; return webMachine; }
private void LastUsedUpdated(IAsyncResult result) { WebMachine selectedMachine = result.AsyncState as WebMachine; this.RaiseCallBack(selectedMachine.MachineName, new string[0] { }, new string[0] { }); }
public static WebMachine CreateWebMachine(int Id, global::System.DateTime lastUsed, byte[] rowVersion) { WebMachine webMachine = new WebMachine(); webMachine.Id = Id; webMachine.LastUsed = lastUsed; webMachine.RowVersion = rowVersion; return(webMachine); }
private void OnQueryComplete(IAsyncResult result) { try { List <WebMachine> queriedMachines = this.strategy.EndExecute(result).ToList(); foreach (string machineName in this.machinesToAvoid) { List <WebMachine> machinesToRemove = queriedMachines.Where(m => m.MachineName == machineName).ToList(); foreach (WebMachine machineToRemove in machinesToRemove) { queriedMachines.Remove(machineToRemove); } } WebMachine selectedMachine = queriedMachines.FirstOrDefault(); if (selectedMachine != null) { this.strategy.UpdateMachineLastUsedProperty(DateTime.Now, this.LastUsedUpdated, selectedMachine); } else { this.RaiseCallBack(null, new string[0] { }, new string[1] { "No IISMachine was able to be found with the given query" }); } } catch (Exception exception) { this.RaiseCallBack(null, new string[0] { }, new string[1] { "Error occurred in querying for a WebServer:" + exception.ToString() }); } }
/// <summary> /// Updates an IISMachines LastUsed property /// </summary> /// <param name="updatedTime">DateTime to update LastUsed Property to</param> /// <param name="callback">Function to return to</param> /// <param name="machine">IISMachine to Update LastUsed property</param> /// <returns>An AsynResult</returns> public IAsyncResult UpdateMachineLastUsedProperty(DateTime updatedTime, AsyncCallback callback, WebMachine machine) { machine.LastUsed = updatedTime; return(new FakeAsyncResult(callback, machine)); }
/// <summary> /// Updates an IISMachines LastUsed property /// </summary> /// <param name="updatedTime">DateTime to update LastUsed Property to</param> /// <param name="callback">Function to return to</param> /// <param name="machine">IISMachine to Update LastUsed property</param> /// <returns>An AsynResult</returns> public IAsyncResult UpdateMachineLastUsedProperty(DateTime updatedTime, AsyncCallback callback, WebMachine machine) { machine.LastUsed = updatedTime; this.IISMachineEntities.UpdateObject(machine); return(this.IISMachineEntities.BeginSaveChanges(callback, machine)); }
public void AddToWebMachines(WebMachine webMachine) { base.AddObject("WebMachines", webMachine); }