Exemple #1
0
        private void ChargerAssembly()
        {
            //string oldDir = Directory.GetCurrentDirectory();
            //string dirName = Path.GetDirectoryName(m_pathproj);
            //Directory.SetCurrentDirectory(dirName);
            //string baseName = Path.GetFileName(m_pathproj);

            m_ass = null;
            try
            {
                m_ass = Assembly.LoadFrom(m_pathdll);
            }
            catch (Exception e)
            {
            }

            if (m_ass == null)
            {
                return;
            }

            //Sauvegarde de la dernière modification
            FileInfo inf = new FileInfo(m_pathdll);

            m_datemodif = inf.LastWriteTime;

            object[] atts = m_ass.GetCustomAttributes(typeof(DocInfoPath), false);
            if (atts.Length != 1)
            {
                m_installe = false;
            }
            else
            {
                Module mod = m_ass.GetModule("");
                m_installe = true;
                DocInfoPath pathdoc = (DocInfoPath)atts[0];
                m_docinfo = new CDocInfo(pathdoc.Path);
                if (!m_docinfo.Valide)
                {
                    m_installe = false;
                }
            }
        }
Exemple #2
0
        private bool DeterminationType()
        {
            string nom = CDocInfo.ExtraireNomAttribut(m_ligne);
            Type   t;

            if (nom == typeof(DocMenu).Name)
            {
                t = typeof(DocMenu);
            }
            else if (nom == typeof(DocMenuItem).Name)
            {
                t = typeof(DocMenuItem);
            }
            else if (nom == typeof(DocRessource).Name)
            {
                t = typeof(DocRessource);
            }
            else if (nom == typeof(DocDossierRessource).Name)
            {
                t = typeof(DocDossierRessource);
            }
            else if (nom == typeof(DocLienRessourceMenu).Name)
            {
                t = typeof(DocLienRessourceMenu);
            }
            else if (nom == typeof(DocLienRessourceMenuItem).Name)
            {
                t = typeof(DocLienRessourceMenuItem);
            }
            else if (nom == typeof(DocLienRessourceRessource).Name)
            {
                t = typeof(DocLienRessourceRessource);
            }
            else
            {
                return(false);
            }

            m_tattribut = t;
            return(true);
        }