예제 #1
0
        public RepresentationHandler(MenuRepresentation representation)
        {
            if (representation == null)
            {
                throw new ArgumentException("Rappresentazione Nulla!");
            }

            _representation = representation;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
            }
        }