public Character() { Name = "Default Name"; Server = "Default Server"; ArrProgress = new ArrModel(); ShBModel = new ShBModel(); SkysteelModel = new SkysteelModel(); HWModel = new HWModel(); }
/// <summary> /// Returns the message property from the HWModel object of ID "index" /// </summary> /// <param name="index">The id property for the HWModel object to be returned</param> /// <returns></returns> public async Task <string> GetMessage(int index) { HWModel model = new HWModel(); HttpResponseMessage response = await client.GetAsync("api/HW/" + index.ToString()); if (response.IsSuccessStatusCode) { model = await response.Content.ReadAsAsync <HWModel>(); } return(model.Message); }
public Character(string name, string server) { Name = name; Server = server; ArrProgress = new ArrModel(); ShBModel = new ShBModel(); HWModel = new HWModel(); SBModel = new SBModel(); SkysteelModel = new SkysteelModel(); ArrLayout = "Horizontal"; HWLayout = "Horizontal"; SBLayout = "Horizontal"; ShBLayout = "Horizontal"; SkysteelLayout = "Horizontal"; }
/// <summary> /// Deletes the selected object of ID "id" from teh list /// </summary> /// <param name="id">The ID of the selected object</param> public void DeleteMessage(int id) { HWModel modelToDelete = model.SingleOrDefault(m => m.ID == id); model.Remove(modelToDelete); }
/// <summary> /// Adds a new HWModel Object to the list of objects /// </summary> /// <param name="modelToAdd">Object of type HWModel to be added to the list</param> public void PostMessage(HWModel modelToAdd) { model.Add(modelToAdd); }
/// <summary> /// Updates the HWObject of the selected ID /// </summary> /// <param name="id">The ID of teh object to update</param> /// <param name="message">the message to be updated</param> public void PutMessage(int id, [FromBody] string message) { HWModel modelToEdit = model.SingleOrDefault(m => m.ID == id); modelToEdit.Message = message; }