Define() public méthode

public Define ( TypeDefinition container, string method_full_name ) : bool
container TypeDefinition
method_full_name string
Résultat bool
Exemple #1
0
			public override void Define (TypeContainer parent)
			{
				parameters.Resolve (this);
				
				base.Define (parent);

				Spec = new MethodSpec (MemberKind.Method, parent.PartialContainer.Definition, this, ReturnType, ParameterInfo, ModFlags);

				method_data = new MethodData (method, ModFlags, flags, this);

				method_data.Define (parent.PartialContainer, method.GetFullName (MemberName));
			}
Exemple #2
0
		public override bool Define ()
		{
			if (!base.Define ())
				return false;

			if (!CheckBase ())
				return false;

			MemberKind kind;
			if (this is Operator)
				kind = MemberKind.Operator;
			else if (this is Destructor)
				kind = MemberKind.Destructor;
			else
				kind = MemberKind.Method;

			string explicit_name;

			if (IsPartialDefinition) {
				caching_flags &= ~Flags.Excluded_Undetected;
				caching_flags |= Flags.Excluded;

				// Add to member cache only when a partial method implementation has not been found yet
				if ((caching_flags & Flags.PartialDefinitionExists) != 0)
					return true;

				if (IsExplicitImpl)
					return true;

				explicit_name = null;
			} else {
				MethodData = new MethodData (this, ModFlags, flags, this, base_method);

				if (!MethodData.Define (Parent.PartialContainer, GetFullName (MemberName)))
					return false;

				explicit_name = MethodData.MetadataName;
			}

			spec = new MethodSpec (kind, Parent.Definition, this, ReturnType, parameters, ModFlags);
			if (MemberName.Arity > 0)
				spec.IsGeneric = true;

			Parent.MemberCache.AddMember (this, explicit_name, spec);

			return true;
		}
Exemple #3
0
			public virtual void Define (TypeContainer parent)
			{
				// Fill in already resolved event type to speed things up and
				// avoid confusing duplicate errors
				((Parameter) parameters.FixedParameters[0]).Type = method.member_type;
				parameters.Types = new TypeSpec[] { method.member_type };

				method_data = new MethodData (method, method.ModFlags,
					method.flags | MethodAttributes.HideBySig | MethodAttributes.SpecialName, this);

				if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName)))
					return;

				if (Compiler.Settings.WriteMetadataOnly)
					block = null;

				Spec = new MethodSpec (MemberKind.Method, parent.PartialContainer.Definition, this, ReturnType, ParameterInfo, method.ModFlags);
				Spec.IsAccessor = true;
			}