public override void VisitExternTypeCollection(ExternTypeCollection externs)
        {
            ExternTypeCollection ext = externs as ExternTypeCollection;

            if (!m_tHeap.HasTable(ExportedTypeTable.RId))
            {
                return;
            }

            ExportedTypeTable etTable = m_tableReader.GetExportedTypeTable();

            TypeReference [] buffer = new TypeReference [etTable.Rows.Count];

            for (int i = 0; i < etTable.Rows.Count; i++)
            {
                ExportedTypeRow etRow = etTable [i];
                if (etRow.Implementation.TokenType != TokenType.File)
                {
                    continue;
                }

                string name = m_root.Streams.StringsHeap [etRow.TypeName];
                string ns   = m_root.Streams.StringsHeap [etRow.TypeNamespace];
                if (ns.Length == 0)
                {
                    buffer [i] = m_module.TypeReferences [name];
                }
                else
                {
                    buffer [i] = m_module.TypeReferences [string.Concat(ns, '.', name)];
                }
            }

            for (int i = 0; i < etTable.Rows.Count; i++)
            {
                ExportedTypeRow etRow = etTable [i];
                if (etRow.Implementation.TokenType != TokenType.ExportedType)
                {
                    continue;
                }

                TypeReference owner = buffer [etRow.Implementation.RID - 1];
                string        name  = m_root.Streams.StringsHeap [etRow.TypeName];
                buffer [i] = m_module.TypeReferences [string.Concat(owner.FullName, '/', name)];
            }

            for (int i = 0; i < buffer.Length; i++)
            {
                TypeReference curs = buffer [i];
                if (curs != null)
                {
                    ext.Add(curs);
                }
            }
        }
Beispiel #2
0
 public virtual void VisitExternTypeCollection(ExternTypeCollection externs)
 {
 }
		public override void VisitExternTypeCollection (ExternTypeCollection externs)
		{
			VisitCollection (externs);
		}
Beispiel #4
0
        public override void VisitExternTypeCollection(ExternTypeCollection externs)
        {
            ExternTypeCollection ext = externs;

            if (!m_tHeap.HasTable (ExportedTypeTable.RId))
                return;

            ExportedTypeTable etTable = m_tableReader.GetExportedTypeTable ();
            TypeReference [] buffer = new TypeReference [etTable.Rows.Count];

            for (int i = 0; i < etTable.Rows.Count; i++) {
                ExportedTypeRow etRow = etTable [i];
                if (etRow.Implementation.TokenType != TokenType.File)
                    continue;

                string name = m_root.Streams.StringsHeap [etRow.TypeName];
                string ns = m_root.Streams.StringsHeap [etRow.TypeNamespace];
                if (ns.Length == 0)
                    buffer [i] = m_module.TypeReferences [name];
                else
                    buffer [i] = m_module.TypeReferences [string.Concat (ns, '.', name)];
            }

            for (int i = 0; i < etTable.Rows.Count; i++) {
                ExportedTypeRow etRow = etTable [i];
                if (etRow.Implementation.TokenType != TokenType.ExportedType)
                    continue;

                TypeReference owner = buffer [etRow.Implementation.RID - 1];
                string name = m_root.Streams.StringsHeap [etRow.TypeName];
                buffer [i] = m_module.TypeReferences [string.Concat (owner.FullName, '/', name)];
            }

            for (int i = 0; i < buffer.Length; i++) {
                TypeReference curs = buffer [i];
                if (curs != null)
                    ext.Add (curs);
            }
        }
        public virtual void VisitExternTypeCollection(ExternTypeCollection externs)
        {

        }
 public virtual void VisitExternTypeCollection(ExternTypeCollection externs)
 {
     foreach (TypeReference type in externs)
     {
         VisitExternType(type);
     }
 }
Beispiel #7
0
		public override void VisitExternTypeCollection (ExternTypeCollection externs)
		{
			ExternTypeCollection ext = externs;

			if (!m_tHeap.HasTable (ExportedTypeTable.RId))
				return;

			ExportedTypeTable etTable = m_tableReader.GetExportedTypeTable ();
			TypeReference [] buffer = new TypeReference [etTable.Rows.Count];

			for (int i = 0; i < etTable.Rows.Count; i++) {
				ExportedTypeRow etRow = etTable [i];

				buffer [i] = new TypeDefinition (
					m_root.Streams.StringsHeap [etRow.TypeName],
					m_root.Streams.StringsHeap [etRow.TypeNamespace],
					etRow.Flags);
				buffer [i].AttachToScope (GetExportedTypeScope (etRow.Implementation));
			}

			for (int i = 0; i < etTable.Rows.Count; i++) {
				ExportedTypeRow etRow = etTable [i];
				if (etRow.Implementation.TokenType != TokenType.ExportedType)
					continue;

				TypeReference exported = buffer [i];
				TypeReference owner = buffer [etRow.Implementation.RID - 1];
				exported.DeclaringType = owner;
				exported.AttachToScope (owner.Scope);
			}

			for (int i = 0; i < buffer.Length; i++) {
				TypeReference curs = buffer [i];
				if (curs != null)
					ext.Add (curs);
			}
		}
Beispiel #8
0
		public override void VisitExternTypeCollection (ExternTypeCollection externs)
		{
			if (externs.Count == 0)
				return;

			ExportedTypeTable etTable = m_tableWriter.GetExportedTypeTable ();
			foreach (TypeReference ext in externs) {
				TypeDefinition td = ext.Resolve ();
				if (td == null)
					continue;

				MetadataToken scope = GetExportedTypeScope (td);

				ExportedTypeRow etRow = m_rowWriter.CreateExportedTypeRow (
					td.Attributes,
					0,
					m_mdWriter.AddString (td.Name),
					m_mdWriter.AddString (td.Namespace),
					scope);

				etTable.Rows.Add (etRow);
				ext.MetadataToken = new MetadataToken (TokenType.ExportedType, (uint) etTable.Rows.Count);
			}
		}