예제 #1
0
        /// <summary>
        /// Enregistrement d'une vue
        /// </summary>
        public void RegisterNewViewCommand(string viewName)
        {
            //Récupération du controleur de la vue
            IController controller = LoadController(viewName);

            if (controller == null)
            {
                throw new ArgumentNullException("L'assembly n'a pas défini de controleur.");
            }

            //Récupère les propriété de la commande New dans la vue
            string            cmdId             = string.Format("New_{0}", viewName);
            CommandProperties commandProperties = controller.CommandManager.GetProperties("New");

            if (commandProperties == null)
            {
                throw new ArgumentNullException(string.Format("La commande {0} n'existe pas dans la vue {1}", cmdId, viewName));
            }

            //Enregistre la commande d'insertion de l'interface graphique dans la vue principale
            ICommand command = new NewViewCommand(commandReceiver, viewName, cmdId, commandProperties.Text, commandProperties.Icon, commandProperties.AccelKey, commandProperties.Description);

            CommandManager.RegisterCommand(command);
        }
예제 #2
0
        /// <summary>
        /// Enregistrement d'une vue
        /// </summary>
        public void RegisterNewViewCommand(string viewName)
        {
            //Récupération du controleur de la vue
            IController controller = LoadController(viewName);
               		if (controller == null)
               			throw new ArgumentNullException("L'assembly n'a pas défini de controleur.");

             	//Récupère les propriété de la commande New dans la vue
               	string cmdId = string.Format("New_{0}", viewName);
               	CommandProperties commandProperties = controller.CommandManager.GetProperties("New");
               		if (commandProperties == null)
               			throw new ArgumentNullException(string.Format("La commande {0} n'existe pas dans la vue {1}",  cmdId, viewName));

            //Enregistre la commande d'insertion de l'interface graphique dans la vue principale
               	ICommand command = new NewViewCommand(commandReceiver, viewName, cmdId, commandProperties.Text, commandProperties.Icon, commandProperties.AccelKey, commandProperties.Description);
               	CommandManager.RegisterCommand(command);
        }