Skip to content

Commit 883db14

Browse files
committed
fix serlaization typo?
1 parent e6b43e4 commit 883db14

12 files changed

Lines changed: 76 additions & 76 deletions

samples/Samples/Sample03_SerializationContextAndOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
@@ -57,9 +57,9 @@ public void CustomizeSerializeBehavior()
5757

5858
// 2-2-1. You can customize map key handling when you use SerializationMethod.Map to improve interoperability.
5959
// You can use preconfigured transformation in DictionaryKeyTransformers class.
60-
context.DictionarySerlaizationOptions.KeyTransformer = DictionaryKeyTransformers.LowerCamel;
60+
context.DictionarySerializationOptions.KeyTransformer = DictionaryKeyTransformers.LowerCamel;
6161
// 2-2-2. You can omit entry when map value is null.
62-
context.DictionarySerlaizationOptions.OmitNullEntry = true;
62+
context.DictionarySerializationOptions.OmitNullEntry = true;
6363

6464
// 2-3. EnumSerializationMethod: it changes enum serialization as their name or underlying value.
6565
// ByName(default): More version torrelant and interoperable, and backward compatible prior to 0.5 of MsgPack for CLI.

src/MsgPack/Serialization/AbstractSerializers/SerializerBuilder`2.Object.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ knownActions[ i ].Value
572572
actionCollection.ContextType,
573573
"Item",
574574
// Set key as transformed.
575-
this.MakeStringLiteral( context, context.SerializationContext.DictionarySerlaizationOptions.SafeKeyTransformer( knownActions[ i ].Key ) ),
575+
this.MakeStringLiteral( context, context.SerializationContext.DictionarySerializationOptions.SafeKeyTransformer( knownActions[ i ].Key ) ),
576576
packItemBody
577577
);
578578
}
@@ -633,7 +633,7 @@ private IEnumerable<TConstruct> EmitPackNullCheckerTableInitializationCore( TCon
633633
actionCollection.ContextType,
634634
"Item",
635635
// Set key as transformed.
636-
this.MakeStringLiteral( context, context.SerializationContext.DictionarySerlaizationOptions.SafeKeyTransformer( knownActions[ i ].Key ) ),
636+
this.MakeStringLiteral( context, context.SerializationContext.DictionarySerializationOptions.SafeKeyTransformer( knownActions[ i ].Key ) ),
637637
this.EmitNewPrivateMethodDelegateExpression(
638638
context,
639639
knownActions[ i ].Value
@@ -1351,7 +1351,7 @@ knownActions[ i ].Value
13511351
actionCollection.ContextType,
13521352
"Item",
13531353
// Set key as transformed.
1354-
this.MakeStringLiteral( context, context.SerializationContext.DictionarySerlaizationOptions.SafeKeyTransformer( knownActions[ i ].Key ) ),
1354+
this.MakeStringLiteral( context, context.SerializationContext.DictionarySerializationOptions.SafeKeyTransformer( knownActions[ i ].Key ) ),
13551355
unpackItemBody
13561356
);
13571357
}

src/MsgPack/Serialization/DictionaryKeyTransformers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
namespace MsgPack.Serialization
2424
{
2525
/// <summary>
26-
/// Defines built-in, out-of-box handlers for <see cref="DictionarySerlaizationOptions.KeyTransformer"/>.
26+
/// Defines built-in, out-of-box handlers for <see cref="DictionarySerializationOptions.KeyTransformer"/>.
2727
/// </summary>
2828
public static class DictionaryKeyTransformers
2929
{

src/MsgPack/Serialization/DictionarySerlaizationOptions.cs renamed to src/MsgPack/Serialization/DictionarySerializationOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace MsgPack.Serialization
3535
/// and <see cref="System.Collections.Generic.IDictionary{TKey, TValue}"/>.
3636
/// The option only affect dictionary (map) based serialization which can be enabled via <see cref="SerializationContext.SerializationMethod"/>.
3737
/// </remarks>
38-
public sealed class DictionarySerlaizationOptions
38+
public sealed class DictionarySerializationOptions
3939
{
4040
#if !FEATURE_CONCURRENT
4141
private volatile bool _omitNullEntry;
@@ -121,8 +121,8 @@ internal Func<string, string> SafeKeyTransformer
121121
}
122122

123123
/// <summary>
124-
/// Initializes a new instance of the <see cref="DictionarySerlaizationOptions"/> class.
124+
/// Initializes a new instance of the <see cref="DictionarySerializationOptions"/> class.
125125
/// </summary>
126-
public DictionarySerlaizationOptions() { }
126+
public DictionarySerializationOptions() { }
127127
}
128128
}

src/MsgPack/Serialization/MessagePackSerializer`1.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
@@ -61,7 +61,7 @@ public abstract class MessagePackSerializer<T> : MessagePackSerializer
6161
/// <remarks>
6262
/// This method supports backword compatibility with 0.3.
6363
/// </remarks>
64-
[Obsolete( "Use MessagePackSerializer (SerlaizationContext) instead." )]
64+
[Obsolete( "Use MessagePackSerializer (SerializationContext) instead." )]
6565
protected MessagePackSerializer() : this( PackerCompatibilityOptions.Classic ) { }
6666

