Skip to content

Commit bd102e2

Browse files
committed
Fix comments.
1 parent bc17220 commit bd102e2

3 files changed

Lines changed: 111 additions & 1 deletion

File tree

src/MsgPack/Serialization/MessagePackRuntimeTypeAttributes.cs

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,34 @@ PolymorphismTarget IPolymorphicHelperAttribute.Target
5757
get { return PolymorphismTarget.Member; }
5858
}
5959

60+
/// <summary>
61+
/// Gets or sets the type which implement type verfier method.
62+
/// </summary>
63+
/// <value>
64+
/// The type which implement type verfier method.
65+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
66+
/// </value>
6067
public Type VerifierType
6168
{
6269
get;
6370
set;
6471
}
6572

73+
/// <summary>
74+
/// Gets or sets the name of the method which implement type verification.
75+
/// </summary>
76+
/// <value>
77+
/// The name of the method which implement type verification
78+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
79+
/// </value>
80+
/// <remarks>
81+
/// The type verfication method must be following:
82+
/// <list type="bullet">
83+
/// <item>The method has just only one parameter, which type must be <see cref="PolymorphicTypeVerificationContext" />.</item>
84+
/// <item>The method must return <see cref="Boolean" />. <c>true</c> indicates the verification result is OK; <c>false</c> indicates not OK.</item>
85+
/// <item>The method can be static method or instance method. The accessibility is not limited.</item>
86+
/// </list>
87+
/// </remarks>
6688
public string VerifierMethodName
6789
{
6890
get;
@@ -108,12 +130,34 @@ PolymorphismTarget IPolymorphicHelperAttribute.Target
108130
get { return PolymorphismTarget.CollectionItem; }
109131
}
110132

133+
/// <summary>
134+
/// Gets or sets the type which implement type verfier method.
135+
/// </summary>
136+
/// <value>
137+
/// The type which implement type verfier method.
138+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
139+
/// </value>
111140
public Type VerifierType
112141
{
113142
get;
114143
set;
115144
}
116145

146+
/// <summary>
147+
/// Gets or sets the name of the method which implement type verification.
148+
/// </summary>
149+
/// <value>
150+
/// The name of the method which implement type verification
151+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
152+
/// </value>
153+
/// <remarks>
154+
/// The type verfication method must be following:
155+
/// <list type="bullet">
156+
/// <item>The method has just only one parameter, which type must be <see cref="PolymorphicTypeVerificationContext" />.</item>
157+
/// <item>The method must return <see cref="Boolean" />. <c>true</c> indicates the verification result is OK; <c>false</c> indicates not OK.</item>
158+
/// <item>The method can be static method or instance method. The accessibility is not limited.</item>
159+
/// </list>
160+
/// </remarks>
117161
public string VerifierMethodName
118162
{
119163
get;
@@ -159,12 +203,34 @@ PolymorphismTarget IPolymorphicHelperAttribute.Target
159203
get { return PolymorphismTarget.DictionaryKey; }
160204
}
161205

206+
/// <summary>
207+
/// Gets or sets the type which implement type verfier method.
208+
/// </summary>
209+
/// <value>
210+
/// The type which implement type verfier method.
211+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
212+
/// </value>
162213
public Type VerifierType
163214
{
164215
get;
165216
set;
166217
}
167218

219+
/// <summary>
220+
/// Gets or sets the name of the method which implement type verification.
221+
/// </summary>
222+
/// <value>
223+
/// The name of the method which implement type verification
224+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
225+
/// </value>
226+
/// <remarks>
227+
/// The type verfication method must be following:
228+
/// <list type="bullet">
229+
/// <item>The method has just only one parameter, which type must be <see cref="PolymorphicTypeVerificationContext" />.</item>
230+
/// <item>The method must return <see cref="Boolean" />. <c>true</c> indicates the verification result is OK; <c>false</c> indicates not OK.</item>
231+
/// <item>The method can be static method or instance method. The accessibility is not limited.</item>
232+
/// </list>
233+
/// </remarks>
168234
public string VerifierMethodName
169235
{
170236
get;
@@ -210,12 +276,34 @@ PolymorphismTarget IPolymorphicHelperAttribute.Target
210276
get { return PolymorphismTarget.TupleItem; }
211277
}
212278

279+
/// <summary>
280+
/// Gets or sets the type which implement type verfier method.
281+
/// </summary>
282+
/// <value>
283+
/// The type which implement type verfier method.
284+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
285+
/// </value>
213286
public Type VerifierType
214287
{
215288
get;
216289
set;
217290
}
218291

292+
/// <summary>
293+
/// Gets or sets the name of the method which implement type verification.
294+
/// </summary>
295+
/// <value>
296+
/// The name of the method which implement type verification
297+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
298+
/// </value>
299+
/// <remarks>
300+
/// The type verfication method must be following:
301+
/// <list type="bullet">
302+
/// <item>The method has just only one parameter, which type must be <see cref="PolymorphicTypeVerificationContext" />.</item>
303+
/// <item>The method must return <see cref="Boolean" />. <c>true</c> indicates the verification result is OK; <c>false</c> indicates not OK.</item>
304+
/// <item>The method can be static method or instance method. The accessibility is not limited.</item>
305+
/// </list>
306+
/// </remarks>
219307
public string VerifierMethodName
220308
{
221309
get;

src/MsgPack/Serialization/MessagePackRuntimeTypeAttributes.tt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,34 @@ foreach( var item in
148148
get { return PolymorphismTarget.<#= item.Target #>; }
149149
}
150150

151+
/// <summary>
152+
/// Gets or sets the type which implement type verfier method.
153+
/// </summary>
154+
/// <value>
155+
/// The type which implement type verfier method.
156+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
157+
/// </value>
151158
public Type VerifierType
152159
{
153160
get;
154161
set;
155162
}
156163

164+
/// <summary>
165+
/// Gets or sets the name of the method which implement type verification.
166+
/// </summary>
167+
/// <value>
168+
/// The name of the method which implement type verification
169+
/// The default is <c>null</c>, which indicates that no type verification will be processed.
170+
/// </value>
171+
/// <remarks>
172+
/// The type verfication method must be following:
173+
/// <list type="bullet">
174+
/// <item>The method has just only one parameter, which type must be <see cref="PolymorphicTypeVerificationContext" />.</item>
175+
/// <item>The method must return <see cref="Boolean" />. <c>true</c> indicates the verification result is OK; <c>false</c> indicates not OK.</item>
176+
/// <item>The method can be static method or instance method. The accessibility is not limited.</item>
177+
/// </list>
178+
/// </remarks>
157179
public string VerifierMethodName
158180
{
159181
get;

src/MsgPack/Serialization/PolymorphismSchema.Internals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ private static Func<PolymorphicTypeVerificationContext, bool> GetVerifier( IPoly
711711
throw new SerializationException( "VerifierMethodName cannot be null nor empty if VerifierType is specified." );
712712
}
713713

714-
// 1. Explore public static bool X(PolymorphicTypeVerificationContext)
714+
// Explore [static] bool X(PolymorphicTypeVerificationContext)
715715
var method = attribute.VerifierType.GetRuntimeMethods().SingleOrDefault( m => IsVerificationMethod( m, attribute.VerifierMethodName ) );
716716
if ( method == null )
717717
{

0 commit comments

Comments
 (0)