Add readonly modifier for regex

This commit is contained in:
ivandrofly 2015-06-23 20:49:23 +00:00 committed by ivandroly
parent 385503cc3d
commit 77c5a5018c
11 changed files with 11 additions and 11 deletions

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class AdobeEncore : SubtitleFormat public class AdobeEncore : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d \d\d:\d\d:\d\d:\d\d ", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d \d\d:\d\d:\d\d:\d\d ", RegexOptions.Compiled);
private int _maxMsDiv10 = 0; private int _maxMsDiv10 = 0;
public override string Extension public override string Extension

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class AdobeEncoreLineTabNewLine : SubtitleFormat public class AdobeEncoreLineTabNewLine : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d\d\d\d \d\d:\d\d:\d\d:\d\d \d\d:\d\d:\d\d:\d\d\t", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d\d\d\d \d\d:\d\d:\d\d:\d\d \d\d:\d\d:\d\d:\d\d\t", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class AdobeEncoreLineTabs : SubtitleFormat public class AdobeEncoreLineTabs : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d\d\d\d\t\d\d:\d\d:\d\d:\d\d\t\d\d:\d\d:\d\d:\d\d\t", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d\d\d\d\t\d\d:\d\d:\d\d:\d\d\t\d\d:\d\d:\d\d:\d\d\t", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class AdobeEncoreTabs : SubtitleFormat public class AdobeEncoreTabs : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d\t\d\d:\d\d:\d\d:\d\d\t", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d\t\d\d:\d\d:\d\d:\d\d\t", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class AdobeEncoreWithLineNumbers : SubtitleFormat public class AdobeEncoreWithLineNumbers : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d+ \d\d:\d\d:\d\d:\d\d \d\d:\d\d:\d\d:\d\d ", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d+ \d\d:\d\d:\d\d:\d\d \d\d:\d\d:\d\d:\d\d ", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class AdobeEncoreWithLineNumbersNtsc : SubtitleFormat public class AdobeEncoreWithLineNumbersNtsc : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d+ \d\d;\d\d;\d\d;\d\d \d\d;\d\d;\d\d;\d\d ", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d+ \d\d;\d\d;\d\d;\d\d \d\d;\d\d;\d\d;\d\d ", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class AvidCaption : SubtitleFormat public class AvidCaption : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d \d\d:\d\d:\d\d:\d\d$", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d \d\d:\d\d:\d\d:\d\d$", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -10,7 +10,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
public class CapMakerPlus : SubtitleFormat public class CapMakerPlus : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d$", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d$", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class YouTubeTranscript : SubtitleFormat public class YouTubeTranscript : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d{1,3}:\d\d$", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d{1,3}:\d\d$", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
public class YouTubeTranscriptOneLine : SubtitleFormat public class YouTubeTranscriptOneLine : SubtitleFormat
{ {
private static Regex regexTimeCodes = new Regex(@"^\d{1,3}:\d\d.+$", RegexOptions.Compiled); private static readonly Regex regexTimeCodes = new Regex(@"^\d{1,3}:\d\d.+$", RegexOptions.Compiled);
public override string Extension public override string Extension
{ {

View File

@ -5,7 +5,7 @@ namespace Nikse.SubtitleEdit.Logic
{ {
public class TimeCode public class TimeCode
{ {
public static TimeCode MaxTime = new TimeCode(99, 59, 59, 999); public static readonly TimeCode MaxTime = new TimeCode(99, 59, 59, 999);
public const double BaseUnit = 1000.0; // Base unit of time public const double BaseUnit = 1000.0; // Base unit of time
private double _totalMilliseconds; private double _totalMilliseconds;