Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/DocumentExamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public async Task<DocumentCreated> CreateDocument()
{
List<FormField> formFeilds = new List<FormField>();
formFeilds.Add(new FormField(
name: "Sign",
id: "Sign_1",
type: FieldType.Signature,
pageNumber: 1,
isRequired: true,
Expand Down Expand Up @@ -265,7 +265,7 @@ public async Task<DocumentCreated> CreateDocumentWithFileUrl()
List<FormField> formFields = new List<FormField>
{
new FormField(
name: "Sign",
id: "Sign_1",
type: FieldType.Signature,
pageNumber: 1,
isRequired: true,
Expand Down Expand Up @@ -308,7 +308,7 @@ public async Task EmbeddedSendDocument()
List<FormField> formFields = new List<FormField>
{
new FormField(
name: "Sign",
id: "Sign_1",
type: FieldType.Signature,
pageNumber: 1,
isRequired: true,
Expand Down
6 changes: 3 additions & 3 deletions src/BoldSign/BoldSign.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
<FileVersion>2.1.1</FileVersion>
<ProductVersion>2.1.1</ProductVersion>
<Copyright>Copyright 2001-2021 Syncfusion Inc</Copyright>
<FileVersion>3.0.0</FileVersion>
<ProductVersion>3.0.0</ProductVersion>
<Copyright>Copyright 2001-2022 Syncfusion Inc</Copyright>
<AssemblyName>BoldSign.Api</AssemblyName>
<RootNamespace>BoldSign.Api</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
24 changes: 24 additions & 0 deletions src/BoldSign/Model/DateSignedField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,34 @@ protected DateSignedField()
/// <param name="isUnderLineFont">Gets or sets a value indicating whether the font style is underline.</param>
/// <param name="lineHeight">Gets or sets the lineHeight.</param>
/// <param name="dateFormat">Gets or sets the dateFormat.</param>
[Obsolete("Name is deprecated, please use Id instead")]
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)
{
this.DateFormat = dateFormat;
}

/// <summary>
/// Initializes a new instance of the <see cref="DateSignedField" /> class.
/// </summary>
/// <param name="pageNumber">Gets or sets the page number.</param>
/// <param name="bounds">Gets or sets the bounds (required).</param>
/// <param name="isRequired">Gets or sets a value indicating whether the field is required.</param>
/// <param name="value">Gets or sets the value.</param>
/// <param name="fontSize">Gets or sets the fontSize.</param>
/// <param name="font">Gets or sets the font (required).</param>
/// <param name="fontHexColor">Gets or sets the fontHexColor.</param>
/// <param name="isBoldFont">Gets or sets a value indicating whether the font style is bold.</param>
/// <param name="isItalicFont">Gets or sets a value indicating whether the font style is italic.</param>
/// <param name="isUnderLineFont">Gets or sets a value indicating whether the font style is underline.</param>
/// <param name="lineHeight">Gets or sets the lineHeight.</param>
/// <param name="dateFormat">Gets or sets the dateFormat.</param>
/// <param name="id">Gets or sets the id.</param>
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)
: 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)
{
this.DateFormat = dateFormat;
}

/// <summary>
/// Gets or sets the DateFormat and it's only applicable for DateSigned field.
/// Please use the pre-defiened DateFormat.
Expand Down
17 changes: 15 additions & 2 deletions src/BoldSign/Model/ExistingFormField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ public ExistingFormField(int index = default, string value = default)
this.Value = value;
}

public ExistingFormField(string name = default, string value = default)
/// <summary>
/// Initializes a new instance of the <see cref="ExistingFormField"/> class.
/// </summary>
/// <param name="id">Gets oe sets the id.</param>
/// <param name="value">Gets or sets the signer role.</param>
public ExistingFormField(string id = default, string value = default)
{
this.Name = name;
this.Id = id;
this.Value = value;
}

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

/// <summary>
/// Gets or sets the id.
/// </summary>
/// <value>Gets the value of id.</value>
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }

/// <summary>
/// Gets or sets the signer role.
/// </summary>
Expand Down
63 changes: 63 additions & 0 deletions src/BoldSign/Model/FormField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected FormField()
/// <param name="bounds">bounds (required).</param>
/// <param name="isRequired">Gets or sets a value indicating whether is required..</param>
/// <param name="value">Gets or sets the value..</param>
[Obsolete("Name is deprecated, please use Id instead")]
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)
{

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

/// <summary>
/// Initializes a new instance of the <see cref="FormField" /> class.
/// </summary>
/// <param name="type">fieldType (required).</param>
/// <param name="pageNumber">Gets or sets the page number. (required).</param>
/// <param name="bounds">bounds (required).</param>
/// <param name="isRequired">Gets or sets a value indicating whether is required..</param>
/// <param name="value">Gets or sets the value..</param>
/// <param name="font">Gets or sets the font.</param>
/// <param name="fontSize">Gets or sets the fontSize.</param>
/// <param name="fontHexColor">Gets or sets the fontHexColor.</param>
/// <param name="isBoldFont">Gets or sets the isBoldFont.</param>
/// <param name="isItalicFont">Gets or sets the isItalicFont.</param>
/// <param name="isUnderLineFont">Gets or sets the isUnderLineFont.</param>
/// <param name="lineHeight">Gets or sets the lineHeight.</param>
/// <param name="characterLimit">Gets or sets the characterLimit.</param>
/// <param name="id">Gets or sets the id.</param>
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)
{
// to ensure "fieldType" is required (not null)
if (type == null)
{
throw new InvalidDataException(ApiValidationMessages.FieldTypeRequired);
}

this.m_type = type;

// to ensure "pageNumber" is required (not null)
if (pageNumber == null)
{
throw new InvalidDataException(ApiValidationMessages.PageNumberRquired);
}

this.PageNumber = pageNumber;

// to ensure "bounds" is required (not null)
if (bounds == null)
{
throw new InvalidDataException(ApiValidationMessages.BoundsRequired);
}

this.Bounds = bounds;
this.Value = value;
this.IsRequired = isRequired;
this.FontHexColor = fontHexColor;
this.IsBoldFont = isBoldFont;
this.IsItalicFont = isItalicFont;
this.IsUnderLineFont = isUnderLineFont;
this.LineHeight = lineHeight;
this.CharacterLimit = characterLimit;
this.Font = font;
this.FontSize = fontSize;
this.Id = id;
}

/// <summary>
/// Gets the form field type.
/// </summary>
Expand All @@ -93,6 +149,12 @@ public virtual FieldType Type
set { m_type = value; }
}

