Пример #1
0
        CustomAttributeBuilder CreateEnumMemberAttribute(string value)
        {
            var emAttr      = Type.GetType("System.Runtime.Serialization.EnumMemberAttribute," + serializationAssemblyname);
            var ctor        = emAttr.GetConstructor(Type.EmptyTypes);
            var propCreator = new PropertyInfoCreator(emAttr);

            propCreator.Add("Value", value);
            return(new CustomAttributeBuilder(ctor, new object[0], propCreator.Properties, propCreator.Values));
        }
Пример #2
0
        CustomAttributeBuilder CreateDataMemberAttribute(string name, bool emitDefaultValue)
        {
            var dmAttr      = Type.GetType("System.Runtime.Serialization.DataMemberAttribute," + serializationAssemblyname);
            var ctor        = dmAttr.GetConstructor(Type.EmptyTypes);
            var propCreator = new PropertyInfoCreator(dmAttr);

            propCreator.Add("Name", name);
            propCreator.Add("EmitDefaultValue", emitDefaultValue);
            return(new CustomAttributeBuilder(ctor, new object[0], propCreator.Properties, propCreator.Values));
        }
Пример #3
0
        CustomAttributeBuilder CreateDataContractAttribute(string ns, string name, bool isReference)
        {
            var dcAttr      = Type.GetType("System.Runtime.Serialization.DataContractAttribute," + serializationAssemblyname);
            var ctor        = dcAttr.GetConstructor(Type.EmptyTypes);
            var propCreator = new PropertyInfoCreator(dcAttr);

            propCreator.Add("Namespace", ns);
            propCreator.Add("Name", name);
            propCreator.Add("IsReference", isReference);
            return(new CustomAttributeBuilder(ctor, new object[0], propCreator.Properties, propCreator.Values));
        }
Пример #4
0
		CustomAttributeBuilder CreateDataMemberAttribute(string name, bool emitDefaultValue) {
			var dmAttr = Type.GetType("System.Runtime.Serialization.DataMemberAttribute," + serializationAssemblyname);
			var ctor = dmAttr.GetConstructor(Type.EmptyTypes);
			var propCreator = new PropertyInfoCreator(dmAttr);
			propCreator.add("Name", name);
			propCreator.add("EmitDefaultValue", emitDefaultValue);
			return new CustomAttributeBuilder(ctor, new object[0], propCreator.Properties, propCreator.Values);
		}
Пример #5
0
		CustomAttributeBuilder CreateEnumMemberAttribute(string value) {
			var emAttr = Type.GetType("System.Runtime.Serialization.EnumMemberAttribute," + serializationAssemblyname);
			var ctor = emAttr.GetConstructor(Type.EmptyTypes);
			var propCreator = new PropertyInfoCreator(emAttr);
			propCreator.add("Value", value);
			return new CustomAttributeBuilder(ctor, new object[0], propCreator.Properties, propCreator.Values);
		}
Пример #6
0
		CustomAttributeBuilder CreateDataContractAttribute(string ns, string name, bool isReference) {
			var dcAttr = Type.GetType("System.Runtime.Serialization.DataContractAttribute," + serializationAssemblyname);
			var ctor = dcAttr.GetConstructor(Type.EmptyTypes);
			var propCreator = new PropertyInfoCreator(dcAttr);
			propCreator.add("Namespace", ns);
			propCreator.add("Name", name);
			propCreator.add("IsReference", isReference);
			return new CustomAttributeBuilder(ctor, new object[0], propCreator.Properties, propCreator.Values);
		}