コード例 #1
0
		//===========================================================================================
		private void WriteConstructor(IndentedTextWriter writer, Type type, ConstructorInfo constructor)
		{
			if (constructor != null && constructor.GetCustomAttribute<CLSCompliantAttribute>() != null)
				writer.WriteLine("[CLSCompliant(false)]");

			writer.Write("public ");
			WriteType(writer, type);
			writer.Write("(");
			if (constructor != null)
				WriteParameters(writer, constructor, ParameterMode.Name | ParameterMode.Type);
			writer.WriteLine(")");
			writer.Indent++;
			writer.Write(": ");
			if (_Types.Contains(GraphicsMagickNET.GetBaseType(type)))
				writer.Write("base");
			else
				writer.Write("this");
			writer.Write("(AssemblyHelper.CreateInstance(");
			WriteTypeOf(writer, type);
			if (constructor != null)
			{
				WriteParameterTypes(writer, constructor, ParameterMode.AddColon);
				WriteParameters(writer, constructor, ParameterMode.Name | ParameterMode.Instance | ParameterMode.AddColon);
			}
			writer.WriteLine("))");
			writer.Indent--;
			WriteStartColon(writer);
			WriteEndColon(writer);
		}