1 //------------------------------------------------------------------------------
2 // <copyright file="NameValuePair.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 // <owner current="true" primary="false">Microsoft</owner>
7 //------------------------------------------------------------------------------
9 namespace System.Data.Common {
12 using System.Data.Common;
13 using System.Diagnostics;
14 using System.Runtime.Serialization;
16 [Serializable] // MDAC 83147
17 sealed internal class NameValuePair {
18 readonly private string _name;
19 readonly private string _value;
20 [OptionalField(VersionAdded=2)]
21 readonly private int _length;
22 private NameValuePair _next;
24 internal NameValuePair(string name, string value, int length) {
25 System.Diagnostics.Debug.Assert(!ADP.IsEmpty(name), "empty keyname");
33 // this property won't exist when deserialized from Everett to Whidbey
34 // it shouldn't matter for DbConnectionString/DbDataPermission
35 // which should only use Length during construction
36 // not deserialization or post-ctor runtime
37 Debug.Assert(0 < _length, "NameValuePair zero Length usage");
41 internal string Name {
46 internal NameValuePair Next {
51 if ((null != _next) || (null == value)) {
52 throw ADP.InternalError(ADP.InternalErrorCode.NameValuePairNext);
57 internal string Value {