public ActionResult Facet(int? id, Facet facet, FacetActions facetAction, int? facetItemIndex ) { switch (facetAction) { case FacetActions.Add: var facetItem = new FacetItem {Id = id.Value, Label = GetFacets()[facet.Index].LabelFunction(id.Value)}; facet.FacetItems.Add(facetItem); break; case FacetActions.Remove: facet.FacetItems.RemoveAt(facetItemIndex.Value); break; case FacetActions.ToggleMandatory: facet.FacetItems[facetItemIndex.Value].Mandatory = !facet.FacetItems[facetItemIndex.Value].Mandatory; break; } GetFacets()[facet.Index].FacetItems = facet.FacetItems; GetFacets()[facet.Index].IssueUpdate = true; GetFacets().Where(f=>f.Index != facet.Index).ToList().ForEach(f=>f.IssueUpdate = false); facet.IssueUpdate = true; return View(facet); }
/// <summary> /// Creates a new FacetEventArgs object /// </summary> /// <param name="action">The FacetActions value for this args</param> /// <param name="name">The name of the new region, or the new name of the facet, depending on the action</param> /// <param name="focus">States whether the program should focus on the new region if the action adds a new region</param> public FacetEventArgs(FacetActions action, string name, bool focus) { m_Action = action; m_Name = name; m_FocusRegion = focus; }
/// <summary> /// Creates a new FacetEventArgs object /// </summary> /// <param name="action">The FacetActions value for this args</param> /// <param name="name">The name of the new region, or the new name of the facet, depending on the action</param> /// <param name="focus">States whether the program should focus on the new region if the action adds a new region</param> public FacetEventArgs( FacetActions action, string name, bool focus ) { m_Action = action; m_Name = name; m_FocusRegion = focus; }