Skip to content

Commit 7524d54

Browse files
Merge pull request #11 from boldsign/v-3.0.0
v3.0.0 is released
2 parents dc57d7e + 43fc568 commit 7524d54

File tree

8 files changed

+166
-8
lines changed

8 files changed

+166
-8
lines changed

examples/DocumentExamples.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public async Task<DocumentCreated> CreateDocument()
201201
{
202202
List<FormField> formFeilds = new List<FormField>();
203203
formFeilds.Add(new FormField(
204-
name: "Sign",
204+
id: "Sign_1",
205205
type: FieldType.Signature,
206206
pageNumber: 1,
207207
isRequired: true,
@@ -265,7 +265,7 @@ public async Task<DocumentCreated> CreateDocumentWithFileUrl()
265265
List<FormField> formFields = new List<FormField>
266266
{
267267
new FormField(
268-
name: "Sign",
268+
id: "Sign_1",
269269
type: FieldType.Signature,
270270
pageNumber: 1,
271271
isRequired: true,
@@ -308,7 +308,7 @@ public async Task EmbeddedSendDocument()
308308
List<FormField> formFields = new List<FormField>
309309
{
310310
new FormField(
311-
name: "Sign",
311+
id: "Sign_1",
312312
type: FieldType.Signature,
313313
pageNumber: 1,
314314
isRequired: true,

src/BoldSign/BoldSign.Api.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4-
<FileVersion>2.1.1</FileVersion>
5-
<ProductVersion>2.1.1</ProductVersion>
6-
<Copyright>Copyright 2001-2021 Syncfusion Inc</Copyright>
4+
<FileVersion>3.0.0</FileVersion>
5+
<ProductVersion>3.0.0</ProductVersion>
6+
<Copyright>Copyright 2001-2022 Syncfusion Inc</Copyright>
77
<AssemblyName>BoldSign.Api</AssemblyName>
88
<RootNamespace>BoldSign.Api</RootNamespace>
99
<LangVersion>latest</LangVersion>

src/BoldSign/Model/DateSignedField.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,34 @@ protected DateSignedField()
4040
/// <param name="isUnderLineFont">Gets or sets a value indicating whether the font style is underline.</param>
4141
/// <param name="lineHeight">Gets or sets the lineHeight.</param>
4242
/// <param name="dateFormat">Gets or sets the dateFormat.</param>
43+
[Obsolete("Name is deprecated, please use Id instead")]
4344
public DateSignedField(string name = default, int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, string dateFormat = default) : base(name: name, type: FieldType.DateSigned, pageNumber: pageNumber,bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight)
4445
{
4546
this.DateFormat = dateFormat;
4647
}
48+
49+
/// <summary>
50+
/// Initializes a new instance of the <see cref="DateSignedField" /> class.
51+
/// </summary>
52+
/// <param name="pageNumber">Gets or sets the page number.</param>
53+
/// <param name="bounds">Gets or sets the bounds (required).</param>
54+
/// <param name="isRequired">Gets or sets a value indicating whether the field is required.</param>
55+
/// <param name="value">Gets or sets the value.</param>
56+
/// <param name="fontSize">Gets or sets the fontSize.</param>
57+
/// <param name="font">Gets or sets the font (required).</param>
58+
/// <param name="fontHexColor">Gets or sets the fontHexColor.</param>
59+
/// <param name="isBoldFont">Gets or sets a value indicating whether the font style is bold.</param>
60+
/// <param name="isItalicFont">Gets or sets a value indicating whether the font style is italic.</param>
61+
/// <param name="isUnderLineFont">Gets or sets a value indicating whether the font style is underline.</param>
62+
/// <param name="lineHeight">Gets or sets the lineHeight.</param>
63+
/// <param name="dateFormat">Gets or sets the dateFormat.</param>
64+
/// <param name="id">Gets or sets the id.</param>
65+
public DateSignedField(int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, string dateFormat = default, string id = default)
66+
: base(type: FieldType.DateSigned, pageNumber: pageNumber, bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight, id: id)
67+
{
68+
this.DateFormat = dateFormat;
69+
}
70+
4771
/// <summary>
4872
/// Gets or sets the DateFormat and it's only applicable for DateSigned field.
4973
/// Please use the pre-defiened DateFormat.

src/BoldSign/Model/ExistingFormField.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ public ExistingFormField(int index = default, string value = default)
4545
this.Value = value;
4646
}
4747

48-
public ExistingFormField(string name = default, string value = default)
48+
/// <summary>
49+
/// Initializes a new instance of the <see cref="ExistingFormField"/> class.
50+
/// </summary>
51+
/// <param name="id">Gets oe sets the id.</param>
52+
/// <param name="value">Gets or sets the signer role.</param>
53+
public ExistingFormField(string id = default, string value = default)
4954
{
50-
this.Name = name;
55+
this.Id = id;
5156
this.Value = value;
5257
}
5358

@@ -63,8 +68,16 @@ public ExistingFormField(string name = default, string value = default)
6368
/// </summary>
6469
/// <value>Gets or sets the name.</value>
6570
[DataMember(Name = "name", EmitDefaultValue = false)]
71+
[Obsolete("Name is deprecated, please use Id instead")]
6672
public string Name { get; set; }
6773

74+
/// <summary>
75+
/// Gets or sets the id.
76+
/// </summary>
77+
/// <value>Gets the value of id.</value>
78+
[DataMember(Name = "id", EmitDefaultValue = false)]
79+
public string Id { get; set; }
80+
6881
/// <summary>
6982
/// Gets or sets the signer role.
7083
/// </summary>

src/BoldSign/Model/FormField.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected FormField()
4343
/// <param name="bounds">bounds (required).</param>
4444
/// <param name="isRequired">Gets or sets a value indicating whether is required..</param>
4545
/// <param name="value">Gets or sets the value..</param>
46+
[Obsolete("Name is deprecated, please use Id instead")]
4647
public FormField(string name = default, FieldType type = default, int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, int characterLimit = default)
4748
{
4849

@@ -83,6 +84,61 @@ public FormField(string name = default, FieldType type = default, int pageNumber
8384
this.FontSize = fontSize;
8485
}
8586

87+
/// <summary>
88+
/// Initializes a new instance of the <see cref="FormField" /> class.
89+
/// </summary>
90+
/// <param name="type">fieldType (required).</param>
91+
/// <param name="pageNumber">Gets or sets the page number. (required).</param>
92+
/// <param name="bounds">bounds (required).</param>
93+
/// <param name="isRequired">Gets or sets a value indicating whether is required..</param>
94+
/// <param name="value">Gets or sets the value..</param>
95+
/// <param name="font">Gets or sets the font.</param>
96+
/// <param name="fontSize">Gets or sets the fontSize.</param>
97+
/// <param name="fontHexColor">Gets or sets the fontHexColor.</param>
98+
/// <param name="isBoldFont">Gets or sets the isBoldFont.</param>
99+
/// <param name="isItalicFont">Gets or sets the isItalicFont.</param>
100+
/// <param name="isUnderLineFont">Gets or sets the isUnderLineFont.</param>
101+
/// <param name="lineHeight">Gets or sets the lineHeight.</param>
102+
/// <param name="characterLimit">Gets or sets the characterLimit.</param>
103+
/// <param name="id">Gets or sets the id.</param>
104+
public FormField(FieldType type = default, int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, int characterLimit = default, string id = default)
105+
{
106+
// to ensure "fieldType" is required (not null)
107+
if (type == null)
108+
{
109+
throw new InvalidDataException(ApiValidationMessages.FieldTypeRequired);
110+
}
111+
112+
this.m_type = type;
113+
114+
// to ensure "pageNumber" is required (not null)
115+
if (pageNumber == null)
116+
{
117+
throw new InvalidDataException(ApiValidationMessages.PageNumberRquired);
118+
}
119+
120+
this.PageNumber = pageNumber;
121+
122+
// to ensure "bounds" is required (not null)
123+
if (bounds == null)
124+
{
125+
throw new InvalidDataException(ApiValidationMessages.BoundsRequired);
126+
}
127+
128+
this.Bounds = bounds;
129+
this.Value = value;
130+
this.IsRequired = isRequired;
131+
this.FontHexColor = fontHexColor;
132+
this.IsBoldFont = isBoldFont;
133+
this.IsItalicFont = isItalicFont;
134+
this.IsUnderLineFont = isUnderLineFont;
135+
this.LineHeight = lineHeight;
136+
this.CharacterLimit = characterLimit;
137+
this.Font = font;
138+
this.FontSize = fontSize;
139+
this.Id = id;
140+
}
141+
86142
/// <summary>
87143
/// Gets the form field type.
88144
/// </summary>
@@ -93,6 +149,12 @@ public virtual FieldType Type
93149
set { m_type = value; }
94150
}
95151

152+
/// <summary>
153+
/// Gets or Sets id in form field.
154+
/// </summary>
155+
[DataMember(Name = "id", EmitDefaultValue = true)]
156+
public string Id { get; set; }
157+
96158
/// <summary>
97159
/// Gets or Sets font name for the content in form field.
98160
/// </summary>
@@ -110,6 +172,7 @@ public virtual FieldType Type
110172
/// Gets or sets the form field name.
111173
/// </summary>
112174
/// <value>Gets or sets the name.</value>
175+
[Obsolete("Name is deprecated, please use Id instead")]
113176
[DataMember(Name = "name", EmitDefaultValue = true)]
114177
public string Name { get; set; }
115178

src/BoldSign/Model/IFormField.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ namespace BoldSign.Model
99
{
1010
public interface IFormField
1111
{
12+
/// <summary>
13+
/// Gets or Sets form field id.
14+
/// </summary>
15+
[DataMember(Name = "id", EmitDefaultValue = true)]
16+
public string Id { get; set; }
1217

1318
/// <summary>
1419
/// Gets or Sets form field type.
@@ -33,6 +38,7 @@ public interface IFormField
3338
/// Gets or sets the form field name.
3439
/// </summary>
3540
/// <value>Gets or sets the name.</value>
41+
[Obsolete("Name is deprecated, please use Id instead")]
3642
[DataMember(Name = "name", EmitDefaultValue = true)]
3743
public string Name { get; set; }
3844

src/BoldSign/Model/RadioButtonField.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,35 @@ protected RadioButtonField()
2929
/// <param name="bounds">bounds (required).</param>
3030
/// <param name="isRequired">Gets or sets a value indicating whether is required..</param>
3131
/// <param name="value">Gets or sets the value..</param>
32+
[Obsolete("Name is deprecated, please use Id instead")]
3233
public RadioButtonField(string name = default,int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, int characterLimit = default, string groupName = default) : base(name: name, type: FieldType.RadioButton, pageNumber: pageNumber, bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight, characterLimit: characterLimit)
3334
{
3435
this.GroupName = groupName;
3536
}
3637

38+
/// <summary>
39+
/// Initializes a new instance of the <see cref="RadioButtonField"/> class.
40+
/// </summary>
41+
/// <param name="pageNumber">Gets or sets the page number. (required).</param>
42+
/// <param name="bounds">bounds (required).</param>
43+
/// <param name="isRequired">Gets or sets a value indicating whether is required..</param>
44+
/// <param name="value">Gets or sets the value..</param>
45+
/// <param name="font">Gets or sets the font.</param>
46+
/// <param name="fontSize">Gets or sets the fontSize.</param>
47+
/// <param name="fontHexColor">Gets or sets the fontHexColor.</param>
48+
/// <param name="isBoldFont">Gets or sets the isBoldFont.</param>
49+
/// <param name="isItalicFont">Gets or sets the isItalicFont.</param>
50+
/// <param name="isUnderLineFont">Gets or sets the isUnderLineFont.</param>
51+
/// <param name="lineHeight">Gets or sets the lineHeight.</param>
52+
/// <param name="characterLimit">Gets or sets the characterLimit.</param>
53+
/// <param name="groupName">Gets or sets the groupName.</param>
54+
/// <param name="id">Gets or sets the id.</param>
55+
public RadioButtonField(int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, int characterLimit = default, string groupName = default, string id = default)
56+
: base(type: FieldType.RadioButton, pageNumber: pageNumber, bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight, characterLimit: characterLimit, id: id)
57+
{
58+
this.GroupName = groupName;
59+
}
60+
3761
/// <summary>
3862
/// Gets the form field type.It is a read only property.
3963
/// </summary>

src/BoldSign/Model/TextBoxField.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,41 @@ protected TextBoxField()
5757
/// <param name="validationType">validationType.</param>
5858
/// <param name="validationCustomRegex">validationCustomRegex.</param>
5959
/// <param name="placeholder">placeHolder.</param>
60+
[Obsolete("Name is deprecated, please use Id instead")]
6061
public TextBoxField(string name = default, int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, int characterLimit = default, ValidationType validationType = default(ValidationType), string validationCustomRegex = default(string), string placeholder = default(string)) : base(name: name, type: FieldType.TextBox, pageNumber: pageNumber, bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight, characterLimit: characterLimit)
6162
{
6263
this.ValidationType = validationType;
6364
this.ValidationCustomRegex = validationCustomRegex;
6465
this.Placeholder = placeholder;
6566
}
6667

68+
/// <summary>
69+
/// Initializes a new instance of the <see cref="TextBoxField" /> class.
70+
/// </summary>
71+
/// <param name="pageNumber">pageNumber.</param>
72+
/// <param name="bounds">bounds (required).</param>
73+
/// <param name="isRequired">isRequired.</param>
74+
/// <param name="value">value.</param>
75+
/// <param name="fontSize">fontSize.</param>
76+
/// <param name="font">font (required).</param>
77+
/// <param name="fontHexColor">fontHexColor.</param>
78+
/// <param name="isBoldFont">isBoldFont.</param>
79+
/// <param name="isItalicFont">isItalicFont.</param>
80+
/// <param name="isUnderLineFont">isUnderLineFont.</param>
81+
/// <param name="lineHeight">lineHeight.</param>
82+
/// <param name="characterLimit">characterLimit.</param>
83+
/// <param name="validationType">validationType.</param>
84+
/// <param name="validationCustomRegex">validationCustomRegex.</param>
85+
/// <param name="placeholder">placeHolder.</param>
86+
/// <param name="id">id.</param>
87+
public TextBoxField(int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, int characterLimit = default, ValidationType validationType = default(ValidationType), string validationCustomRegex = default(string), string placeholder = default(string), string id = default(string))
88+
: base(type: FieldType.TextBox, pageNumber: pageNumber, bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight, characterLimit: characterLimit, id: id)
89+
{
90+
this.ValidationType = validationType;
91+
this.ValidationCustomRegex = validationCustomRegex;
92+
this.Placeholder = placeholder;
93+
}
94+
6795
/// <summary>
6896
/// Gets or Sets Placeholder value
6997
/// </summary>

0 commit comments

Comments
 (0)