summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-03-26 11:57:57 +0100
committersr55 <[email protected]>2017-03-26 11:57:57 +0100
commit6402bd62a09790377fa76868bed361ffa9b5c810 (patch)
tree99629d78f89f4dac2fca036e0e85cdbadb4f6f8e /win/CS/HandBrakeWPF/ViewModels
parentb13c230613ae2092a5ce6f699df10a93f400cff6 (diff)
WinGui: Fix a number of stylecop warnings.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs36
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs30
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs54
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs20
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs12
5 files changed, 76 insertions, 76 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index c90c9add3..ffea2554e 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -305,6 +305,24 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.Task);
}
+ /// <summary>
+ /// Add all remaining for selected languages.
+ /// </summary>
+ public void AddAllRemainingForSelectedLanguages()
+ {
+ // Add them if they are not already added.
+ foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())
+ {
+ // Step 2: Check if the track list already contrains this track
+ bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
+ if (!found)
+ {
+ // If it doesn't, add it.
+ this.Add(sourceTrack, true);
+ }
+ }
+ }
+
#endregion
#region Methods
@@ -443,24 +461,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Add all remaining for selected languages.
- /// </summary>
- public void AddAllRemainingForSelectedLanguages()
- {
- // Add them if they are not already added.
- foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())
- {
- // Step 2: Check if the track list already contrains this track
- bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
- if (!found)
- {
- // If it doesn't, add it.
- this.Add(sourceTrack, true);
- }
- }
- }
-
- /// <summary>
/// The get preferred audio track, or the first if none available.
/// </summary>
/// <returns>
diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
index ce82439f1..85ac495ff 100644
--- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
@@ -108,6 +108,21 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Trigger a faster / smoother way of updating the log window.
+ /// </summary>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ protected virtual void OnLogMessageReceived(LogEventArgs e)
+ {
+ var onLogMessageReceived = this.LogMessageReceived;
+ if (onLogMessageReceived != null)
+ {
+ onLogMessageReceived.Invoke(this, e);
+ }
+ }
+
+ /// <summary>
/// Handle the OnDeactivate Caliburn Event
/// </summary>
/// <param name="close">
@@ -172,20 +187,5 @@ namespace HandBrakeWPF.ViewModels
});
}
}
-
- /// <summary>
- /// Trigger a faster / smoother way of updating the log window.
- /// </summary>
- /// <param name="e">
- /// The e.
- /// </param>
- protected virtual void OnLogMessageReceived(LogEventArgs e)
- {
- var onLogMessageReceived = this.LogMessageReceived;
- if (onLogMessageReceived != null)
- {
- onLogMessageReceived.Invoke(this, e);
- }
- }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index fbe0f6ad0..f29e6fac0 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -2091,6 +2091,33 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// The process drive.
+ /// </summary>
+ /// <param name="item">
+ /// The item.
+ /// </param>
+ public void ProcessDrive(object item)
+ {
+ if (item != null)
+ {
+ if (item.GetType() == typeof(DriveInformation))
+ {
+ this.StartScan(((DriveInformation)item).RootDirectory, 0);
+ }
+ else if (item.GetType() == typeof(SourceMenuItem))
+ {
+ DriveInformation driveInfo = ((SourceMenuItem)item).Tag as DriveInformation;
+ if (driveInfo != null)
+ {
+ this.StartScan(driveInfo.RootDirectory, this.TitleSpecificScan);
+ }
+
+ this.ShowSourceSelection = false;
+ }
+ }
+ }
+
#endregion
#region Private Methods
@@ -2517,33 +2544,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// The process drive.
- /// </summary>
- /// <param name="item">
- /// The item.
- /// </param>
- public void ProcessDrive(object item)
- {
- if (item != null)
- {
- if (item.GetType() == typeof(DriveInformation))
- {
- this.StartScan(((DriveInformation)item).RootDirectory, 0);
- }
- else if (item.GetType() == typeof(SourceMenuItem))
- {
- DriveInformation driveInfo = ((SourceMenuItem)item).Tag as DriveInformation;
- if (driveInfo != null)
- {
- this.StartScan(driveInfo.RootDirectory, this.TitleSpecificScan);
- }
-
- this.ShowSourceSelection = false;
- }
- }
- }
-
- /// <summary>
/// Allows the main window to respond to setting changes.
/// </summary>
/// <param name="sender">
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index d98fb2d25..69338721b 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -1124,15 +1124,6 @@ namespace HandBrakeWPF.ViewModels
#region Public Methods
/// <summary>
- /// Load / Update the user settings.
- /// </summary>
- protected override void OnActivate()
- {
- this.OnLoad();
- base.OnActivate();
- }
-
- /// <summary>
/// Close this window.
/// </summary>
public void Close()
@@ -1244,7 +1235,7 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void BrowseWhenDoneAudioFile()
{
- OpenFileDialog dialog = new OpenFileDialog() { Filter = "All Files|*.wav;*.mp3", FileName = this.WhenDoneAudioFileFullPath };
+ OpenFileDialog dialog = new OpenFileDialog() { Filter = "All Files|*.wav;*.mp3", FileName = this.WhenDoneAudioFileFullPath };
bool? dialogResult = dialog.ShowDialog();
if (dialogResult.HasValue && dialogResult.Value)
{
@@ -1438,6 +1429,15 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Load / Update the user settings.
+ /// </summary>
+ protected override void OnActivate()
+ {
+ this.OnLoad();
+ base.OnActivate();
+ }
+
+ /// <summary>
/// Save the settings selected
/// </summary>
private void Save()
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index 9e002ae36..f1191edae 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -41,7 +41,7 @@ namespace HandBrakeWPF.ViewModels
#region Constants and Fields
- private readonly Subtitle ForeignAudioSearchTrack;
+ private readonly Subtitle foreignAudioSearchTrack;
private IList<Subtitle> sourceTracks;
#endregion
@@ -63,8 +63,8 @@ namespace HandBrakeWPF.ViewModels
this.Langauges = LanguageUtilities.MapLanguages().Keys;
this.CharacterCodes = CharCodesUtilities.GetCharacterCodes();
- this.ForeignAudioSearchTrack = new Subtitle { SubtitleType = SubtitleType.ForeignAudioSearch, Language = "Foreign Audio Search" };
- this.SourceTracks = new List<Subtitle> { this.ForeignAudioSearchTrack };
+ this.foreignAudioSearchTrack = new Subtitle { SubtitleType = SubtitleType.ForeignAudioSearch, Language = "Foreign Audio Search" };
+ this.SourceTracks = new List<Subtitle> { this.foreignAudioSearchTrack };
}
#endregion
@@ -326,7 +326,7 @@ namespace HandBrakeWPF.ViewModels
// Add Foreign Audio Scan
if (this.SubtitleBehaviours.AddForeignAudioScanTrack)
{
- this.Add(ForeignAudioSearchTrack);
+ this.Add(foreignAudioSearchTrack);
}
// Add Track Behaviours
@@ -496,7 +496,7 @@ namespace HandBrakeWPF.ViewModels
public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.SourceTracks.Clear();
- this.SourceTracks.Add(ForeignAudioSearchTrack);
+ this.SourceTracks.Add(foreignAudioSearchTrack);
foreach (Subtitle subtitle in title.Subtitles)
{
this.SourceTracks.Add(subtitle);
@@ -534,7 +534,7 @@ namespace HandBrakeWPF.ViewModels
if (source == null)
{
- source = ForeignAudioSearchTrack;
+ source = foreignAudioSearchTrack;
}
SubtitleTrack track = new SubtitleTrack