/// <summary> /// Initializes a new instance of the <see cref="ParameterSignature" /> class. /// </summary> /// <param name="name">The parameter name.</param> /// <param name="parameterType">The parameter type.</param> /// <param name="isOutParameter">if set to <c>true</c>, this is an out parameter.</param> /// <param name="isRefParameter">if set to <c>true</c>, this is a reference parameter.</param> public ParameterSignature(string name, TypeSignature parameterType, bool isOutParameter, bool isRefParameter) { Name = name; ParameterType = parameterType; IsOutParameter = isOutParameter; IsRefParameter = isRefParameter; }
/// <summary> /// Initializes a new instance of the <see cref="PropertySignature"/> class. /// </summary> /// <param name="identity">The Identity.</param> /// <param name="name">The name of the property.</param> /// <param name="declaringType">The declaring type.</param> /// <param name="propertyType">The property type.</param> public PropertySignature( string identity, string name, TypeSignature declaringType, TypeSignature propertyType) { _identity = identity; _name = name; _declaringType = declaringType; _propertyType = propertyType; }
/// <summary> /// Initializes a new instance of the <see cref="PropertySignature"/> class. /// </summary> /// <param name="identity">The Identity.</param> /// <param name="name">The name of the property.</param> /// <param name="declaringType">The declaring type.</param> /// <param name="propertyType">The property type.</param> public PropertySignature( string identity, string name, TypeSignature declaringType, TypeSignature propertyType) { Identity = identity; Name = name; DeclaringType = declaringType; PropertyType = propertyType; }
/// <summary> /// Gets the type of the dynamic object builder. /// </summary> /// <param name="properties">The properties.</param> /// <returns></returns> public static Type GetDynamicObjectBuilderType(IEnumerable<SLDataColumn> properties) { Type type; var signature = new TypeSignature(properties); if (!TypesCache.TryGetValue(signature, out type)) { type = CreateDynamicObjectBuilderType(properties); TypesCache.Add(signature, type); } return type; }
internal static Type GetDynamicObjectBuilderType(ThrowingHashSet<IPropertyInfo> properties) { lock (SyncRoot) { TypeSignature signature = new TypeSignature(properties); Type type; if (!TypesCache.TryGetValue(signature, out type)) { type = CreateDynamicObjectBuilderType(properties); TypesCache.Add(signature, type); } return type; } }
private static TagDataEntry GetEntry(TypeSignature type, int idx, ICCHeader header) { switch (type) { case TypeSignature.chromaticity: return new chromaticityTagDataEntry(idx); case TypeSignature.colorantOrder: return new colorantOrderTagDataEntry(idx); case TypeSignature.colorantTable: return new colorantTableTagDataEntry(idx); case TypeSignature.curve: return new curveTagDataEntry(idx); case TypeSignature.data: return new dataTagDataEntry(idx); case TypeSignature.dateTime: return new dateTimeTagDataEntry(idx); case TypeSignature.lut16: return new lut16TagDataEntry(idx); case TypeSignature.lut8: return new lut8TagDataEntry(idx); case TypeSignature.lutAToB: return new lutAToBTagDataEntry(idx); case TypeSignature.lutBToA: return new lutBToATagDataEntry(idx); case TypeSignature.measurement: return new measurementTagDataEntry(idx); case TypeSignature.multiLocalizedUnicode: return new multiLocalizedUnicodeTagDataEntry(idx, false); case TypeSignature.multiProcessElements: return new multiProcessElementsTagDataEntry(idx); case TypeSignature.namedColor2: return new namedColor2TagDataEntry(idx); case TypeSignature.parametricCurve: return new parametricCurveTagDataEntry(idx); case TypeSignature.profileSequenceDesc: return new profileSequenceDescTagDataEntry(idx, header); case TypeSignature.profileSequenceIdentifier: return new profileSequenceIdentifierTagDataEntry(idx); case TypeSignature.responseCurveSet16: return new responseCurveSet16TagDataEntry(idx); case TypeSignature.s15Fixed16Array: return new s15Fixed16ArrayTagDataEntry(idx); case TypeSignature.signature: return new signatureTagDataEntry(idx); case TypeSignature.text: return new textTagDataEntry(idx); case TypeSignature.u16Fixed16Array: return new u16Fixed16ArrayTagDataEntry(idx); case TypeSignature.uInt16Array: return new uInt16ArrayTagDataEntry(idx); case TypeSignature.uInt32Array: return new uInt32ArrayTagDataEntry(idx); case TypeSignature.uInt64Array: return new uInt64ArrayTagDataEntry(idx); case TypeSignature.uInt8Array: return new uInt8ArrayTagDataEntry(idx); case TypeSignature.viewingConditions: return new viewingConditionsTagDataEntry(idx); case TypeSignature.XYZ: return new XYZTagDataEntry(idx); default: return new TagDataEntry(); } }
/// <summary> /// Creates a new method with argument types given by function arguments. /// </summary> internal MethodEntity CreateMethod(string name, TypeSignature returnType, IEnumerable<FunctionArgument> args = null, bool isStatic = false, bool isVirtual = false, bool prepare = false) { var argHash = new HashList<FunctionArgument>(); if(args != null) foreach (var curr in args) argHash.Add(curr.Name, curr); var me = createMethodCore(name, isStatic, isVirtual, prepare); me.ReturnTypeSignature = returnType; me.Arguments = argHash; return me; }
/// <summary> /// Creates a new method with argument types given by signatures. /// </summary> internal MethodEntity CreateMethod(string name, TypeSignature returnType, string[] argTypes = null, bool isStatic = false, bool isVirtual = false, bool prepare = false) { var args = argTypes == null ? null : argTypes.Select((a, idx) => new FunctionArgument("arg" + idx.ToString(), a)).ToArray(); return CreateMethod(name, returnType, args, isStatic, isVirtual, prepare); }
/// <summary> /// Creates a new field by type signature. /// </summary> internal FieldEntity CreateField(string name, TypeSignature signature, bool isStatic = false, bool prepare = false) { var fe = createFieldCore(name, isStatic, prepare); fe.TypeSignature = signature; return fe; }
/// <summary> /// Creates a new field by type signature. /// </summary> internal FieldEntity CreateField(string name, TypeSignature signature, bool isStatic = false, bool prepare = true) { return createFieldCore(name, isStatic, prepare, fe => fe.TypeSignature = signature); }
/// <summary> /// Creates a new method with argument types given by function arguments. /// </summary> internal MethodEntity CreateMethod(string name, TypeSignature returnType, IEnumerable<FunctionArgument> args = null, bool isStatic = false, bool isVirtual = false, bool prepare = true) { return createMethodCore(name, isStatic, isVirtual, prepare, me => { me.Arguments = new HashList<FunctionArgument>(args, x => x.Name); me.ReturnTypeSignature = returnType; } ); }
internal ParameterSignature(TypeSignature type, bool isByRef) { Type = type; IsByRef = isByRef; }
WildcardTypeSignature(TypeSignatureKind typeSignatureKind, TypeSignature bound) : super(typeSignatureKind, "*") {
: super(typeSignatureKind, "*") { this.bound = bound; }
internal static PointerTypeSignature Pointer(TypeSignature pointedAtType) { return new PointerTypeSignature(pointedAtType); }
internal static ArrayTypeSignature Array(TypeSignature elementType, int rank) { return new ArrayTypeSignature(elementType, rank); }
internal static QualifiedTypeSignature Qualified(TypeSignature left, string right) { return new QualifiedTypeSignature(left, right); }
ArrayTypeSignature(TypeSignature elementType) : super(TypeSignatureKind.ArrayType, "[" + elementType.Name) {