ICSharpCode.NRefactory.MonoCSharp.Struct.ApplyAttributeBuilder C# (CSharp) Method

ApplyAttributeBuilder() public method

public ApplyAttributeBuilder ( Attribute a, MethodSpec ctor, byte cdata, PredefinedAttributes pa ) : void
a System.Attribute
ctor MethodSpec
cdata byte
pa PredefinedAttributes
return void
		public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
		{
			base.ApplyAttributeBuilder (a, ctor, cdata, pa);

			//
			// When struct constains fixed fixed and struct layout has explicitly
			// set CharSet, its value has to be propagated to compiler generated
			// fixed types
			//
			if (a.Type == pa.StructLayout) {
				var value = a.GetNamedValue ("CharSet");
				if (value == null)
					return;

				for (int i = 0; i < Members.Count; ++i) {
					FixedField ff = Members [i] as FixedField;
					if (ff == null)
						continue;

					ff.CharSet = (CharSet) System.Enum.Parse (typeof (CharSet), value.GetValue ().ToString ());
				}
			}
		}