private void Initialize() { Audio = new AudioCategory(this); Process = new ProcessCategory(this); Control = new ControlCategory(this); _jsonSerializer = new JsonSerializer(); _jsonSerializer.Converters.Add(new UnixDateTimeConverter()); _jsonSerializer.Converters.Add(new StringEnumConverter()); }
public ActionResult Create(ControlCategory category) { if (ModelState.IsValid) { _controlCategoryDao.Create(category); return(RedirectToAction("Index", "ControlCategory")); } ViewBag.categories = _controlCategoryDao.GetAll().ToList(); return(View("Index")); }
public static Contracts.ControlCategory.ControlCategory ToContract(this ControlCategory dataItem) { return(new Contracts.ControlCategory.ControlCategory { ControlCategoryId = dataItem.ControlCategoryId, Name = dataItem.Name, Description = dataItem.Description, CreatedOn = dataItem.CreatedOn, UpdatedOn = dataItem.UpdatedOn, }); }
public ActionResult Edit(ControlCategory category) { if (ModelState.IsValid) { ControlCategory cat = _controlCategoryDao.GetById(category.Id); cat.Title = category.Title; cat.Description = category.Description; _controlCategoryDao.Update(cat); return(RedirectToAction("Index", "ControlCategory")); } ViewBag.categories = _controlCategoryDao.GetAll().ToList(); return(View("Index")); }
private void CreateControlCategoryMenuItem(ControlCategory category) { // The CategoryPage expects the Category-VM to be displayed as a navigation // parameter. If not provided, nothing will be displayed. var navParams = new NavigationParameters(); navParams.Add(CategoryPageViewModel.CategoryParameterName, category); var item = new NavigationMenuItemInfo( category.Name, category.Icon, typeof(CategoryPage), navParams); MenuItems.Add(item); }
public ControlRenderingStyle(ControlCategory category, int controlType, ControlStateModifier modifiers) { fControlCategory = category; fControlType = controlType; fModifiers = modifiers; }
public ActionResult Detail(int id) { ControlCategory environmentCategory = _controlCategoryDao.GetById(id); return(View(environmentCategory)); }
public KeyboardControlViewModel() { _control = MidgeCore.Instance.Client.Control; }
/// <summary> /// Adds the given control category to the page. /// </summary> public void Add(ControlCategory category) => GetOrSetMemberFunc(category.ID, (int)ControlPageAccessors.AddCategory);
public static void ApplyUpdate(this ControlCategory dataItem, Contracts.ControlCategory.UpdateControlCategory update) { dataItem.Name = update.Name; dataItem.Description = update.Description; dataItem.UpdatedOn = DateTime.Now; }