public RepresentationHandler(MenuRepresentation representation) { if (representation == null) { throw new ArgumentException("Rappresentazione Nulla!"); } _representation = representation; }
public MenuRepresentation CreateSubMenu(IList <string> enabledFunctions) { MenuRepresentation r = new MenuRepresentation(); foreach (string item in enabledFunctions) { Function f = FindFunction(item); if (f != null) { r.AddFunction(f); } } return(r); }
public void CreateAndConstructSubMenuRepresentation(IMenuWidgetConstructor constructor) { if (_applicationMenuProvider == null) { throw new ArgumentException("Il provider dei menù non può essere nullo; Inizializzare la classe facade!"); } //Creo la sotto rappresentazione del menu if (_representation == null) { _representation = _applicationMenuProvider.CreateApplicationMenuRepresentation(); } //Costruisco fisicamente il menu if (constructor != null) { constructor.ConstructMenu(_representation); } }