summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Messaging/Reflection/MessagePartAttribute.cs
blob: c8bb8f583df43da474a676c7244ceafcaa6980ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//-----------------------------------------------------------------------
// <copyright file="MessagePartAttribute.cs" company="Andrew Arnott">
//     Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOAuth.Messaging.Reflection {
	using System;
	using System.Net.Security;
	using System.Reflection;

	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
	internal sealed class MessagePartAttribute : Attribute {
		private bool initialized;
		private string name;

		internal MessagePartAttribute() {
		}

		internal MessagePartAttribute(string name) {
			this.Name = name;
		}

		public string Name {
			get { return this.name; }
			set { this.name = string.IsNullOrEmpty(value) ? null : value; }
		}

		public ProtectionLevel RequiredProtection { get; set; }

		public bool IsRequired { get; set; }
	}
}