Class SaveOptionsProviderPlaceHolders
Implementation to provide save options which save split parts to files and the path of resultant file are defined with placeholders.
Implementation to provide save options which save split parts to files and the path of resultant file are defined with placeholders.
public class SaveOptionsProviderPlaceHolders : AbstractSaveOptionsProvider
Inheritance
object ← AbstractSaveOptionsProvider ← SaveOptionsProviderPlaceHolders
Inherited Members
- AbstractSaveOptionsProvider.GetSaveOptions(SplitPartInfo),
- AbstractSaveOptionsProvider.Finish(SaveOptions),
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
SaveOptionsProviderPlaceHolders(string)
Instantiates an instance to provide save options according to specified templates.
public SaveOptionsProviderPlaceHolders(string pathTemplate)
Parameters
pathTemplate
string: The template of the resultant file path.
Remarks
The supported placeholders in file path template:
- ${SheetIndex}: will be replaced by the sheet index of the split part
- ${SheetName}: will be replaced by the sheet name of the split part
- ${SplitPartIndex}: will be replaced by the index of the split part
- ${SheetIndexPrefix}: will be replaced by Sheetize.SaveOptionsProviderPlaceHolders.SheetIndexPrefix
- ${SheetNamePrefix}: will be replaced by Sheetize.SaveOptionsProviderPlaceHolders.SheetNamePrefix
- ${SplitPartPrefix}: will be replaced by Sheetize.SaveOptionsProviderPlaceHolders.SplitPartPrefix
Properties
BuildPathWithSheetAlways
Whether add sheet index or name to file path always. Default value is false, that is, when there is only one sheet, the sheet index and name and corresponding prefix(Sheetize.SaveOptionsProviderPlaceHolders.SheetNamePrefix) will not be added to the file path.
public bool BuildPathWithSheetAlways { get; set; }
Property Value
BuildPathWithSplitPartAlways
Whether add split part index to file path always. Default value is false, that is, when there is only one split part, the split part index and corresponding prefix(Sheetize.SaveOptionsProviderPlaceHolders.SplitPartPrefix) will not be added to the file path.
public bool BuildPathWithSplitPartAlways { get; set; }
Property Value
SaveOptionsTemplate
The template for creating instance of save options in Sheetize.SaveOptionsProviderPlaceHolders.GetSaveOptions(Sheetize.SplitPartInfo).
public SaveOptions SaveOptionsTemplate { get; set; }
Property Value
Remarks
If the template has been specified, then the created instance will copy all setting from it and update the output file accordingly.
SheetIndexOffset
Offset of sheet’s index between what used in file path and its actual value(Sheetize.SplitPartInfo.SheetIndex).
public int SheetIndexOffset { get; set; }
Property Value
SheetIndexPrefix
Prefix for the index of worksheet.
public string SheetIndexPrefix { get; set; }
Property Value
Remarks
If there is only one worksheet and Sheetize.SaveOptionsProviderPlaceHolders.BuildPathWithSheetAlways is false, then this prefix and the sheet index(or name) will not be added to the resultant file path.
SheetNamePrefix
Prefix for the index of worksheet.
public string SheetNamePrefix { get; set; }
Property Value
Remarks
If there is only one worksheet and Sheetize.SaveOptionsProviderPlaceHolders.BuildPathWithSheetAlways is false, then this prefix and the sheet index(or name) will not be added to the resultant file path.
SplitPartIndexOffset
Offset of split part’s index between what used in file path and its actual value(Sheetize.SplitPartInfo.PartIndex).
public int SplitPartIndexOffset { get; set; }
Property Value
SplitPartPrefix
Prefix for the index of split part.
public string SplitPartPrefix { get; set; }
Property Value
Remarks
If there is only one split part and Sheetize.SaveOptionsProviderPlaceHolders.BuildPathWithSplitPartAlways is false, then this prefix and the split part index(0) will not be added to the resultant file path.
Methods
GetSaveOptions(SplitPartInfo)
Gets the save options from which to get the output settings for currently split part.
public override SaveOptions GetSaveOptions(SplitPartInfo part)
Parameters
part
SplitPartInfo
Returns
Namespace: Sheetize Assembly: Sheetize.dll