Skip to content

Commit

Permalink
chore: code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsee committed Jul 21, 2024
1 parent 6763a41 commit f0fb3ec
Show file tree
Hide file tree
Showing 49 changed files with 502 additions and 185 deletions.
10 changes: 8 additions & 2 deletions src/BSH.Controls/Preview/Files/CLikeFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,21 @@ public abstract class CLikeFormat : CodeFormat
/// </summary>
protected override string CommentRegEx
{
get { return @"/\*.*?\*/|//.*?(?=\r|\n)"; }
get
{
return @"/\*.*?\*/|//.*?(?=\r|\n)";
}
}

/// <summary>
/// Regular expression string to match string and character literals.
/// </summary>
protected override string StringRegEx
{
get { return @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'"; }
get
{
return @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'";
}
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/BSH.Controls/Preview/Files/CodeFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ protected abstract string Keywords
/// </remarks>
protected virtual string Preprocessors
{
get { return ""; }
get
{
return "";
}
}

/// <summary>
Expand Down Expand Up @@ -85,7 +88,10 @@ protected abstract string CommentRegEx
/// </remarks>
public virtual bool CaseSensitive
{
get { return true; }
get
{
return true;
}
}

/// <summary/>
Expand Down
10 changes: 8 additions & 2 deletions src/BSH.Controls/Preview/Files/MshFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ public class MshFormat : CodeFormat
/// </summary>
protected override string CommentRegEx
{
get { return @"#.*?(?=\r|\n)"; }
get
{
return @"#.*?(?=\r|\n)";
}
}

/// <summary>
/// Regular expression string to match string and character literals.
/// </summary>
protected override string StringRegEx
{
get { return @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'"; }
get
{
return @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'";
}
}

/// <summary>
Expand Down
25 changes: 20 additions & 5 deletions src/BSH.Controls/Preview/Files/SourceFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,40 @@ protected SourceFormat()
/// <value>The number of space characters to substitute for tab
/// characters. The default is <b>4</b>, unless overridden is a
/// derived class.</value>
public byte TabSpaces { get; set; }
public byte TabSpaces
{
get; set;
}

/// <summary>
/// Enables or disables line numbers in output.
/// </summary>
/// <value>When <b>true</b>, line numbers are generated.
/// The default is <b>false</b>.</value>
public bool LineNumbers { get; set; }
public bool LineNumbers
{
get; set;
}

/// <summary>
/// Enables or disables alternating line background.
/// </summary>
/// <value>When <b>true</b>, lines background is alternated.
/// The default is <b>false</b>.</value>
public bool Alternate { get; set; }
public bool Alternate
{
get; set;
}

/// <summary>
/// Enables or disables the embedded CSS style sheet.
/// </summary>
/// <value>When <b>true</b>, the CSS &lt;style&gt; element is included
/// in the HTML output. The default is <b>false</b>.</value>
public bool EmbedStyleSheet { get; set; }
public bool EmbedStyleSheet
{
get; set;
}

/// <overloads>Transform source code to HTML 4.01.</overloads>
///
Expand Down Expand Up @@ -141,7 +153,10 @@ public static string GetCssString()
/// <summary>
/// The regular expression used to capture language tokens.
/// </summary>
protected Regex CodeRegex { get; set; }
protected Regex CodeRegex
{
get; set;
}

/// <summary>
/// Called to evaluate the HTML fragment corresponding to each
Expand Down
5 changes: 4 additions & 1 deletion src/BSH.Controls/Preview/Files/TsqlFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ protected override string StringRegEx
/// </summary>
public override bool CaseSensitive
{
get { return false; }
get
{
return false;
}
}


Expand Down
15 changes: 12 additions & 3 deletions src/BSH.Controls/Preview/Files/VisualBasicFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,32 @@ public class VisualBasicFormat : CodeFormat
/// <value>Always <b>true</b>, since VB is not case sensitive.</value>
public override bool CaseSensitive
{
get { return false; }
get
{
return false;
}
}

/// <summary>
/// Regular expression string to match comments (' and REM).
/// </summary>
protected override string CommentRegEx
{
get { return @"(?:'|REM\s).*?(?=\r|\n)"; }
get
{
return @"(?:'|REM\s).*?(?=\r|\n)";
}
}

/// <summary>
/// Regular expression string to match string and character literals.
/// </summary>
protected override string StringRegEx
{
get { return @"""""|"".*?"""; }
get
{
return @"""""|"".*?""";
}
}

/// <summary>
Expand Down
10 changes: 8 additions & 2 deletions src/BSH.Controls/Preview/Psd/ColorModeData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ namespace SimplePsd
/// </summary>
public class ColorModeData
{
public int NLength { get; set; }
public int NLength
{
get; set;
}

public byte[] ColourData { get; set; }
public byte[] ColourData
{
get; set;
}

public ColorModeData()
{
Expand Down
20 changes: 16 additions & 4 deletions src/BSH.Controls/Preview/Psd/DisplayInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ namespace SimplePsd
/// </summary>
public class DisplayInfo
{
public short ColourSpace { get; set; }
public short ColourSpace
{
get; set;
}

public short[] Colour { get; set; } = new short[4];

public short Opacity { get; set; }
public short Opacity
{
get; set;
}

public bool Kind { get; set; }
public bool Kind
{
get; set;
}

public byte Padding { get; set; }
public byte Padding
{
get; set;
}

public DisplayInfo()
{
Expand Down
25 changes: 20 additions & 5 deletions src/BSH.Controls/Preview/Psd/HeaderInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,30 @@ namespace SimplePsd
/// </summary>
public class HeaderInfo
{
public short NChannels { get; set; }
public short NChannels
{
get; set;
}

public int NHeight { get; set; }
public int NHeight
{
get; set;
}

public int NWidth { get; set; }
public int NWidth
{
get; set;
}

public short NBitsPerPixel { get; set; }
public short NBitsPerPixel
{
get; set;
}

public short NColourMode { get; set; }
public short NColourMode
{
get; set;
}

public HeaderInfo()
{
Expand Down
20 changes: 16 additions & 4 deletions src/BSH.Controls/Preview/Psd/ImageResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ namespace SimplePsd
/// </summary>
public class ImageResource
{
public int NLength { get; set; }
public int NLength
{
get; set;
}

public byte[] OSType { get; set; } = new byte[4];

public short NID { get; set; }
public short NID
{
get; set;
}

public byte[] Name { get; set; }
public byte[] Name
{
get; set;
}

public int NSize { get; set; }
public int NSize
{
get; set;
}

public void Reset()
{
Expand Down
30 changes: 24 additions & 6 deletions src/BSH.Controls/Preview/Psd/ResolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,35 @@ namespace SimplePsd
/// </summary>
public class ResolutionInfo
{
public short HRes { get; set; }
public short HRes
{
get; set;
}

public int HResUnit { get; set; }
public int HResUnit
{
get; set;
}

public short WidthUnit { get; set; }
public short WidthUnit
{
get; set;
}

public short VRes { get; set; }
public short VRes
{
get; set;
}

public int VResUnit { get; set; }
public int VResUnit
{
get; set;
}

public short HeightUnit { get; set; }
public short HeightUnit
{
get; set;
}

public ResolutionInfo()
{
Expand Down
45 changes: 36 additions & 9 deletions src/BSH.Controls/Preview/Psd/ThumbNail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,50 @@ namespace SimplePsd
/// </summary>
public class ThumbNail
{
public int NFormat { get; set; }
public int NFormat
{
get; set;
}

public int NWidth { get; set; }
public int NWidth
{
get; set;
}

public int NHeight { get; set; }
public int NHeight
{
get; set;
}

public int NWidthBytes { get; set; }
public int NWidthBytes
{
get; set;
}

public int NSize { get; set; }
public int NSize
{
get; set;
}

public int NCompressedSize { get; set; }
public int NCompressedSize
{
get; set;
}

public short NBitPerPixel { get; set; }
public short NBitPerPixel
{
get; set;
}

public short NPlanes { get; set; }
public short NPlanes
{
get; set;
}

public byte[] Data { get; set; }
public byte[] Data
{
get; set;
}

public ThumbNail()
{
Expand Down
Loading

0 comments on commit f0fb3ec

Please sign in to comment.