/// <include file='doc\CodeTypeDelegate.uex' path='docs/doc[@for="CodeTypeDelegate.CodeTypeDelegate"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Initializes a new instance of <see cref='System.CodeDom.CodeTypeDelegate'/>.
 ///    </para>
 /// </devdoc>
 public CodeTypeDelegate()
 {
     TypeAttributes &= ~TypeAttributes.ClassSemanticsMask;
     TypeAttributes |= TypeAttributes.Class;
     BaseTypes.Clear();
     BaseTypes.Add(new CodeTypeReference("System.Delegate"));
 }
        /// <summary>
        /// To be merged with another type definition, <see cref="Kind"/> and <see cref="TypeName.Key"/> must be the same
        /// otherwise an <see cref="InvalidOperationException"/> is thrown.
        /// </summary>
        /// <param name="other">The other type definition.</param>
        /// <returns>The merged definition.</returns>
        public void MergeWith(TypeDefinition other)
        {
            if (other == null)
            {
                throw new ArgumentNullException(nameof(other));
            }
            if (Kind != other.Kind)
            {
                throw new InvalidOperationException($"Unable to merge type '{ToString()}' with '{other}': Kind differ {Kind} vs. {other.Kind}.");
            }
            if (Name.Key != other.Name.Key)
            {
                throw new InvalidOperationException($"Unable to merge type '{ToString()}' with '{other}': TypeDefinitionKey differ {Name.Key} vs. {other.Name.Key}.");
            }

            Attributes.MergeWith(other.Attributes);
            Modifiers |= other.Modifiers;

            var baseTypes = new HashSet <ExtendedTypeName>(BaseTypes.Concat(other.BaseTypes));

            BaseTypes.Clear();
            BaseTypes.AddRange(baseTypes);

            var constraints = new HashSet <TypeParameterConstraint>(Constraints.Concat(other.Constraints));

            Constraints.Clear();
            Constraints.AddRange(constraints);
        }
Exemple #3
0
        public static void ReleaseAll()
        {
            AllTypesByFullName.Clear();
            BaseTypes.Clear();
            Caches.Clear();
#if UNITY_EDITOR
            MonoSerialize.Release();
#endif
            if (on_release_all != null)
            {
                on_release_all();
            }
        }
Exemple #4
0
        public static void ReleaseAll()
        {
            AllTypesByFullName.Clear();
            BaseTypes.Clear();
            Caches.Clear();
#if UNITY_EDITOR
            BinarySerializable.Release();
            if (on_release_all != null)
            {
                on_release_all();
            }
#endif
        }
Exemple #5
0
 public static void ReleaseAll()
 {
     AllTypesByFullName.Clear();
     BaseTypes.Clear();
     Caches.Clear();
 }