/// <summary>
/// Gets or Sets id in form field.
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = true)]
public string Id { get; set; }

/// <summary>
/// Gets or Sets font name for the content in form field.
/// </summary>
Expand All @@ -110,6 +172,7 @@ public virtual FieldType Type
/// Gets or sets the form field name.
/// </summary>
/// <value>Gets or sets the name.</value>
[Obsolete("Name is deprecated, please use Id instead")]
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }

Expand Down
6 changes: 6 additions & 0 deletions src/BoldSign/Model/IFormField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ namespace BoldSign.Model
{
public interface IFormField
{
/// <summary>
/// Gets or Sets form field id.
/// </summary>
[DataMember(Name = "id", EmitDefaultValue = true)]
public string Id { get; set; }

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

Expand Down
24 changes: 24 additions & 0 deletions src/BoldSign/Model/RadioButtonField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,35 @@ protected RadioButtonField()
/// <param name="bounds">bounds (required).</param>
/// <param name="isRequired">Gets or sets a value indicating whether is required..</param>
/// <param name="value">Gets or sets the value..</param>
[Obsolete("Name is deprecated, please use Id instead")]
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)
{
this.GroupName = groupName;
}

/// <summary>
/// Initializes a new instance of the <see cref="RadioButtonField"/> class.
/// </summary>
/// <param name="pageNumber">Gets or sets the page number. (required).</param>
/// <param name="bounds">bounds (required).</param>
/// <param name="isRequired">Gets or sets a value indicating whether is required..</param>
/// <param name="value">Gets or sets the value..</param>
/// <param name="font">Gets or sets the font.</param>
/// <param name="fontSize">Gets or sets the fontSize.</param>
/// <param name="fontHexColor">Gets or sets the fontHexColor.</param>
/// <param name="isBoldFont">Gets or sets the isBoldFont.</param>
/// <param name="isItalicFont">Gets or sets the isItalicFont.</param>
/// <param name="isUnderLineFont">Gets or sets the isUnderLineFont.</param>
/// <param name="lineHeight">Gets or sets the lineHeight.</param>
/// <param name="characterLimit">Gets or sets the characterLimit.</param>
/// <param name="groupName">Gets or sets the groupName.</param>
/// <param name="id">Gets or sets the id.</param>
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)
: 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)
{
this.GroupName = groupName;
}

/// <summary>
/// Gets the form field type.It is a read only property.
/// </summary>
Expand Down
28 changes: 28 additions & 0 deletions src/BoldSign/Model/TextBoxField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,41 @@ protected TextBoxField()
/// <param name="validationType">validationType.</param>
/// <param name="validationCustomRegex">validationCustomRegex.</param>
/// <param name="placeholder">placeHolder.</param>
[Obsolete("Name is deprecated, please use Id instead")]
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)
{
this.ValidationType = validationType;
this.ValidationCustomRegex = validationCustomRegex;
this.Placeholder = placeholder;
}

/// <summary>
/// Initializes a new instance of the <see cref="TextBoxField" /> class.
/// </summary>
/// <param name="pageNumber">pageNumber.</param>
/// <param name="bounds">bounds (required).</param>
/// <param name="isRequired">isRequired.</param>
/// <param name="value">value.</param>
/// <param name="fontSize">fontSize.</param>
/// <param name="font">font (required).</param>
/// <param name="fontHexColor">fontHexColor.</param>
/// <param name="isBoldFont">isBoldFont.</param>
/// <param name="isItalicFont">isItalicFont.</param>
/// <param name="isUnderLineFont">isUnderLineFont.</param>
/// <param name="lineHeight">lineHeight.</param>
/// <param name="characterLimit">characterLimit.</param>
/// <param name="validationType">validationType.</param>
/// <param name="validationCustomRegex">validationCustomRegex.</param>
/// <param name="placeholder">placeHolder.</param>
/// <param name="id">id.</param>
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))
: 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)
{
this.ValidationType = validationType;
this.ValidationCustomRegex = validationCustomRegex;
this.Placeholder = placeholder;
}

/// <summary>
/// Gets or Sets Placeholder value
/// </summary>
Expand Down