6767
/// <summary>
@@ -71,7 +71,7 @@ protected MessagePackSerializer() : this( PackerCompatibilityOptions.Classic ) {
7171
/// <remarks>
7272
/// This method supports backword compatibility with 0.4.
7373
/// </remarks>
74-
[Obsolete( "Use MessagePackSerializer (SerlaizationContext, PackerCompatibilityOptions) instead." )]
74+
[Obsolete( "Use MessagePackSerializer (SerializationContext, PackerCompatibilityOptions) instead." )]
7575
protected MessagePackSerializer( PackerCompatibilityOptions packerCompatibilityOptions )
7676
: this( null, packerCompatibilityOptions ) { }
7777

src/MsgPack/Serialization/PackHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ ref PackToMapParameters<TObject> parameter
339339
#endif // ASSERT
340340

341341
if ( parameter.NullCheckers != null
342-
&& parameter.SerializationContext != null && parameter.SerializationContext.DictionarySerlaizationOptions.OmitNullEntry )
342+
&& parameter.SerializationContext != null && parameter.SerializationContext.DictionarySerializationOptions.OmitNullEntry )
343343
{
344344
#if ASSERT
345345
Contract.Assert( !SerializerDebugging.UseLegacyNullMapEntryHandling );
@@ -487,7 +487,7 @@ CancellationToken cancellationToken
487487
#endif // ASSERT
488488

489489
if ( nullCheckers != null
490-
&& serializationContext != null && serializationContext.DictionarySerlaizationOptions.OmitNullEntry )
490+
&& serializationContext != null && serializationContext.DictionarySerializationOptions.OmitNullEntry )
491491
{
492492
#if ASSERT
493493
Contract.Assert( !SerializerDebugging.UseLegacyNullMapEntryHandling );

src/MsgPack/Serialization/ReflectionSerializers/ReflectionObjectMessagePackSerializer`1.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public ReflectionObjectMessagePackSerializer( SerializationContext context, Seri
6666
.Select( ( contract, index ) => new KeyValuePair<string, int>( contract.Name, index ) )
6767
.Where( kv => kv.Key != null )
6868
// Set key as transformed.
69-
.ToDictionary( kv => context.DictionarySerlaizationOptions.SafeKeyTransformer( kv.Key ), kv => kv.Value );
69+
.ToDictionary( kv => context.DictionarySerializationOptions.SafeKeyTransformer( kv.Key ), kv => kv.Value );
7070
this._constructorParameters =
7171
( !typeof( IUnpackable ).IsAssignableFrom( typeof( T ) ) && target.IsConstructorDeserialization )
7272
? target.DeserializationConstructor.GetParameters()
@@ -112,7 +112,7 @@ protected internal override void PackToCore( Packer packer, T objectTree )
112112
}
113113
else
114114
{
115-
if ( this.OwnerContext.DictionarySerlaizationOptions.OmitNullEntry
115+
if ( this.OwnerContext.DictionarySerializationOptions.OmitNullEntry
116116
#if DEBUG
117117
&& !SerializerDebugging.UseLegacyNullMapEntryHandling
118118
#endif // DEBUG
@@ -138,7 +138,7 @@ protected internal override void PackToCore( Packer packer, T objectTree )
138138
}
139139

140140
// Set key as transformed.
141-
packer.PackString( this.OwnerContext.DictionarySerlaizationOptions.SafeKeyTransformer( this._contracts[ i ].Name ) );
141+
packer.PackString( this.OwnerContext.DictionarySerializationOptions.SafeKeyTransformer( this._contracts[ i ].Name ) );
142142
this.PackMemberValue( packer, objectTree, i );
143143
}
144144
}
@@ -148,7 +148,7 @@ protected internal override void PackToCore( Packer packer, T objectTree )
148148
for ( int i = 0; i < this._serializers.Length; i++ )
149149
{
150150
// Set key as transformed.
151-
packer.PackString( this.OwnerContext.DictionarySerlaizationOptions.SafeKeyTransformer( this._contracts[ i ].Name ) );
151+
packer.PackString( this.OwnerContext.DictionarySerializationOptions.SafeKeyTransformer( this._contracts[ i ].Name ) );
152152
this.PackMemberValue( packer, objectTree, i );
153153
}
154154
}
@@ -214,7 +214,7 @@ protected internal override async Task PackToAsyncCore( Packer packer, T objectT
214214
}
215215
else
216216
{
217-
if ( this.OwnerContext.DictionarySerlaizationOptions.OmitNullEntry
217+
if ( this.OwnerContext.DictionarySerializationOptions.OmitNullEntry
218218
#if DEBUG
219219
&& !SerializerDebugging.UseLegacyNullMapEntryHandling
220220
#endif // DEBUG
@@ -240,7 +240,7 @@ protected internal override async Task PackToAsyncCore( Packer packer, T objectT
240240
}
241241

242242
// Set key as transformed.
243-
await packer.PackStringAsync( this.OwnerContext.DictionarySerlaizationOptions.SafeKeyTransformer( this._contracts[ i ].Name ), cancellationToken ).ConfigureAwait( false );
243+
await packer.PackStringAsync( this.OwnerContext.DictionarySerializationOptions.SafeKeyTransformer( this._contracts[ i ].Name ), cancellationToken ).ConfigureAwait( false );
244244
await this.PackMemberValueAsync( packer, objectTree, i, cancellationToken ).ConfigureAwait( false );
245245
}
246246
}
@@ -250,7 +250,7 @@ protected internal override async Task PackToAsyncCore( Packer packer, T objectT
250250
for ( int i = 0; i < this._serializers.Length; i++ )
251251
{
252252
// Set key as transformed.
253-
await packer.PackStringAsync( this.OwnerContext.DictionarySerlaizationOptions.SafeKeyTransformer( this._contracts[ i ].Name ), cancellationToken ).ConfigureAwait( false );
253+
await packer.PackStringAsync( this.OwnerContext.DictionarySerializationOptions.SafeKeyTransformer( this._contracts[ i ].Name ), cancellationToken ).ConfigureAwait( false );
254254
await this.PackMemberValueAsync( packer, objectTree, i, cancellationToken ).ConfigureAwait( false );
255255
}
256256
}

src/MsgPack/Serialization/SerializationContext.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,20 @@ public SerializationCompatibilityOptions CompatibilityOptions
196196
}
197197
}
198198

199-
private readonly DictionarySerlaizationOptions _dictionarySerializationOptions;
199+
private readonly DictionarySerializationOptions _dictionarySerializationOptions;
200200

201201
/// <summary>
202202
/// Gets the dictionary(map) based serialization options.
203203
/// </summary>
204204
/// <value>
205-
/// The <see cref="DictionarySerlaizationOptions"/> which stores dictionary(map) based serialization options. This value will not be <c>null</c>.
205+
/// The <see cref="DictionarySerializationOptions"/> which stores dictionary(map) based serialization options. This value will not be <c>null</c>.
206206
/// </value>
207-
public DictionarySerlaizationOptions DictionarySerlaizationOptions
207+
public DictionarySerializationOptions DictionarySerializationOptions
208208
{
209209
get
210210
{
211211
#if DEBUG
212-
Contract.Ensures( Contract.Result<DictionarySerlaizationOptions>() != null );
212+
Contract.Ensures( Contract.Result<DictionarySerializationOptions>() != null );
213213
#endif // DEBUG
214214

215215
return this._dictionarySerializationOptions;
@@ -561,7 +561,7 @@ public SerializationContext( PackerCompatibilityOptions packerCompatibilityOptio
561561
this._generationLock = new object();
562562
this._defaultCollectionTypes = new DefaultConcreteTypeRepository();
563563
this._serializerGeneratorOptions = new SerializerOptions();
564-
this._dictionarySerializationOptions = new DictionarySerlaizationOptions();
564+
this._dictionarySerializationOptions = new DictionarySerializationOptions();
565565
this._enumSerializationOptions = new EnumSerializationOptions();
566566
this._bindingOptions = new BindingOptions();
567567
}

test/MsgPack.UnitTest.CodeDom/Serialization/MapCodeDomBasedAutoMessagePackSerializerTest.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9076,9 +9076,9 @@ public void TestImplementsNonGenericIEnumerableWithNoAdd_ProhibitEnumerableNonCo
90769076
public void TestOmitNullEntryInDictionary()
90779077
{
90789078
var context = GetSerializationContext();
9079-
Assert.That( context.DictionarySerlaizationOptions.OmitNullEntry, Is.False, "default value" );
9079+
Assert.That( context.DictionarySerializationOptions.OmitNullEntry, Is.False, "default value" );
90809080
TestOmitNullEntryInDictionaryCore( context, true, false );
9081-
context.DictionarySerlaizationOptions.OmitNullEntry = true;
9081+
context.DictionarySerializationOptions.OmitNullEntry = true;
90829082
TestOmitNullEntryInDictionaryCore( context, false, false );
90839083
}
90849084

@@ -9088,9 +9088,9 @@ public void TestOmitNullEntryInDictionary()
90889088
public void TestOmitNullEntryInDictionary_Async()
90899089
{
90909090
var context = GetSerializationContext();
9091-
Assert.That( context.DictionarySerlaizationOptions.OmitNullEntry, Is.False, "default value" );
9091+
Assert.That( context.DictionarySerializationOptions.OmitNullEntry, Is.False, "default value" );
90929092
TestOmitNullEntryInDictionaryCore( context, true, true );
9093-
context.DictionarySerlaizationOptions.OmitNullEntry = true;
9093+
context.DictionarySerializationOptions.OmitNullEntry = true;
90949094
TestOmitNullEntryInDictionaryCore( context, false, true );
90959095
}
90969096

@@ -9103,7 +9103,7 @@ public void TestOmitNullEntryInDictionary_BackwordCompatibility()
91039103
try
91049104
{
91059105
var context = GetSerializationContext();
9106-
context.DictionarySerlaizationOptions.OmitNullEntry = true;
9106+
context.DictionarySerializationOptions.OmitNullEntry = true;
91079107
TestOmitNullEntryInDictionaryCore( context, true, false );
91089108
}
91099109
finally
@@ -9121,7 +9121,7 @@ public void TestOmitNullEntryInDictionary_BackwordCompatibility_Async()
91219121
try
91229122
{
91239123
var context = GetSerializationContext();
9124-
context.DictionarySerlaizationOptions.OmitNullEntry = true;
9124+
context.DictionarySerializationOptions.OmitNullEntry = true;
91259125
TestOmitNullEntryInDictionaryCore( context, true, true );
91269126
}
91279127
finally
@@ -9195,7 +9195,7 @@ private static void TestOmitNullEntryInDictionaryCore( SerializationContext cont
91959195
public void TestDictionaryKeyTransformer_Default_AsIs()
91969196
{
91979197
var context = GetSerializationContext();
9198-
Assert.That( context.DictionarySerlaizationOptions.KeyTransformer, Is.Null, "default value" );
9198+
Assert.That( context.DictionarySerializationOptions.KeyTransformer, Is.Null, "default value" );
91999199
TestDictionaryKeyCore( context, "FirstProperty", "SecondProperty", "ThirdProperty", "FourthProperty", asIs: true, isAsync: false );
92009200
}
92019201

@@ -9205,7 +9205,7 @@ public void TestDictionaryKeyTransformer_Default_AsIs()
92059205
public void TestDictionaryKeyTransformer_Default_AsIs_Async()
92069206
{
92079207
var context = GetSerializationContext();
9208-
Assert.That( context.DictionarySerlaizationOptions.KeyTransformer, Is.Null, "default value" );
9208+
Assert.That( context.DictionarySerializationOptions.KeyTransformer, Is.Null, "default value" );
92099209
TestDictionaryKeyCore( context, "FirstProperty", "SecondProperty", "ThirdProperty", "FourthProperty", asIs: true, isAsync: true );
92109210
}
92119211

@@ -9215,7 +9215,7 @@ public void TestDictionaryKeyTransformer_Default_AsIs_Async()
92159215
public void TestDictionaryKeyTransformer_LowerCamel()
92169216
{
92179217
var context = GetSerializationContext();
9218-
context.DictionarySerlaizationOptions.KeyTransformer = DictionaryKeyTransformers.LowerCamel;
9218+
context.DictionarySerializationOptions.KeyTransformer = DictionaryKeyTransformers.LowerCamel;
92199219
TestDictionaryKeyCore( context, "firstProperty", "secondProperty", "thirdProperty", "fourthProperty", asIs: false, isAsync: false );
92209220
}
92219221

@@ -9225,7 +9225,7 @@ public void TestDictionaryKeyTransformer_LowerCamel()
92259225
public void TestDictionaryKeyTransformer_LowerCamel_Async()
92269226
{
92279227
var context = GetSerializationContext();
9228-
context.DictionarySerlaizationOptions.KeyTransformer = DictionaryKeyTransformers.LowerCamel;
9228+
context.DictionarySerializationOptions.KeyTransformer = DictionaryKeyTransformers.LowerCamel;
92299229
TestDictionaryKeyCore( context, "firstProperty", "secondProperty", "thirdProperty", "fourthProperty", asIs: false, isAsync: true );
92309230
}
92319231

@@ -9235,7 +9235,7 @@ public void TestDictionaryKeyTransformer_LowerCamel_Async()
92359235
public void TestDictionaryKeyTransformer_Custom()
92369236
{
92379237
var context = GetSerializationContext();
9238-
context.DictionarySerlaizationOptions.KeyTransformer =
9238+
context.DictionarySerializationOptions.KeyTransformer =
92399239
key => Regex.Replace( key, "[A-Z]", match => match.Index == 0 ? match.Value.ToLower() : "-" + match.Value.ToLower() );
92409240
TestDictionaryKeyCore( context, "first-property", "second-property", "third-property", "fourth-property", asIs: false, isAsync: false );
92419241
}
@@ -9246,7 +9246,7 @@ public void TestDictionaryKeyTransformer_Custom()
92469246
public void TestDictionaryKeyTransformer_Custom_Async()
92479247
{
92489248
var context = GetSerializationContext();
9249-
context.DictionarySerlaizationOptions.KeyTransformer =
9249+
context.DictionarySerializationOptions.KeyTransformer =
92509250
key => Regex.Replace( key, "[A-Z]", match => match.Index == 0 ? match.Value.ToLower() : "-" + match.Value.ToLower() );
92519251
TestDictionaryKeyCore( context, "first-property", "second-property", "third-property", "fourth-property", asIs: false, isAsync: true );
92529252
}

0 commit comments

Comments
 (0)