public virtual void Execute(string parameters)
        {
            XmlTools.XPathNavigatorFacade xpn= new XmlTools.XPathNavigatorFacade();
            xpn.LoadXML(parameters);

             		ArrayList names = xpn.GetAttributes("/Params", "name");
             		ArrayList values = xpn.GetAttributes("/Params", "value");

             		for (int i = 0; i < names.Count; i++) {
             			_ParamList[names[i].ToString()] = values[i].ToString();
             		}
        }
Example #2
0
        public virtual void Execute(string parameters)
        {
            XmlTools.XPathNavigatorFacade xpn = new XmlTools.XPathNavigatorFacade();
            xpn.LoadXML(parameters);

            ArrayList names  = xpn.GetAttributes("/Params", "name");
            ArrayList values = xpn.GetAttributes("/Params", "value");

            for (int i = 0; i < names.Count; i++)
            {
                _ParamList[names[i].ToString()] = values[i].ToString();
            }
        }
Example #3
0
 public Model()
 {
     xpn = new XPathNavigatorFacade();
 }
Example #4
0
        ///<summary>
        ///Lecture du fichier de configuration des vues
        ///</summary>
        public void RegisterNewViewCommands()
        {
            string configDir = Directory.GetCurrentDirectory() + "/";

            //Chargement du fichier XML
             		XPathNavigatorFacade xpn= new XPathNavigatorFacade();
             		xpn.LoadFromFile(configDir + "sofia.config");

             		//Récupération de la configuration active
             		ArrayList activeConf = xpn.GetAttributes("/Configurations", "active");
             		if (activeConf.Count == 0)
             			throw new ArgumentException ("Pas de configuration active définie. Veuillez vérifier le fichier de configuration.");

             		//Récupération des vues de la configuration active
               			string xPath = String.Format("//Configuration[@name='{0}']/Views//View", activeConf[0]);
               			views = xpn.GetAttributes(xPath, "name");

             		if (views.Count == 0)
             			throw new ArgumentException ("Aucune vue définie. Veuillez vérifier le fichier de configuration.");

               			//Enregistrement des commandes d'ouverture
              			IEnumerator enumerator = views.GetEnumerator();
              			while (enumerator.MoveNext()) {
                RegisterNewViewCommand(enumerator.Current.ToString());
            }
        }