/*------------------------- public set and get methods --------------------------*/


        /// <summary>
        /// Add a class which is declared public in this external module of
        /// THIS assembly.  This class will be exported from this assembly.
        /// The ilasm syntax for this is .extern class
        /// </summary>
        /// <param name="attrSet">attributes of the class to be exported</param>
        /// <param name="nsName">name space name</param>
        /// <param name="name">external class name</param>
        /// <param name="declFile">the file where the class is declared</param>
        /// <param name="isValueClass">is this class a value type?</param>
        /// <returns>a descriptor for this external class</returns>
        public ClassRef AddExternClass(TypeAttr attrSet, string nsName,
                                       string name, bool isValueClass, PEFile pefile)
        {
            Contract.Requires(nsName != null);
            Contract.Requires(name != null);
            Contract.Requires(pefile != null);
            ClassRef cRef = new ClassRef(this, nsName, name);

            if (isValueClass)
            {
                cRef.MakeValueClass();
            }
            ExternClass eClass = new ExternClass(attrSet, nsName, name, modFile);

            exportedClasses.Add(eClass);
            cRef.SetExternClass(eClass);
            classes.Add(cRef);
            return(cRef);
        }
Exemple #2
0
 /*------------------------- public set and get methods --------------------------*/
 /// <summary>
 /// Add a class which is declared public in this external module of
 /// THIS assembly.  This class will be exported from this assembly.
 /// The ilasm syntax for this is .extern class
 /// </summary>
 /// <param name="attrSet">attributes of the class to be exported</param>
 /// <param name="nsName">name space name</param>
 /// <param name="name">external class name</param>
 /// <param name="declFile">the file where the class is declared</param>
 /// <param name="isValueClass">is this class a value type?</param>
 /// <returns>a descriptor for this external class</returns>
 public ClassRef AddExternClass(TypeAttr attrSet, string nsName,
     string name, bool isValueClass, PEFile pefile)
 {
     Contract.Requires(nsName != null);
     Contract.Requires(name != null);
     Contract.Requires(pefile != null);
     ClassRef cRef = new ClassRef(this, nsName, name);
     if (isValueClass) cRef.MakeValueClass();
     ExternClass eClass = new ExternClass(attrSet, nsName, name, modFile);
     exportedClasses.Add(eClass);
     cRef.SetExternClass(eClass);
     classes.Add(cRef);
     return cRef;
 }