| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using CoreWCF.Description; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF |
| | | 8 | | { |
| | | 9 | | public abstract class MessageContractMemberAttribute : Attribute |
| | | 10 | | { |
| | | 11 | | private string _name; |
| | | 12 | | private string _ns; |
| | | 13 | | |
| | | 14 | | //ProtectionLevel protectionLevel = ProtectionLevel.None; |
| | | 15 | | //bool hasProtectionLevel = false; |
| | | 16 | | |
| | | 17 | | internal const string NamespacePropertyName = "Namespace"; |
| | | 18 | | public string Namespace |
| | | 19 | | { |
| | 14 | 20 | | get { return _ns; } |
| | | 21 | | set |
| | | 22 | | { |
| | 28 | 23 | | if (value == null) |
| | | 24 | | { |
| | 0 | 25 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value)); |
| | | 26 | | } |
| | | 27 | | |
| | 28 | 28 | | if (value.Length > 0) |
| | | 29 | | { |
| | 12 | 30 | | NamingHelper.CheckUriProperty(value, "Namespace"); |
| | | 31 | | } |
| | 28 | 32 | | _ns = value; |
| | 28 | 33 | | IsNamespaceSetExplicit = true; |
| | 28 | 34 | | } |
| | | 35 | | } |
| | | 36 | | |
| | 218 | 37 | | internal bool IsNamespaceSetExplicit { get; private set; } |
| | | 38 | | |
| | | 39 | | internal const string NamePropertyName = "Name"; |
| | | 40 | | public string Name |
| | | 41 | | { |
| | 3 | 42 | | get { return _name; } |
| | | 43 | | set |
| | | 44 | | { |
| | 3 | 45 | | if (value == null) |
| | | 46 | | { |
| | 0 | 47 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value)); |
| | | 48 | | } |
| | | 49 | | |
| | 3 | 50 | | if (value == string.Empty) |
| | | 51 | | { |
| | 0 | 52 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(val |
| | 0 | 53 | | SR.SFxNameCannotBeEmpty)); |
| | | 54 | | } |
| | | 55 | | |
| | 6 | 56 | | _name = value; IsNameSetExplicit = true; |
| | 3 | 57 | | } |
| | | 58 | | } |
| | | 59 | | |
| | 193 | 60 | | internal bool IsNameSetExplicit { get; private set; } |
| | | 61 | | |
| | | 62 | | //internal const string ProtectionLevelPropertyName = "ProtectionLevel"; |
| | | 63 | | //public ProtectionLevel ProtectionLevel |
| | | 64 | | //{ |
| | | 65 | | // get |
| | | 66 | | // { |
| | | 67 | | // return this.protectionLevel; |
| | | 68 | | // } |
| | | 69 | | // set |
| | | 70 | | // { |
| | | 71 | | // if (!ProtectionLevelHelper.IsDefined(value)) |
| | | 72 | | // throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(v |
| | | 73 | | // this.protectionLevel = value; |
| | | 74 | | // this.hasProtectionLevel = true; |
| | | 75 | | // } |
| | | 76 | | //} |
| | | 77 | | |
| | | 78 | | //public bool HasProtectionLevel |
| | | 79 | | //{ |
| | | 80 | | // get { return this.hasProtectionLevel; } |
| | | 81 | | //} |
| | | 82 | | } |
| | | 83 | | } |