FileConfig Class

Summary

Responsible for loading and saving the optimized results
Assembly
Cake.ImageOptimizer.dll
Namespace
Cake.ImageOptimizer
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["FileConfig"] class Type type-node

Syntax

public class FileConfig

Constructors

Name Summary
FileConfig(IFileSystem, ICakeEnvironment, ICakeLog) Initializes a new instance of the FileConfig class.

Properties

Name Value Summary
Files IList<OptimizedFile>
Gets the list of optimized files
TotalSavedPercent double
Gets the saving as a percentage from the optimization
TotalSavedSize double
Gets the saving in bytes from the optimization
TotalSizeAfter double
Gets the size of all the files after optimization
TotalSizeBefore double
Gets the size of all the files before optimization

Methods

Name Value Summary
AddResult(OptimizedFile) void
Adds a result to the config file
AddResults(IList<OptimizedFile>) void
Adds a list of results to the config file
Load(FilePath) void
Loads the list of already optimized files
RequiresOptimization(FilePath, string) bool
Checks if a file requires optimization
Save(FilePath) void
Saves the list of optimized files

Extension Methods

Name Value Summary
Dump<FileConfig>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<FileConfig>(FileConfig[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<FileConfig>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<FileConfig>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
ThrowIfNull<FileConfig>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<FileConfig>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Returns the string value or a Not set> markup suitable for Spectre.Console.
Requires the Cake.Issues addin