diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9491a2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,363 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/MediaPlayerWindow/MediaPlayerModels/FileDetails.cs b/MediaPlayerWindow/MediaPlayerModels/FileDetails.cs index 4fd7e0c..23d6d0e 100644 --- a/MediaPlayerWindow/MediaPlayerModels/FileDetails.cs +++ b/MediaPlayerWindow/MediaPlayerModels/FileDetails.cs @@ -1,13 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MediaPlayerModels -{ - class FileDetails - { - // private string title; - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MediaPlayerModels +{ + class FileDetails + { + // private string title; + } +} diff --git a/MediaPlayerWindow/MediaPlayerModels/MediaPlayerModels.csproj b/MediaPlayerWindow/MediaPlayerModels/MediaPlayerModels.csproj index 233bb45..b540acc 100644 --- a/MediaPlayerWindow/MediaPlayerModels/MediaPlayerModels.csproj +++ b/MediaPlayerWindow/MediaPlayerModels/MediaPlayerModels.csproj @@ -1,56 +1,56 @@ - - - - - Debug - AnyCPU - {968C2CCC-C711-46BE-85A3-9A3369EFF1C0} - Library - Properties - MediaPlayerModels - MediaPlayerModels - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + {968C2CCC-C711-46BE-85A3-9A3369EFF1C0} + Library + Properties + MediaPlayerModels + MediaPlayerModels + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MediaPlayerWindow/MediaPlayerModels/PlayListClass.cs b/MediaPlayerWindow/MediaPlayerModels/PlayListClass.cs index ca11db8..5b383a6 100644 --- a/MediaPlayerWindow/MediaPlayerModels/PlayListClass.cs +++ b/MediaPlayerWindow/MediaPlayerModels/PlayListClass.cs @@ -1,17 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Runtime.Serialization; -namespace MediaPlayerModels -{ - [DataContract] - public class PlayListClass - { - [DataMember] - public string FileName { get; set; } - [DataMember] - public string Filepath { get; set; } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Runtime.Serialization; +namespace MediaPlayerModels +{ + [DataContract] + public class PlayListClass + { + [DataMember] + public string FileName { get; set; } + [DataMember] + public string Filepath { get; set; } + } +} diff --git a/MediaPlayerWindow/MediaPlayerModels/PlayListDirectory.cs b/MediaPlayerWindow/MediaPlayerModels/PlayListDirectory.cs index b36dc7d..edb7f8b 100644 --- a/MediaPlayerWindow/MediaPlayerModels/PlayListDirectory.cs +++ b/MediaPlayerWindow/MediaPlayerModels/PlayListDirectory.cs @@ -1,23 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; -using System.Xml; - -namespace MediaPlayerModels -{ - [DataContract] - public class PlayListDirectory - { - - private List playListCollection=new List(); - [DataMember] - public List PlayListCollection - { - get { return playListCollection; } - set { playListCollection = value; } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; +using System.Xml; + +namespace MediaPlayerModels +{ + [DataContract] + public class PlayListDirectory + { + + private List playListCollection=new List(); + [DataMember] + public List PlayListCollection + { + get { return playListCollection; } + set { playListCollection = value; } + } + } +} diff --git a/MediaPlayerWindow/MediaPlayerModels/Properties/AssemblyInfo.cs b/MediaPlayerWindow/MediaPlayerModels/Properties/AssemblyInfo.cs index 14c0228..3c85aa7 100644 --- a/MediaPlayerWindow/MediaPlayerModels/Properties/AssemblyInfo.cs +++ b/MediaPlayerWindow/MediaPlayerModels/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MediaPlayerModels")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MediaPlayerModels")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7c88021a-55e6-44d5-bfb3-ce37f811a331")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MediaPlayerModels")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MediaPlayerModels")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7c88021a-55e6-44d5-bfb3-ce37f811a331")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MediaPlayerWindow/MediaPlayerModels/bin/Debug/MediaPlayerModels.pdb b/MediaPlayerWindow/MediaPlayerModels/bin/Debug/MediaPlayerModels.pdb deleted file mode 100644 index 5f5978e..0000000 Binary files a/MediaPlayerWindow/MediaPlayerModels/bin/Debug/MediaPlayerModels.pdb and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/MediaPlayerWindow/MediaPlayerModels/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index af77773..0000000 Binary files a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.csproj.FileListAbsolute.txt b/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.csproj.FileListAbsolute.txt deleted file mode 100644 index dff9c04..0000000 --- a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,5 +0,0 @@ -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerModels\bin\Debug\MediaPlayerModels.dll -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerModels\bin\Debug\MediaPlayerModels.pdb -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerModels\obj\Debug\MediaPlayerModels.csprojResolveAssemblyReference.cache -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerModels\obj\Debug\MediaPlayerModels.dll -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerModels\obj\Debug\MediaPlayerModels.pdb diff --git a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.csprojResolveAssemblyReference.cache b/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.csprojResolveAssemblyReference.cache deleted file mode 100644 index 1b186fe..0000000 Binary files a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.csprojResolveAssemblyReference.cache and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.pdb b/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.pdb deleted file mode 100644 index 5f5978e..0000000 Binary files a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/MediaPlayerModels.pdb and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/MediaPlayerWindow/MediaPlayerModels/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs deleted file mode 100644 index e69de29..0000000 diff --git a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/MediaPlayerWindow/MediaPlayerModels/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/MediaPlayerWindow/MediaPlayerModels/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/MediaPlayerWindow/MediaPlayerModels/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs deleted file mode 100644 index e69de29..0000000 diff --git a/MediaPlayerWindow/MediaPlayerViewModel/AlbumViewModel.cs b/MediaPlayerWindow/MediaPlayerViewModel/AlbumViewModel.cs index daf455b..952a37e 100644 --- a/MediaPlayerWindow/MediaPlayerViewModel/AlbumViewModel.cs +++ b/MediaPlayerWindow/MediaPlayerViewModel/AlbumViewModel.cs @@ -1,13 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MediaPlayerViewModel -{ - class AlbumViewModel - { - } -} +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MediaPlayerViewModel +{ + class AlbumViewModel + { + } +} diff --git a/MediaPlayerWindow/MediaPlayerViewModel/Commands/Delegate.cs b/MediaPlayerWindow/MediaPlayerViewModel/Commands/Delegate.cs index e462244..379f89b 100644 --- a/MediaPlayerWindow/MediaPlayerViewModel/Commands/Delegate.cs +++ b/MediaPlayerWindow/MediaPlayerViewModel/Commands/Delegate.cs @@ -1,38 +1,40 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace MediaPlayerWindow.Commands -{ - public class DelegateCommand:ICommand - { - private Action whatToExecute; - private Func whenToExecute; - - public DelegateCommand(Action what, Funcwhen ) - { - whatToExecute = what; - whenToExecute = when; - } - - public bool CanExecute(object parameter) - { - return whenToExecute() ; - } - - public void Execute(object parameter) - { - // throw new NotImplementedException(); - - whatToExecute(parameter ); - } - - public event EventHandler CanExecuteChanged; - } -} +using MediaPlayerViewModel; +using System; +using System.Windows.Forms; +using System.Windows.Input; + +namespace MediaPlayerWindow.Commands +{ + public class DelegateCommand : ICommand + { + private Action whatToExecute; + private Func whenToExecute; + private MediaPlayerMainWindowViewModel _viewModel; + public DelegateCommand(Action what, Func when, MediaPlayerMainWindowViewModel viewModel) + { + whatToExecute = what; + whenToExecute = when; + _viewModel = viewModel; + } + + public bool CanExecute(object parameter) + { + return whenToExecute(); + } + + public void Execute(object parameter) + { + // throw new NotImplementedException(); + try + { + whatToExecute(parameter); + } + catch (Exception ex) + { + _viewModel.Alert = ex.Message; + } + } + + public event EventHandler CanExecuteChanged; + } +} diff --git a/MediaPlayerWindow/MediaPlayerViewModel/Events/EventAggregatorClassForViewModel.cs b/MediaPlayerWindow/MediaPlayerViewModel/Events/EventAggregatorClassForViewModel.cs index 9efe6f8..5e82302 100644 --- a/MediaPlayerWindow/MediaPlayerViewModel/Events/EventAggregatorClassForViewModel.cs +++ b/MediaPlayerWindow/MediaPlayerViewModel/Events/EventAggregatorClassForViewModel.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MediaPlayerViewModel.Events -{ -// class EventAggregatorClassForViewModel:IEventAggregator -// { -// private IeventAggregator _aggregator; -// } - -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MediaPlayerViewModel.Events +{ +// class EventAggregatorClassForViewModel:IEventAggregator +// { +// private IeventAggregator _aggregator; +// } + +} diff --git a/MediaPlayerWindow/MediaPlayerViewModel/MediaPlayerMainWindowViewModel.cs b/MediaPlayerWindow/MediaPlayerViewModel/MediaPlayerMainWindowViewModel.cs index 5f96f7e..680c714 100644 --- a/MediaPlayerWindow/MediaPlayerViewModel/MediaPlayerMainWindowViewModel.cs +++ b/MediaPlayerWindow/MediaPlayerViewModel/MediaPlayerMainWindowViewModel.cs @@ -1,570 +1,537 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.IO; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Forms; -using System.Xml.Serialization; -using MediaPlayerModels; -using MediaPlayerViewModel.Annotations; -using MediaPlayerWindow.Commands; -using System.Windows.Input; -using Button = System.Windows.Controls.Button; -using System.Runtime.Serialization; -namespace MediaPlayerViewModel -{ - public class MediaPlayerMainWindowViewModel:INotifyPropertyChanged - { - private Uri _mediaSource; - private bool _playRequested=false; - private bool _mediaOpened = false; - private bool playValue = false; - private System.Windows.Visibility listVisibility; - private Dictionary playlistLookupDictionary=new Dictionary(); - // private ObservableCollection folder=new ObservableCollection(); - private ObservableCollection playListViewCollection=new ObservableCollection(); - private ObservableCollection> albumsViewCollection = new ObservableCollection>(); - public string ImageUri { get; set; } - - public MediaPlayerMainWindowViewModel() - { - ImageUri = Properties.Settings.Default.backgroundImage; - } - - public ObservableCollection PlayListViewCollection - { - get { return playListViewCollection; } - set { playListViewCollection = value; } - } - - public System.Windows.Visibility ListVisibility - { - get { return listVisibility; } - set { listVisibility = value;OnPropertyChanged("ListVisibility"); } - } - //public event PlayRequestedValueChanged; - public event EventHandler PlayValueRequested; - public event PropertyChangedEventHandler PropertyChanged; - public event EventHandler PauseRequested; - public event EventHandler StopRequested; - public event EventHandler MoveForwardRequested; - public event EventHandler MoveBackwardRequested; - public event EventHandler MediaOpenedRequested; - public event EventHandler VolumeUpEvent; - public event EventHandler VolumeDownEvent; - public event EventHandler SpeedRatioUpEvent; - public event EventHandler SpeedRatioDownEvent; - public event EventHandler FullScreenEvent; - public event EventHandler ChangeBackgroundEvent; - - public ObservableCollection> AlbumsViewCollection - { - get { return albumsViewCollection; } - set { albumsViewCollection = value; } - } - - public bool PlayRequested - { - get { return _playRequested; } - set { _playRequested = value; OnPropertyChanged("PlayRequested"); - - } - - } - - public bool MediaOpened - { - get { return _mediaOpened; } - set { _mediaOpened = value;OnMediaOpenedRequested(); } - } - - #region label - public Uri MediaSource - { - get { return _mediaSource; } - set - { - _mediaSource = value; - - OnPropertyChanged("MediaSource"); - - } - } - - - public ICommand OpenFileCommand - { - get { return new DelegateCommand(OpenFileMethod, IsValid); } - - } - - public ICommand ShowHidePlayListCommand - { - get { return new DelegateCommand(ShowHidePlayListMethod,IsValid);} - } - - public ICommand PlayFileCommand - { - get { return new DelegateCommand(PlayMediaFileMethod,IsValid);} - } - - public ICommand SpeedRatioUpEventCommand - { - get { return new DelegateCommand(SpeedRatioUpMethod,IsValid);} - } - - public ICommand SpeedRatioDownEventCommand - { - get { return new DelegateCommand(SpeedRatioDownMethod,IsValid);} - } - - public ICommand VolumeUpCommand - { - get { return new DelegateCommand(VolumeUpMethod,IsValid);} - } - - public ICommand VolumeDownCommand - { - get { return new DelegateCommand(VolumeDownMethod,IsValid);} - } - public ICommand PlayListCommand - { - get { return new DelegateCommand(PlayListMethod,IsValid);} - } - - public ICommand FullScreenCommand - { - get { return new DelegateCommand(FullScreenMethod,IsValid);} - } - - public ICommand OnItemSelectedInPlayListCommand - { - get { return new DelegateCommand(ItemSelectedInPlayList,IsValid);} - } - public ICommand StopFileCommand - { - get { return new DelegateCommand(StopMediaFileMethod, IsValid); } - } - - public ICommand SavePlayListCommand - { - get { return new DelegateCommand(SavePlaylist,IsValid);} - } - - public ICommand MediaOpenedCommand - { - get { return new DelegateCommand(MediaOpenedMethod,IsValid);} - } - public ICommand OpenPlayListCommand - { - get { return new DelegateCommand(OpenPlayList,IsValid);} - } - public ICommand ChangeBackgroundCommand - { - get { return new DelegateCommand(ChangeBackground, IsValid); } - } - public ICommand MoveForwardFileCommand - { - get { return new DelegateCommand(MoveForwardMediaFileMethod, IsValid); } - } - public ICommand MoveBackwardFileCommand - { - get { return new DelegateCommand(MoveBackwardMediaFileMethod, IsValid); } - } - - - #endregion - #region Events - protected virtual void OnPropertyChanged(string propertyName) - { - // PropertyChangedEventHandler handler = PropertyChanged; - // if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); - if (PropertyChanged != null) - { - this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - protected virtual void OnPauseRequested() - { - if (PauseRequested != null) - { - this.PauseRequested(this,new EventArgs()); - } - } - protected virtual void OnPlayValueRequested() - { - if (PlayValueRequested != null) - { - this.PlayValueRequested(this, new EventArgs()); - } - } - - protected virtual void OnFullScreeEvent() - { - if (FullScreenEvent != null) - { - this.FullScreenEvent(this, new EventArgs()); - } - } - - protected virtual void OnChangeBackgroundEvent() - { - if (ChangeBackgroundEvent != null) - { - this.ChangeBackgroundEvent(this, new EventArgs()); - } - } - - protected virtual void OnVolumeUpEvent() - { - if (VolumeUpEvent != null) - { - this.VolumeUpEvent(this,new EventArgs()); - } - } - - protected virtual void OnSpeedRatioUpEvent() - { - if (SpeedRatioUpEvent != null) - { - this.SpeedRatioUpEvent(this,new EventArgs()); - } - } - protected virtual void OnSpeedRatioDownEvent() - { - if (SpeedRatioDownEvent != null) - { - this.SpeedRatioDownEvent(this, new EventArgs()); - } - } - - protected virtual void OnVolumeDownEvent() - { - if (VolumeDownEvent != null) - { - this.VolumeDownEvent(this,new EventArgs()); - } - } - protected virtual void OnMediaOpenedRequested() - { - if (MediaOpenedRequested != null) - { - this.MediaOpenedRequested(this,new EventArgs()); - } - } - protected virtual void OnStopRequested() - { - if (StopRequested != null) - { - this.StopRequested(this, new EventArgs()); - } - } - protected virtual void OnMoveForwardRequested() - { - if (MoveForwardRequested != null) - { - this.MoveForwardRequested(this, EventArgs.Empty); - } - } - protected virtual void OnMoveBackwardRequested() - { - if (MoveBackwardRequested != null) - { - this.MoveBackwardRequested(this, new EventArgs()); - } - } - - #endregion - - #region Methods - private void OpenFileMethod(object obj) - { - - System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog(); - dialog.Filter = - "Audio Files (*.mp3,*.m4a,*.wav,*.aac)|*.mp3|Video Files(*.mp4,*.wmv,*.3gp,*.mkv)|*.mp4|All Files(*.*)|*.*"; - dialog.FilterIndex = 2; - // MediaPlayerButtonObj = obj as MediaElement; - - System.Windows.Forms.DialogResult dialogResult = dialog.ShowDialog(); - if (dialogResult == System.Windows.Forms.DialogResult.OK) - { - MediaSource = new Uri(dialog.FileName); - try - { - playlistLookupDictionary.Add(dialog.SafeFileName, MediaSource); - PlayListViewCollection.Add(new Uri(dialog.SafeFileName, UriKind.Relative)); - } - catch (Exception e) - { - - } - - - } - - } - - private void VolumeUpMethod(object o) - { - OnVolumeUpEvent(); - } - - private void FullScreenMethod(object o) - { - OnFullScreeEvent(); - } - private void VolumeDownMethod(Object o) - { - OnVolumeDownEvent(); - } - - private void SpeedRatioUpMethod(object o) - { - OnSpeedRatioUpEvent(); - } - private void SpeedRatioDownMethod(object o) - { - OnSpeedRatioDownEvent(); - } - private void MediaOpenedMethod(Object obj) - { - MediaOpened = true; - } - private void SavePlaylist(Object obj) - { - - XmlSerializer _xmlSerializer = new XmlSerializer(typeof(PlayListDirectory)); - SaveFileDialog _playListSaveDialog=new SaveFileDialog(); - _playListSaveDialog.Filter = "xml files(*.xml)|*.xml"; - _playListSaveDialog.Title = "Save PlayList"; - if (_playListSaveDialog.ShowDialog() == DialogResult.OK) - { - string filename = _playListSaveDialog.FileName; - using (TextWriter _textWriter = new StreamWriter(filename)) - { - PlayListDirectory playListDirectory=new PlayListDirectory(); - - - List _mediaList = new List(); - foreach (Uri file in PlayListViewCollection ) - { - PlayListClass temp = new PlayListClass(); - temp.FileName = file.ToString(); - temp.Filepath = playlistLookupDictionary[file.ToString()].ToString(); - _mediaList.Add(temp); - - } - playListDirectory.PlayListCollection = _mediaList; - _xmlSerializer.Serialize(_textWriter, playListDirectory); - } - } - - } - - private void OpenPlayList(Object obj) - { - // playlistLookupDictionary.Clear(); - // playListViewCollection.Clear(); - XmlSerializer _xmlDeSerializer=new XmlSerializer(typeof(PlayListDirectory)); - OpenFileDialog _playListOpenFileDialog=new OpenFileDialog(); - _playListOpenFileDialog.Filter = "xml files(*.xml)|*.xml"; - _playListOpenFileDialog.Title = "Open PlayList"; - if (_playListOpenFileDialog.ShowDialog() == DialogResult.OK) - { - string filename = _playListOpenFileDialog.FileName; - TextReader _textReader=new StreamReader(filename); - Object xmlObject =_xmlDeSerializer.Deserialize(_textReader); - PlayListDirectory xmlDataCollection = (PlayListDirectory) xmlObject; - _textReader.Close(); - foreach (PlayListClass tempList in xmlDataCollection.PlayListCollection) - { - try - { - playlistLookupDictionary.Add(tempList.FileName, new Uri(tempList.Filepath, UriKind.Absolute)); - playListViewCollection.Add(new Uri(tempList.FileName, UriKind.Relative)); - MediaSource = new Uri(tempList.Filepath,UriKind.Absolute); - } - catch(Exception e) - { - - } - } - - - - - - - } - - } - - private void ChangeBackground(Object obj) - { - OpenFileDialog _backgroundOpenFileDialog = new OpenFileDialog(); - _backgroundOpenFileDialog.Filter = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png"; - _backgroundOpenFileDialog.Title = "Choose Background"; - - DialogResult dialogResult = _backgroundOpenFileDialog.ShowDialog(); - if (dialogResult == DialogResult.OK) - { - //saves the background in the users settings - Properties.Settings.Default.backgroundImage = _backgroundOpenFileDialog.FileName; - Properties.Settings.Default.Save(); - ImageUri = _backgroundOpenFileDialog.FileName; - OnChangeBackgroundEvent(); - } - } - - private void ShowHidePlayListMethod(Object obj) - { - try - { - System.Windows.Controls.ListBox _list = obj as System.Windows.Controls.ListBox; - if (ListVisibility == System.Windows.Visibility.Visible) - { - ListVisibility = System.Windows.Visibility.Collapsed; - } - else - { - ListVisibility = System.Windows.Visibility.Visible; - } - } - catch (Exception e) - { - - } - } - - - private void StopMediaFileMethod(Object Obj) - { - OnStopRequested(); - playValue = !playValue; - } - - - private void MoveForwardMediaFileMethod(Object Obj) - { - OnMoveForwardRequested(); - } - - private void MoveBackwardMediaFileMethod(Object obj) - { - OnMoveBackwardRequested(); - } - private void PlayListMethod(Object obj) - { - System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog(); - dialog.Multiselect = true; - dialog.Filter = - "Audio Files (*.mp3,*.m4a,*.wav,*.aac)|*.mp3|Video Files(*.mp4,*.wmv,*.3gp,*.mkv)|*.mp4|All Files(*.*)|*.*"; - dialog.FilterIndex = 2; - // MediaPlayerButtonObj = obj as MediaElement; - dialog.Title = "Add Media Files To PlayList"; - System.Windows.Forms.DialogResult dialogResult = dialog.ShowDialog(); - - if (dialogResult == System.Windows.Forms.DialogResult.OK) - { - int count_files = 0; - foreach (string file in dialog.FileNames) - { - try - { - MediaSource = new Uri(file); - playlistLookupDictionary.Add(dialog.SafeFileNames[count_files], MediaSource); - PlayListViewCollection.Add(new Uri(dialog.SafeFileNames[count_files], UriKind.Relative)); - count_files ++; - } - catch(Exception e) - { - - } - - } - } - } - - private void PlayMediaFileMethod(Object obj) - { - - ToggleButton PlayFileButtonObj = obj as ToggleButton; - if (obj == null) - { - if (playValue) - { - OnPlayValueRequested(); - playValue = false; - } - else - { - OnPauseRequested(); - playValue = true; - } - - - } - else - { - if (PlayFileButtonObj.IsEnabled) - { - if (PlayFileButtonObj.IsChecked.Value) - { - OnPlayValueRequested(); - - - } - else - { - OnPauseRequested(); - - } - } - } - } - - public void ItemSelectedInPlayList(object obj) - { - // TextBlock textBlockViewModelObj = obj as TextBlock; - - string sourceText = obj.ToString(); - - // MediaSource = playlistLookupDictionary[textBlockViewModelObj.Text]; - MediaSource = playlistLookupDictionary[sourceText]; - PlayRequested = true; - } - - private void AlbumsCreateMethod() - { - System.Windows.Forms.FolderBrowserDialog folderBrowserControl = new System.Windows.Forms.FolderBrowserDialog(); - System.Windows.Forms.DialogResult result = folderBrowserControl.ShowDialog(); - if (result == DialogResult.OK) - { - - } - } - - - private bool IsValid() - { - // if (obj == null) throw new ArgumentNullException("obj"); - return true; - } - - #endregion - - - - - } -} +using MediaPlayerModels; +using MediaPlayerWindow.Commands; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.IO; +using System.Windows.Controls.Primitives; +using System.Windows.Forms; +using System.Windows.Input; +using System.Xml.Serialization; +namespace MediaPlayerViewModel +{ + public class MediaPlayerMainWindowViewModel : INotifyPropertyChanged + { + private Uri _mediaSource; + private bool _playRequested = false; + private bool _mediaOpened = false; + private bool playValue = false; + private System.Windows.Visibility listVisibility; + private Dictionary playlistLookupDictionary = new Dictionary(); + // private ObservableCollection folder=new ObservableCollection(); + private ObservableCollection playListViewCollection = new ObservableCollection(); + private ObservableCollection> albumsViewCollection = new ObservableCollection>(); + public string ImageUri { get; set; } + + public MediaPlayerMainWindowViewModel() + { + ImageUri = Properties.Settings.Default.backgroundImage; + } + + public ObservableCollection PlayListViewCollection + { + get { return playListViewCollection; } + set { playListViewCollection = value; } + } + + private string _alert; + public string Alert + { + get { return _alert; } + set + { + _alert = value; + OnPropertyChanged(nameof(Alert)); + OnPropertyChanged(nameof(HasAlert)); + } + } + + public bool HasAlert => !string.IsNullOrWhiteSpace(Alert); + + public System.Windows.Visibility ListVisibility + { + get { return listVisibility; } + set { listVisibility = value; OnPropertyChanged("ListVisibility"); } + } + //public event PlayRequestedValueChanged; + public event EventHandler PlayValueRequested; + public event PropertyChangedEventHandler PropertyChanged; + public event EventHandler PauseRequested; + public event EventHandler StopRequested; + public event EventHandler MoveForwardRequested; + public event EventHandler MoveBackwardRequested; + public event EventHandler MediaOpenedRequested; + public event EventHandler VolumeUpEvent; + public event EventHandler VolumeDownEvent; + public event EventHandler SpeedRatioUpEvent; + public event EventHandler SpeedRatioDownEvent; + public event EventHandler FullScreenEvent; + public event EventHandler ChangeBackgroundEvent; + + public ObservableCollection> AlbumsViewCollection + { + get { return albumsViewCollection; } + set { albumsViewCollection = value; } + } + + public bool PlayRequested + { + get { return _playRequested; } + set + { + _playRequested = value; OnPropertyChanged("PlayRequested"); + } + } + + public bool MediaOpened + { + get { return _mediaOpened; } + set { _mediaOpened = value; OnMediaOpenedRequested(); } + } + + #region label + public Uri MediaSource + { + get { return _mediaSource; } + set + { + _mediaSource = value; + + OnPropertyChanged("MediaSource"); + } + } + + public ICommand OpenFileCommand + { + get { return new DelegateCommand(OpenFileMethod, IsValid, this); } + + } + + public ICommand ShowHidePlayListCommand + { + get { return new DelegateCommand(ShowHidePlayListMethod, IsValid, this); } + } + + public ICommand PlayFileCommand + { + get { return new DelegateCommand(PlayMediaFileMethod, IsValid, this); } + } + + public ICommand SpeedRatioUpEventCommand + { + get { return new DelegateCommand(SpeedRatioUpMethod, IsValid, this); } + } + + public ICommand SpeedRatioDownEventCommand + { + get { return new DelegateCommand(SpeedRatioDownMethod, IsValid, this); } + } + + public ICommand VolumeUpCommand + { + get { return new DelegateCommand(VolumeUpMethod, IsValid, this); } + } + + public ICommand VolumeDownCommand + { + get { return new DelegateCommand(VolumeDownMethod, IsValid, this); } + } + public ICommand PlayListCommand + { + get { return new DelegateCommand(PlayListMethod, IsValid, this); } + } + + public ICommand FullScreenCommand + { + get { return new DelegateCommand(FullScreenMethod, IsValid, this); } + } + + public ICommand OnItemSelectedInPlayListCommand + { + get { return new DelegateCommand(ItemSelectedInPlayList, IsValid, this); } + } + public ICommand StopFileCommand + { + get { return new DelegateCommand(StopMediaFileMethod, IsValid, this); } + } + + public ICommand SavePlayListCommand + { + get { return new DelegateCommand(SavePlaylist, IsValid, this); } + } + + public ICommand MediaOpenedCommand + { + get { return new DelegateCommand(MediaOpenedMethod, IsValid, this); } + } + public ICommand OpenPlayListCommand + { + get { return new DelegateCommand(OpenPlayList, IsValid, this); } + } + public ICommand ChangeBackgroundCommand + { + get { return new DelegateCommand(ChangeBackground, IsValid, this); } + } + public ICommand MoveForwardFileCommand + { + get { return new DelegateCommand(MoveForwardMediaFileMethod, IsValid, this); } + } + public ICommand MoveBackwardFileCommand + { + get { return new DelegateCommand(MoveBackwardMediaFileMethod, IsValid, this); } + } + + + #endregion + #region Events + protected virtual void OnPropertyChanged(string propertyName) + { + // PropertyChangedEventHandler handler = PropertyChanged; + // if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); + if (PropertyChanged != null) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + protected virtual void OnPauseRequested() + { + if (PauseRequested != null) + { + this.PauseRequested(this, new EventArgs()); + } + } + protected virtual void OnPlayValueRequested() + { + if (PlayValueRequested != null) + { + this.PlayValueRequested(this, new EventArgs()); + } + } + + protected virtual void OnFullScreeEvent() + { + if (FullScreenEvent != null) + { + this.FullScreenEvent(this, new EventArgs()); + } + } + + protected virtual void OnChangeBackgroundEvent() + { + if (ChangeBackgroundEvent != null) + { + this.ChangeBackgroundEvent(this, new EventArgs()); + } + } + + protected virtual void OnVolumeUpEvent() + { + if (VolumeUpEvent != null) + { + this.VolumeUpEvent(this, new EventArgs()); + } + } + + protected virtual void OnSpeedRatioUpEvent() + { + if (SpeedRatioUpEvent != null) + { + this.SpeedRatioUpEvent(this, new EventArgs()); + } + } + protected virtual void OnSpeedRatioDownEvent() + { + if (SpeedRatioDownEvent != null) + { + this.SpeedRatioDownEvent(this, new EventArgs()); + } + } + + protected virtual void OnVolumeDownEvent() + { + if (VolumeDownEvent != null) + { + this.VolumeDownEvent(this, new EventArgs()); + } + } + protected virtual void OnMediaOpenedRequested() + { + if (MediaOpenedRequested != null) + { + this.MediaOpenedRequested(this, new EventArgs()); + } + } + protected virtual void OnStopRequested() + { + if (StopRequested != null) + { + this.StopRequested(this, new EventArgs()); + } + } + protected virtual void OnMoveForwardRequested() + { + if (MoveForwardRequested != null) + { + this.MoveForwardRequested(this, EventArgs.Empty); + } + } + protected virtual void OnMoveBackwardRequested() + { + if (MoveBackwardRequested != null) + { + this.MoveBackwardRequested(this, new EventArgs()); + } + } + + #endregion + + #region Methods + + private void VolumeUpMethod(object o) + { + OnVolumeUpEvent(); + } + + private void FullScreenMethod(object o) + { + OnFullScreeEvent(); + } + private void VolumeDownMethod(object o) + { + OnVolumeDownEvent(); + } + + private void SpeedRatioUpMethod(object o) + { + OnSpeedRatioUpEvent(); + } + private void SpeedRatioDownMethod(object o) + { + OnSpeedRatioDownEvent(); + } + private void MediaOpenedMethod(object obj) + { + MediaOpened = true; + } + private void SavePlaylist(object obj) + { + + XmlSerializer _xmlSerializer = new XmlSerializer(typeof(PlayListDirectory)); + SaveFileDialog _playListSaveDialog = new SaveFileDialog(); + _playListSaveDialog.Filter = "xml files(*.xml)|*.xml"; + _playListSaveDialog.Title = "Save PlayList"; + if (_playListSaveDialog.ShowDialog() == DialogResult.OK) + { + string filename = _playListSaveDialog.FileName; + using (TextWriter _textWriter = new StreamWriter(filename)) + { + PlayListDirectory playListDirectory = new PlayListDirectory(); + + List _mediaList = new List(); + foreach (Uri file in PlayListViewCollection) + { + PlayListClass temp = new PlayListClass(); + temp.FileName = file.ToString(); + temp.Filepath = playlistLookupDictionary[file.ToString()].ToString(); + _mediaList.Add(temp); + + } + playListDirectory.PlayListCollection = _mediaList; + _xmlSerializer.Serialize(_textWriter, playListDirectory); + } + } + + } + + private void OpenPlayList(object obj) + { + // playlistLookupDictionary.Clear(); + // playListViewCollection.Clear(); + XmlSerializer _xmlDeSerializer = new XmlSerializer(typeof(PlayListDirectory)); + OpenFileDialog _playListOpenFileDialog = new OpenFileDialog(); + _playListOpenFileDialog.Filter = "xml files(*.xml)|*.xml"; + _playListOpenFileDialog.Title = "Open PlayList"; + + if (_playListOpenFileDialog.ShowDialog() == DialogResult.OK) + { + string filename = _playListOpenFileDialog.FileName; + TextReader _textReader = new StreamReader(filename); + object xmlObject = _xmlDeSerializer.Deserialize(_textReader); + PlayListDirectory xmlDataCollection = (PlayListDirectory)xmlObject; + _textReader.Close(); + foreach (PlayListClass tempList in xmlDataCollection.PlayListCollection) + { + playlistLookupDictionary.Add(tempList.FileName, new Uri(tempList.Filepath, UriKind.Absolute)); + playListViewCollection.Add(new Uri(tempList.FileName, UriKind.Relative)); + MediaSource = new Uri(tempList.Filepath, UriKind.Absolute); + + } + } + } + + private void OpenFileMethod(object obj) + { + + OpenFileDialog dialog = new OpenFileDialog(); + dialog.Filter = "Audio Files (*.mp3,*.m4a,*.wav,*.aac)|*.mp3|Video Files(*.mp4,*.wmv,*.3gp,*.mkv)|*.mp4|All Files(*.*)|*.*"; + dialog.FilterIndex = 1; + dialog.Multiselect = true; + // MediaPlayerButtonObj = obj as MediaElement; + + DialogResult dialogResult = dialog.ShowDialog(); + if (dialogResult == DialogResult.OK) + { + foreach (var filesName in dialog.SafeFileNames) + { + if (playlistLookupDictionary.ContainsKey(filesName)) + { + + } + playlistLookupDictionary.Add(filesName, MediaSource); + PlayListViewCollection.Add(new Uri(filesName, UriKind.Relative)); + } + MediaSource = new Uri(dialog.FileName); + } + } + + + private void ChangeBackground(object obj) + { + OpenFileDialog _backgroundOpenFileDialog = new OpenFileDialog(); + _backgroundOpenFileDialog.Filter = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png"; + _backgroundOpenFileDialog.Title = "Choose Background"; + + DialogResult dialogResult = _backgroundOpenFileDialog.ShowDialog(); + if (dialogResult == DialogResult.OK) + { + //saves the background in the users settings + Properties.Settings.Default.backgroundImage = _backgroundOpenFileDialog.FileName; + Properties.Settings.Default.Save(); + ImageUri = _backgroundOpenFileDialog.FileName; + OnChangeBackgroundEvent(); + } + } + + private void ShowHidePlayListMethod(object obj) + { + System.Windows.Controls.ListBox _list = obj as System.Windows.Controls.ListBox; + if (ListVisibility == System.Windows.Visibility.Visible) + { + ListVisibility = System.Windows.Visibility.Collapsed; + } + else + { + ListVisibility = System.Windows.Visibility.Visible; + } + } + + private void StopMediaFileMethod(object Obj) + { + OnStopRequested(); + playValue = !playValue; + } + + + private void MoveForwardMediaFileMethod(object Obj) + { + OnMoveForwardRequested(); + } + + private void MoveBackwardMediaFileMethod(object obj) + { + OnMoveBackwardRequested(); + } + private void PlayListMethod(object obj) + { + OpenFileDialog dialog = new OpenFileDialog(); + dialog.Filter = + "Audio Files (*.mp3,*.m4a,*.wav,*.aac)|*.mp3|Video Files(*.mp4,*.wmv,*.3gp,*.mkv)|*.mp4|All Files(*.*)|*.*"; + dialog.FilterIndex = 1; + // MediaPlayerButtonObj = obj as MediaElement; + dialog.Title = "Add Media Files To PlayList"; + DialogResult dialogResult = dialog.ShowDialog(); + + if (dialogResult == DialogResult.OK) + { + int count_files = 0; + foreach (string file in dialog.FileNames) + { + MediaSource = new Uri(file); + playlistLookupDictionary.Add(dialog.SafeFileNames[count_files], MediaSource); + PlayListViewCollection.Add(new Uri(dialog.SafeFileNames[count_files], UriKind.Relative)); + count_files++; + } + } + } + + private void PlayMediaFileMethod(object obj) + { + + ToggleButton PlayFileButtonObj = obj as ToggleButton; + if (obj == null) + { + if (playValue) + { + OnPlayValueRequested(); + playValue = false; + } + else + { + OnPauseRequested(); + playValue = true; + } + } + else + { + if (PlayFileButtonObj.IsEnabled) + { + if (PlayFileButtonObj.IsChecked.Value) + { + OnPlayValueRequested(); + } + else + { + OnPauseRequested(); + } + } + } + } + + public void ItemSelectedInPlayList(object obj) + { + // TextBlock textBlockViewModelObj = obj as TextBlock; + + string sourceText = obj.ToString(); + + // MediaSource = playlistLookupDictionary[textBlockViewModelObj.Text]; + MediaSource = playlistLookupDictionary[sourceText]; + PlayRequested = true; + } + + private void AlbumsCreateMethod() + { + FolderBrowserDialog folderBrowserControl = new FolderBrowserDialog(); + DialogResult result = folderBrowserControl.ShowDialog(); + if (result == DialogResult.OK) + { + + } + } + + + private bool IsValid() + { + // if (obj == null) throw new ArgumentNullException("obj"); + return true; + } + + #endregion + + + + + } +} diff --git a/MediaPlayerWindow/MediaPlayerViewModel/MediaPlayerViewModel.csproj b/MediaPlayerWindow/MediaPlayerViewModel/MediaPlayerViewModel.csproj index 6541bd7..90707f2 100644 --- a/MediaPlayerWindow/MediaPlayerViewModel/MediaPlayerViewModel.csproj +++ b/MediaPlayerWindow/MediaPlayerViewModel/MediaPlayerViewModel.csproj @@ -1,95 +1,85 @@ - - - - - Debug - AnyCPU - {053F1A7F-1686-4D42-BEFD-E54722E1D572} - Library - Properties - MediaPlayerViewModel - MediaPlayerViewModel - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - True - True - Settings.settings - - - - - {968c2ccc-c711-46be-85a3-9a3369eff1c0} - MediaPlayerModels - - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - + + + + + Debug + AnyCPU + {053F1A7F-1686-4D42-BEFD-E54722E1D572} + Library + Properties + MediaPlayerViewModel + MediaPlayerViewModel + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Settings.settings + + + + + {968c2ccc-c711-46be-85a3-9a3369eff1c0} + MediaPlayerModels + + + + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + \ No newline at end of file diff --git a/MediaPlayerWindow/MediaPlayerViewModel/Properties/Annotations.cs b/MediaPlayerWindow/MediaPlayerViewModel/Properties/Annotations.cs index 937ef3a..d3ce527 100644 --- a/MediaPlayerWindow/MediaPlayerViewModel/Properties/Annotations.cs +++ b/MediaPlayerWindow/MediaPlayerViewModel/Properties/Annotations.cs @@ -1,614 +1,614 @@ -using System; - -#pragma warning disable 1591 -// ReSharper disable UnusedMember.Global -// ReSharper disable UnusedParameter.Local -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable IntroduceOptionalParameters.Global -// ReSharper disable MemberCanBeProtected.Global -// ReSharper disable InconsistentNaming - -namespace MediaPlayerViewModel.Annotations -{ - /// - /// Indicates that the value of the marked element could be null sometimes, - /// so the check for null is necessary before its usage - /// - /// - /// [CanBeNull] public object Test() { return null; } - /// public void UseTest() { - /// var p = Test(); - /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' - /// } - /// - [AttributeUsage( - AttributeTargets.Method | AttributeTargets.Parameter | - AttributeTargets.Property | AttributeTargets.Delegate | - AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class CanBeNullAttribute : Attribute { } - - /// - /// Indicates that the value of the marked element could never be null - /// - /// - /// [NotNull] public object Foo() { - /// return null; // Warning: Possible 'null' assignment - /// } - /// - [AttributeUsage( - AttributeTargets.Method | AttributeTargets.Parameter | - AttributeTargets.Property | AttributeTargets.Delegate | - AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class NotNullAttribute : Attribute { } - - /// - /// Indicates that the marked method builds string by format pattern and (optional) arguments. - /// Parameter, which contains format string, should be given in constructor. The format string - /// should be in -like form - /// - /// - /// [StringFormatMethod("message")] - /// public void ShowError(string message, params object[] args) { /* do something */ } - /// public void Foo() { - /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string - /// } - /// - [AttributeUsage( - AttributeTargets.Constructor | AttributeTargets.Method, - AllowMultiple = false, Inherited = true)] - public sealed class StringFormatMethodAttribute : Attribute - { - /// - /// Specifies which parameter of an annotated method should be treated as format-string - /// - public StringFormatMethodAttribute(string formatParameterName) - { - FormatParameterName = formatParameterName; - } - - public string FormatParameterName { get; private set; } - } - - /// - /// Indicates that the function argument should be string literal and match one - /// of the parameters of the caller function. For example, ReSharper annotates - /// the parameter of - /// - /// - /// public void Foo(string param) { - /// if (param == null) - /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol - /// } - /// - [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] - public sealed class InvokerParameterNameAttribute : Attribute { } - - /// - /// Indicates that the method is contained in a type that implements - /// interface - /// and this method is used to notify that some property value changed - /// - /// - /// The method should be non-static and conform to one of the supported signatures: - /// - /// NotifyChanged(string) - /// NotifyChanged(params string[]) - /// NotifyChanged{T}(Expression{Func{T}}) - /// NotifyChanged{T,U}(Expression{Func{T,U}}) - /// SetProperty{T}(ref T, T, string) - /// - /// - /// - /// public class Foo : INotifyPropertyChanged { - /// public event PropertyChangedEventHandler PropertyChanged; - /// [NotifyPropertyChangedInvocator] - /// protected virtual void NotifyChanged(string propertyName) { ... } - /// - /// private string _name; - /// public string Name { - /// get { return _name; } - /// set { _name = value; NotifyChanged("LastName"); /* Warning */ } - /// } - /// } - /// - /// Examples of generated notifications: - /// - /// NotifyChanged("Property") - /// NotifyChanged(() => Property) - /// NotifyChanged((VM x) => x.Property) - /// SetProperty(ref myField, value, "Property") - /// - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] - public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute - { - public NotifyPropertyChangedInvocatorAttribute() { } - public NotifyPropertyChangedInvocatorAttribute(string parameterName) - { - ParameterName = parameterName; - } - - public string ParameterName { get; private set; } - } - - /// - /// Describes dependency between method input and output - /// - /// - ///

Function Definition Table syntax:

- /// - /// FDT ::= FDTRow [;FDTRow]* - /// FDTRow ::= Input => Output | Output <= Input - /// Input ::= ParameterName: Value [, Input]* - /// Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} - /// Value ::= true | false | null | notnull | canbenull - /// - /// If method has single input parameter, it's name could be omitted.
- /// Using halt (or void/nothing, which is the same) - /// for method output means that the methos doesn't return normally.
- /// canbenull annotation is only applicable for output parameters.
- /// You can use multiple [ContractAnnotation] for each FDT row, - /// or use single attribute with rows separated by semicolon.
- ///
- /// - /// - /// [ContractAnnotation("=> halt")] - /// public void TerminationMethod() - /// - /// - /// [ContractAnnotation("halt <= condition: false")] - /// public void Assert(bool condition, string text) // regular assertion method - /// - /// - /// [ContractAnnotation("s:null => true")] - /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty() - /// - /// - /// // A method that returns null if the parameter is null, and not null if the parameter is not null - /// [ContractAnnotation("null => null; notnull => notnull")] - /// public object Transform(object data) - /// - /// - /// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")] - /// public bool TryParse(string s, out Person result) - /// - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)] - public sealed class ContractAnnotationAttribute : Attribute - { - public ContractAnnotationAttribute([NotNull] string contract) - : this(contract, false) { } - - public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates) - { - Contract = contract; - ForceFullStates = forceFullStates; - } - - public string Contract { get; private set; } - public bool ForceFullStates { get; private set; } - } - - /// - /// Indicates that marked element should be localized or not - /// - /// - /// [LocalizationRequiredAttribute(true)] - /// public class Foo { - /// private string str = "my string"; // Warning: Localizable string - /// } - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] - public sealed class LocalizationRequiredAttribute : Attribute - { - public LocalizationRequiredAttribute() : this(true) { } - public LocalizationRequiredAttribute(bool required) - { - Required = required; - } - - public bool Required { get; private set; } - } - - /// - /// Indicates that the value of the marked type (or its derivatives) - /// cannot be compared using '==' or '!=' operators and Equals() - /// should be used instead. However, using '==' or '!=' for comparison - /// with null is always permitted. - /// - /// - /// [CannotApplyEqualityOperator] - /// class NoEquality { } - /// class UsesNoEquality { - /// public void Test() { - /// var ca1 = new NoEquality(); - /// var ca2 = new NoEquality(); - /// if (ca1 != null) { // OK - /// bool condition = ca1 == ca2; // Warning - /// } - /// } - /// } - /// - [AttributeUsage( - AttributeTargets.Interface | AttributeTargets.Class | - AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] - public sealed class CannotApplyEqualityOperatorAttribute : Attribute { } - - /// - /// When applied to a target attribute, specifies a requirement for any type marked - /// with the target attribute to implement or inherit specific type or types. - /// - /// - /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement - /// public class ComponentAttribute : Attribute { } - /// [Component] // ComponentAttribute requires implementing IComponent interface - /// public class MyComponent : IComponent { } - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] - [BaseTypeRequired(typeof(Attribute))] - public sealed class BaseTypeRequiredAttribute : Attribute - { - public BaseTypeRequiredAttribute([NotNull] Type baseType) - { - BaseType = baseType; - } - - [NotNull] public Type BaseType { get; private set; } - } - - /// - /// Indicates that the marked symbol is used implicitly - /// (e.g. via reflection, in external library), so this symbol - /// will not be marked as unused (as well as by other usage inspections) - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] - public sealed class UsedImplicitlyAttribute : Attribute - { - public UsedImplicitlyAttribute() - : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } - - public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags) - : this(useKindFlags, ImplicitUseTargetFlags.Default) { } - - public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags) - : this(ImplicitUseKindFlags.Default, targetFlags) { } - - public UsedImplicitlyAttribute( - ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) - { - UseKindFlags = useKindFlags; - TargetFlags = targetFlags; - } - - public ImplicitUseKindFlags UseKindFlags { get; private set; } - public ImplicitUseTargetFlags TargetFlags { get; private set; } - } - - /// - /// Should be used on attributes and causes ReSharper - /// to not mark symbols marked with such attributes as unused - /// (as well as by other usage inspections) - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] - public sealed class MeansImplicitUseAttribute : Attribute - { - public MeansImplicitUseAttribute() - : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } - - public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags) - : this(useKindFlags, ImplicitUseTargetFlags.Default) { } - - public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags) - : this(ImplicitUseKindFlags.Default, targetFlags) { } - - public MeansImplicitUseAttribute( - ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) - { - UseKindFlags = useKindFlags; - TargetFlags = targetFlags; - } - - [UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; } - [UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; } - } - - [Flags] - public enum ImplicitUseKindFlags - { - Default = Access | Assign | InstantiatedWithFixedConstructorSignature, - /// Only entity marked with attribute considered used - Access = 1, - /// Indicates implicit assignment to a member - Assign = 2, - /// - /// Indicates implicit instantiation of a type with fixed constructor signature. - /// That means any unused constructor parameters won't be reported as such. - /// - InstantiatedWithFixedConstructorSignature = 4, - /// Indicates implicit instantiation of a type - InstantiatedNoFixedConstructorSignature = 8, - } - - /// - /// Specify what is considered used implicitly - /// when marked with - /// or - /// - [Flags] - public enum ImplicitUseTargetFlags - { - Default = Itself, - Itself = 1, - /// Members of entity marked with attribute are considered used - Members = 2, - /// Entity marked with attribute and all its members considered used - WithMembers = Itself | Members - } - - /// - /// This attribute is intended to mark publicly available API - /// which should not be removed and so is treated as used - /// - [MeansImplicitUse] - public sealed class PublicAPIAttribute : Attribute - { - public PublicAPIAttribute() { } - public PublicAPIAttribute([NotNull] string comment) - { - Comment = comment; - } - - [NotNull] public string Comment { get; private set; } - } - - /// - /// Tells code analysis engine if the parameter is completely handled - /// when the invoked method is on stack. If the parameter is a delegate, - /// indicates that delegate is executed while the method is executed. - /// If the parameter is an enumerable, indicates that it is enumerated - /// while the method is executed - /// - [AttributeUsage(AttributeTargets.Parameter, Inherited = true)] - public sealed class InstantHandleAttribute : Attribute { } - - /// - /// Indicates that a method does not make any observable state changes. - /// The same as System.Diagnostics.Contracts.PureAttribute - /// - /// - /// [Pure] private int Multiply(int x, int y) { return x * y; } - /// public void Foo() { - /// const int a = 2, b = 2; - /// Multiply(a, b); // Waring: Return value of pure method is not used - /// } - /// - [AttributeUsage(AttributeTargets.Method, Inherited = true)] - public sealed class PureAttribute : Attribute { } - - /// - /// Indicates that a parameter is a path to a file or a folder - /// within a web project. Path can be relative or absolute, - /// starting from web root (~) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public class PathReferenceAttribute : Attribute - { - public PathReferenceAttribute() { } - public PathReferenceAttribute([PathReference] string basePath) - { - BasePath = basePath; - } - - [NotNull] public string BasePath { get; private set; } - } - - // ASP.NET MVC attributes - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute - { - public AspMvcAreaMasterLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute - { - public AspMvcAreaPartialViewLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute - { - public AspMvcAreaViewLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcMasterLocationFormatAttribute : Attribute - { - public AspMvcMasterLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute - { - public AspMvcPartialViewLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcViewLocationFormatAttribute : Attribute - { - public AspMvcViewLocationFormatAttribute(string format) { } - } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter - /// is an MVC action. If applied to a method, the MVC action name is calculated - /// implicitly from the context. Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcActionAttribute : Attribute - { - public AspMvcActionAttribute() { } - public AspMvcActionAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [NotNull] public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcAreaAttribute : PathReferenceAttribute - { - public AspMvcAreaAttribute() { } - public AspMvcAreaAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [NotNull] public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that - /// the parameter is an MVC controller. If applied to a method, - /// the MVC controller name is calculated implicitly from the context. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcControllerAttribute : Attribute - { - public AspMvcControllerAttribute() { } - public AspMvcControllerAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [NotNull] public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Controller.View(String, String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcMasterAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Controller.View(String, Object) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcModelTypeAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that - /// the parameter is an MVC partial view. If applied to a method, - /// the MVC partial view name is calculated implicitly from the context. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcPartialViewAttribute : PathReferenceAttribute { } - - /// - /// ASP.NET MVC attribute. Allows disabling all inspections - /// for MVC views within a class or a method. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] - public sealed class AspMvcSupressViewErrorAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcDisplayTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcEditorTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template. - /// Use this attribute for custom wrappers similar to - /// System.ComponentModel.DataAnnotations.UIHintAttribute(System.String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter - /// is an MVC view. If applied to a method, the MVC view name is calculated implicitly - /// from the context. Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Controller.View(Object) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcViewAttribute : PathReferenceAttribute { } - - /// - /// ASP.NET MVC attribute. When applied to a parameter of an attribute, - /// indicates that this parameter is an MVC action name - /// - /// - /// [ActionName("Foo")] - /// public ActionResult Login(string returnUrl) { - /// ViewBag.ReturnUrl = Url.Action("Foo"); // OK - /// return RedirectToAction("Bar"); // Error: Cannot resolve action - /// } - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] - public sealed class AspMvcActionSelectorAttribute : Attribute { } - - [AttributeUsage( - AttributeTargets.Parameter | AttributeTargets.Property | - AttributeTargets.Field, Inherited = true)] - public sealed class HtmlElementAttributesAttribute : Attribute - { - public HtmlElementAttributesAttribute() { } - public HtmlElementAttributesAttribute([NotNull] string name) - { - Name = name; - } - - [NotNull] public string Name { get; private set; } - } - - [AttributeUsage( - AttributeTargets.Parameter | AttributeTargets.Field | - AttributeTargets.Property, Inherited = true)] - public sealed class HtmlAttributeValueAttribute : Attribute - { - public HtmlAttributeValueAttribute([NotNull] string name) - { - Name = name; - } - - [NotNull] public string Name { get; private set; } - } - - // Razor attributes - - /// - /// Razor attribute. Indicates that a parameter or a method is a Razor section. - /// Use this attribute for custom wrappers similar to - /// System.Web.WebPages.WebPageBase.RenderSection(String) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, Inherited = true)] - public sealed class RazorSectionAttribute : Attribute { } +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable UnusedParameter.Local +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming + +namespace MediaPlayerViewModel.Annotations +{ + /// + /// Indicates that the value of the marked element could be null sometimes, + /// so the check for null is necessary before its usage + /// + /// + /// [CanBeNull] public object Test() { return null; } + /// public void UseTest() { + /// var p = Test(); + /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' + /// } + /// + [AttributeUsage( + AttributeTargets.Method | AttributeTargets.Parameter | + AttributeTargets.Property | AttributeTargets.Delegate | + AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public sealed class CanBeNullAttribute : Attribute { } + + /// + /// Indicates that the value of the marked element could never be null + /// + /// + /// [NotNull] public object Foo() { + /// return null; // Warning: Possible 'null' assignment + /// } + /// + [AttributeUsage( + AttributeTargets.Method | AttributeTargets.Parameter | + AttributeTargets.Property | AttributeTargets.Delegate | + AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + public sealed class NotNullAttribute : Attribute { } + + /// + /// Indicates that the marked method builds string by format pattern and (optional) arguments. + /// Parameter, which contains format string, should be given in constructor. The format string + /// should be in -like form + /// + /// + /// [StringFormatMethod("message")] + /// public void ShowError(string message, params object[] args) { /* do something */ } + /// public void Foo() { + /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string + /// } + /// + [AttributeUsage( + AttributeTargets.Constructor | AttributeTargets.Method, + AllowMultiple = false, Inherited = true)] + public sealed class StringFormatMethodAttribute : Attribute + { + /// + /// Specifies which parameter of an annotated method should be treated as format-string + /// + public StringFormatMethodAttribute(string formatParameterName) + { + FormatParameterName = formatParameterName; + } + + public string FormatParameterName { get; private set; } + } + + /// + /// Indicates that the function argument should be string literal and match one + /// of the parameters of the caller function. For example, ReSharper annotates + /// the parameter of + /// + /// + /// public void Foo(string param) { + /// if (param == null) + /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol + /// } + /// + [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] + public sealed class InvokerParameterNameAttribute : Attribute { } + + /// + /// Indicates that the method is contained in a type that implements + /// interface + /// and this method is used to notify that some property value changed + /// + /// + /// The method should be non-static and conform to one of the supported signatures: + /// + /// NotifyChanged(string) + /// NotifyChanged(params string[]) + /// NotifyChanged{T}(Expression{Func{T}}) + /// NotifyChanged{T,U}(Expression{Func{T,U}}) + /// SetProperty{T}(ref T, T, string) + /// + /// + /// + /// public class Foo : INotifyPropertyChanged { + /// public event PropertyChangedEventHandler PropertyChanged; + /// [NotifyPropertyChangedInvocator] + /// protected virtual void NotifyChanged(string propertyName) { ... } + /// + /// private string _name; + /// public string Name { + /// get { return _name; } + /// set { _name = value; NotifyChanged("LastName"); /* Warning */ } + /// } + /// } + /// + /// Examples of generated notifications: + /// + /// NotifyChanged("Property") + /// NotifyChanged(() => Property) + /// NotifyChanged((VM x) => x.Property) + /// SetProperty(ref myField, value, "Property") + /// + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute + { + public NotifyPropertyChangedInvocatorAttribute() { } + public NotifyPropertyChangedInvocatorAttribute(string parameterName) + { + ParameterName = parameterName; + } + + public string ParameterName { get; private set; } + } + + /// + /// Describes dependency between method input and output + /// + /// + ///

Function Definition Table syntax:

+ /// + /// FDT ::= FDTRow [;FDTRow]* + /// FDTRow ::= Input => Output | Output <= Input + /// Input ::= ParameterName: Value [, Input]* + /// Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} + /// Value ::= true | false | null | notnull | canbenull + /// + /// If method has single input parameter, it's name could be omitted.
+ /// Using halt (or void/nothing, which is the same) + /// for method output means that the methos doesn't return normally.
+ /// canbenull annotation is only applicable for output parameters.
+ /// You can use multiple [ContractAnnotation] for each FDT row, + /// or use single attribute with rows separated by semicolon.
+ ///
+ /// + /// + /// [ContractAnnotation("=> halt")] + /// public void TerminationMethod() + /// + /// + /// [ContractAnnotation("halt <= condition: false")] + /// public void Assert(bool condition, string text) // regular assertion method + /// + /// + /// [ContractAnnotation("s:null => true")] + /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty() + /// + /// + /// // A method that returns null if the parameter is null, and not null if the parameter is not null + /// [ContractAnnotation("null => null; notnull => notnull")] + /// public object Transform(object data) + /// + /// + /// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")] + /// public bool TryParse(string s, out Person result) + /// + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)] + public sealed class ContractAnnotationAttribute : Attribute + { + public ContractAnnotationAttribute([NotNull] string contract) + : this(contract, false) { } + + public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates) + { + Contract = contract; + ForceFullStates = forceFullStates; + } + + public string Contract { get; private set; } + public bool ForceFullStates { get; private set; } + } + + /// + /// Indicates that marked element should be localized or not + /// + /// + /// [LocalizationRequiredAttribute(true)] + /// public class Foo { + /// private string str = "my string"; // Warning: Localizable string + /// } + /// + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] + public sealed class LocalizationRequiredAttribute : Attribute + { + public LocalizationRequiredAttribute() : this(true) { } + public LocalizationRequiredAttribute(bool required) + { + Required = required; + } + + public bool Required { get; private set; } + } + + /// + /// Indicates that the value of the marked type (or its derivatives) + /// cannot be compared using '==' or '!=' operators and Equals() + /// should be used instead. However, using '==' or '!=' for comparison + /// with null is always permitted. + /// + /// + /// [CannotApplyEqualityOperator] + /// class NoEquality { } + /// class UsesNoEquality { + /// public void Test() { + /// var ca1 = new NoEquality(); + /// var ca2 = new NoEquality(); + /// if (ca1 != null) { // OK + /// bool condition = ca1 == ca2; // Warning + /// } + /// } + /// } + /// + [AttributeUsage( + AttributeTargets.Interface | AttributeTargets.Class | + AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] + public sealed class CannotApplyEqualityOperatorAttribute : Attribute { } + + /// + /// When applied to a target attribute, specifies a requirement for any type marked + /// with the target attribute to implement or inherit specific type or types. + /// + /// + /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement + /// public class ComponentAttribute : Attribute { } + /// [Component] // ComponentAttribute requires implementing IComponent interface + /// public class MyComponent : IComponent { } + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] + [BaseTypeRequired(typeof(Attribute))] + public sealed class BaseTypeRequiredAttribute : Attribute + { + public BaseTypeRequiredAttribute([NotNull] Type baseType) + { + BaseType = baseType; + } + + [NotNull] public Type BaseType { get; private set; } + } + + /// + /// Indicates that the marked symbol is used implicitly + /// (e.g. via reflection, in external library), so this symbol + /// will not be marked as unused (as well as by other usage inspections) + /// + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] + public sealed class UsedImplicitlyAttribute : Attribute + { + public UsedImplicitlyAttribute() + : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } + + public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags) + : this(useKindFlags, ImplicitUseTargetFlags.Default) { } + + public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags) + : this(ImplicitUseKindFlags.Default, targetFlags) { } + + public UsedImplicitlyAttribute( + ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + { + UseKindFlags = useKindFlags; + TargetFlags = targetFlags; + } + + public ImplicitUseKindFlags UseKindFlags { get; private set; } + public ImplicitUseTargetFlags TargetFlags { get; private set; } + } + + /// + /// Should be used on attributes and causes ReSharper + /// to not mark symbols marked with such attributes as unused + /// (as well as by other usage inspections) + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] + public sealed class MeansImplicitUseAttribute : Attribute + { + public MeansImplicitUseAttribute() + : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } + + public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags) + : this(useKindFlags, ImplicitUseTargetFlags.Default) { } + + public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags) + : this(ImplicitUseKindFlags.Default, targetFlags) { } + + public MeansImplicitUseAttribute( + ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + { + UseKindFlags = useKindFlags; + TargetFlags = targetFlags; + } + + [UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; } + [UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; } + } + + [Flags] + public enum ImplicitUseKindFlags + { + Default = Access | Assign | InstantiatedWithFixedConstructorSignature, + /// Only entity marked with attribute considered used + Access = 1, + /// Indicates implicit assignment to a member + Assign = 2, + /// + /// Indicates implicit instantiation of a type with fixed constructor signature. + /// That means any unused constructor parameters won't be reported as such. + /// + InstantiatedWithFixedConstructorSignature = 4, + /// Indicates implicit instantiation of a type + InstantiatedNoFixedConstructorSignature = 8, + } + + /// + /// Specify what is considered used implicitly + /// when marked with + /// or + /// + [Flags] + public enum ImplicitUseTargetFlags + { + Default = Itself, + Itself = 1, + /// Members of entity marked with attribute are considered used + Members = 2, + /// Entity marked with attribute and all its members considered used + WithMembers = Itself | Members + } + + /// + /// This attribute is intended to mark publicly available API + /// which should not be removed and so is treated as used + /// + [MeansImplicitUse] + public sealed class PublicAPIAttribute : Attribute + { + public PublicAPIAttribute() { } + public PublicAPIAttribute([NotNull] string comment) + { + Comment = comment; + } + + [NotNull] public string Comment { get; private set; } + } + + /// + /// Tells code analysis engine if the parameter is completely handled + /// when the invoked method is on stack. If the parameter is a delegate, + /// indicates that delegate is executed while the method is executed. + /// If the parameter is an enumerable, indicates that it is enumerated + /// while the method is executed + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = true)] + public sealed class InstantHandleAttribute : Attribute { } + + /// + /// Indicates that a method does not make any observable state changes. + /// The same as System.Diagnostics.Contracts.PureAttribute + /// + /// + /// [Pure] private int Multiply(int x, int y) { return x * y; } + /// public void Foo() { + /// const int a = 2, b = 2; + /// Multiply(a, b); // Waring: Return value of pure method is not used + /// } + /// + [AttributeUsage(AttributeTargets.Method, Inherited = true)] + public sealed class PureAttribute : Attribute { } + + /// + /// Indicates that a parameter is a path to a file or a folder + /// within a web project. Path can be relative or absolute, + /// starting from web root (~) + /// + [AttributeUsage(AttributeTargets.Parameter)] + public class PathReferenceAttribute : Attribute + { + public PathReferenceAttribute() { } + public PathReferenceAttribute([PathReference] string basePath) + { + BasePath = basePath; + } + + [NotNull] public string BasePath { get; private set; } + } + + // ASP.NET MVC attributes + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute + { + public AspMvcAreaMasterLocationFormatAttribute(string format) { } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute + { + public AspMvcAreaPartialViewLocationFormatAttribute(string format) { } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute + { + public AspMvcAreaViewLocationFormatAttribute(string format) { } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcMasterLocationFormatAttribute : Attribute + { + public AspMvcMasterLocationFormatAttribute(string format) { } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute + { + public AspMvcPartialViewLocationFormatAttribute(string format) { } + } + + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public sealed class AspMvcViewLocationFormatAttribute : Attribute + { + public AspMvcViewLocationFormatAttribute(string format) { } + } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter + /// is an MVC action. If applied to a method, the MVC action name is calculated + /// implicitly from the context. Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String) + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcActionAttribute : Attribute + { + public AspMvcActionAttribute() { } + public AspMvcActionAttribute([NotNull] string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + + [NotNull] public string AnonymousProperty { get; private set; } + } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String) + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcAreaAttribute : PathReferenceAttribute + { + public AspMvcAreaAttribute() { } + public AspMvcAreaAttribute([NotNull] string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + + [NotNull] public string AnonymousProperty { get; private set; } + } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that + /// the parameter is an MVC controller. If applied to a method, + /// the MVC controller name is calculated implicitly from the context. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String) + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcControllerAttribute : Attribute + { + public AspMvcControllerAttribute() { } + public AspMvcControllerAttribute([NotNull] string anonymousProperty) + { + AnonymousProperty = anonymousProperty; + } + + [NotNull] public string AnonymousProperty { get; private set; } + } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Controller.View(String, String) + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcMasterAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Controller.View(String, Object) + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcModelTypeAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that + /// the parameter is an MVC partial view. If applied to a method, + /// the MVC partial view name is calculated implicitly from the context. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String) + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcPartialViewAttribute : PathReferenceAttribute { } + + /// + /// ASP.NET MVC attribute. Allows disabling all inspections + /// for MVC views within a class or a method. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] + public sealed class AspMvcSupressViewErrorAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String) + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcDisplayTemplateAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. + /// Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String) + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcEditorTemplateAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template. + /// Use this attribute for custom wrappers similar to + /// System.ComponentModel.DataAnnotations.UIHintAttribute(System.String) + /// + [AttributeUsage(AttributeTargets.Parameter)] + public sealed class AspMvcTemplateAttribute : Attribute { } + + /// + /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter + /// is an MVC view. If applied to a method, the MVC view name is calculated implicitly + /// from the context. Use this attribute for custom wrappers similar to + /// System.Web.Mvc.Controller.View(Object) + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] + public sealed class AspMvcViewAttribute : PathReferenceAttribute { } + + /// + /// ASP.NET MVC attribute. When applied to a parameter of an attribute, + /// indicates that this parameter is an MVC action name + /// + /// + /// [ActionName("Foo")] + /// public ActionResult Login(string returnUrl) { + /// ViewBag.ReturnUrl = Url.Action("Foo"); // OK + /// return RedirectToAction("Bar"); // Error: Cannot resolve action + /// } + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] + public sealed class AspMvcActionSelectorAttribute : Attribute { } + + [AttributeUsage( + AttributeTargets.Parameter | AttributeTargets.Property | + AttributeTargets.Field, Inherited = true)] + public sealed class HtmlElementAttributesAttribute : Attribute + { + public HtmlElementAttributesAttribute() { } + public HtmlElementAttributesAttribute([NotNull] string name) + { + Name = name; + } + + [NotNull] public string Name { get; private set; } + } + + [AttributeUsage( + AttributeTargets.Parameter | AttributeTargets.Field | + AttributeTargets.Property, Inherited = true)] + public sealed class HtmlAttributeValueAttribute : Attribute + { + public HtmlAttributeValueAttribute([NotNull] string name) + { + Name = name; + } + + [NotNull] public string Name { get; private set; } + } + + // Razor attributes + + /// + /// Razor attribute. Indicates that a parameter or a method is a Razor section. + /// Use this attribute for custom wrappers similar to + /// System.Web.WebPages.WebPageBase.RenderSection(String) + /// + [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, Inherited = true)] + public sealed class RazorSectionAttribute : Attribute { } } \ No newline at end of file diff --git a/MediaPlayerWindow/MediaPlayerViewModel/Properties/AssemblyInfo.cs b/MediaPlayerWindow/MediaPlayerViewModel/Properties/AssemblyInfo.cs index f5076d9..fc6ccd3 100644 --- a/MediaPlayerWindow/MediaPlayerViewModel/Properties/AssemblyInfo.cs +++ b/MediaPlayerWindow/MediaPlayerViewModel/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MediaPlayerViewModel")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MediaPlayerViewModel")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d360f86b-ccb3-4f02-8e8e-1087e39ad14c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MediaPlayerViewModel")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MediaPlayerViewModel")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d360f86b-ccb3-4f02-8e8e-1087e39ad14c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MediaPlayerWindow/MediaPlayerViewModel/Properties/Settings.Designer.cs b/MediaPlayerWindow/MediaPlayerViewModel/Properties/Settings.Designer.cs new file mode 100644 index 0000000..407ccd9 --- /dev/null +++ b/MediaPlayerWindow/MediaPlayerViewModel/Properties/Settings.Designer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MediaPlayerViewModel.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("${Solution}\\Resources\\backgroundImage.png")] + public string backgroundImage { + get { + return ((string)(this["backgroundImage"])); + } + set { + this["backgroundImage"] = value; + } + } + } +} diff --git a/MediaPlayerWindow/MediaPlayerViewModel/Properties/Settings.settings b/MediaPlayerWindow/MediaPlayerViewModel/Properties/Settings.settings new file mode 100644 index 0000000..cf52931 --- /dev/null +++ b/MediaPlayerWindow/MediaPlayerViewModel/Properties/Settings.settings @@ -0,0 +1,9 @@ + + + + + + ${Solution}\Resources\backgroundImage.png + + + \ No newline at end of file diff --git a/MediaPlayerWindow/MediaPlayerViewModel/app.config b/MediaPlayerWindow/MediaPlayerViewModel/app.config new file mode 100644 index 0000000..e5bb2d9 --- /dev/null +++ b/MediaPlayerWindow/MediaPlayerViewModel/app.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + ${Solution}\Resources\backgroundImage.png + + + + \ No newline at end of file diff --git a/MediaPlayerWindow/MediaPlayerViewModel/bin/Debug/MediaPlayerModels.pdb b/MediaPlayerWindow/MediaPlayerViewModel/bin/Debug/MediaPlayerModels.pdb deleted file mode 100644 index 5f5978e..0000000 Binary files a/MediaPlayerWindow/MediaPlayerViewModel/bin/Debug/MediaPlayerModels.pdb and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerViewModel/bin/Debug/MediaPlayerViewModel.pdb b/MediaPlayerWindow/MediaPlayerViewModel/bin/Debug/MediaPlayerViewModel.pdb deleted file mode 100644 index 0d00213..0000000 Binary files a/MediaPlayerWindow/MediaPlayerViewModel/bin/Debug/MediaPlayerViewModel.pdb and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index e79c8a8..0000000 Binary files a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.csproj.FileListAbsolute.txt b/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.csproj.FileListAbsolute.txt deleted file mode 100644 index 24d28cc..0000000 --- a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,7 +0,0 @@ -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerViewModel\bin\Debug\MediaPlayerViewModel.dll -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerViewModel\bin\Debug\MediaPlayerViewModel.pdb -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerViewModel\obj\Debug\MediaPlayerViewModel.dll -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerViewModel\obj\Debug\MediaPlayerViewModel.pdb -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerViewModel\obj\Debug\MediaPlayerViewModel.csprojResolveAssemblyReference.cache -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerViewModel\bin\Debug\MediaPlayerModels.dll -C:\Users\310247467\Documents\Visual Studio 2013\Projects\MediaPlayerWindow\MediaPlayerViewModel\bin\Debug\MediaPlayerModels.pdb diff --git a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.csprojResolveAssemblyReference.cache b/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.csprojResolveAssemblyReference.cache deleted file mode 100644 index 34cce52..0000000 Binary files a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.csprojResolveAssemblyReference.cache and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.pdb b/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.pdb deleted file mode 100644 index 0d00213..0000000 Binary files a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/MediaPlayerViewModel.pdb and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs deleted file mode 100644 index e69de29..0000000 diff --git a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/MediaPlayerWindow/MediaPlayerViewModel/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs deleted file mode 100644 index e69de29..0000000 diff --git a/MediaPlayerWindow/MediaPlayerWindow.sln b/MediaPlayerWindow/MediaPlayerWindow.sln index 9d0d6bd..51bb049 100644 --- a/MediaPlayerWindow/MediaPlayerWindow.sln +++ b/MediaPlayerWindow/MediaPlayerWindow.sln @@ -1,34 +1,34 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaPlayerWindow", "MediaPlayerWindow\MediaPlayerWindow.csproj", "{167A3561-E07A-478F-84B8-797D5591FBA3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaPlayerViewModel", "MediaPlayerViewModel\MediaPlayerViewModel.csproj", "{053F1A7F-1686-4D42-BEFD-E54722E1D572}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaPlayerModels", "MediaPlayerModels\MediaPlayerModels.csproj", "{968C2CCC-C711-46BE-85A3-9A3369EFF1C0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {167A3561-E07A-478F-84B8-797D5591FBA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {167A3561-E07A-478F-84B8-797D5591FBA3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {167A3561-E07A-478F-84B8-797D5591FBA3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {167A3561-E07A-478F-84B8-797D5591FBA3}.Release|Any CPU.Build.0 = Release|Any CPU - {053F1A7F-1686-4D42-BEFD-E54722E1D572}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {053F1A7F-1686-4D42-BEFD-E54722E1D572}.Debug|Any CPU.Build.0 = Debug|Any CPU - {053F1A7F-1686-4D42-BEFD-E54722E1D572}.Release|Any CPU.ActiveCfg = Release|Any CPU - {053F1A7F-1686-4D42-BEFD-E54722E1D572}.Release|Any CPU.Build.0 = Release|Any CPU - {968C2CCC-C711-46BE-85A3-9A3369EFF1C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {968C2CCC-C711-46BE-85A3-9A3369EFF1C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {968C2CCC-C711-46BE-85A3-9A3369EFF1C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {968C2CCC-C711-46BE-85A3-9A3369EFF1C0}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaPlayerWindow", "MediaPlayerWindow\MediaPlayerWindow.csproj", "{167A3561-E07A-478F-84B8-797D5591FBA3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaPlayerViewModel", "MediaPlayerViewModel\MediaPlayerViewModel.csproj", "{053F1A7F-1686-4D42-BEFD-E54722E1D572}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaPlayerModels", "MediaPlayerModels\MediaPlayerModels.csproj", "{968C2CCC-C711-46BE-85A3-9A3369EFF1C0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {167A3561-E07A-478F-84B8-797D5591FBA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {167A3561-E07A-478F-84B8-797D5591FBA3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {167A3561-E07A-478F-84B8-797D5591FBA3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {167A3561-E07A-478F-84B8-797D5591FBA3}.Release|Any CPU.Build.0 = Release|Any CPU + {053F1A7F-1686-4D42-BEFD-E54722E1D572}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {053F1A7F-1686-4D42-BEFD-E54722E1D572}.Debug|Any CPU.Build.0 = Debug|Any CPU + {053F1A7F-1686-4D42-BEFD-E54722E1D572}.Release|Any CPU.ActiveCfg = Release|Any CPU + {053F1A7F-1686-4D42-BEFD-E54722E1D572}.Release|Any CPU.Build.0 = Release|Any CPU + {968C2CCC-C711-46BE-85A3-9A3369EFF1C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {968C2CCC-C711-46BE-85A3-9A3369EFF1C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {968C2CCC-C711-46BE-85A3-9A3369EFF1C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {968C2CCC-C711-46BE-85A3-9A3369EFF1C0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/MediaPlayerWindow/MediaPlayerWindow.v12.suo b/MediaPlayerWindow/MediaPlayerWindow.v12.suo deleted file mode 100644 index 6577cd3..0000000 Binary files a/MediaPlayerWindow/MediaPlayerWindow.v12.suo and /dev/null differ diff --git a/MediaPlayerWindow/MediaPlayerWindow/Albums.xaml b/MediaPlayerWindow/MediaPlayerWindow/Albums.xaml index 3e4af42..2c6082d 100644 --- a/MediaPlayerWindow/MediaPlayerWindow/Albums.xaml +++ b/MediaPlayerWindow/MediaPlayerWindow/Albums.xaml @@ -1,9 +1,9 @@ - - - - - - + + + + + + diff --git a/MediaPlayerWindow/MediaPlayerWindow/Albums.xaml.cs b/MediaPlayerWindow/MediaPlayerWindow/Albums.xaml.cs index 4f0c5b1..8b376cf 100644 --- a/MediaPlayerWindow/MediaPlayerWindow/Albums.xaml.cs +++ b/MediaPlayerWindow/MediaPlayerWindow/Albums.xaml.cs @@ -1,27 +1,27 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace MediaPlayerWindow -{ - /// - /// Interaction logic for Albums.xaml - /// - public partial class Albums : Window - { - public Albums() - { - InitializeComponent(); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace MediaPlayerWindow +{ + /// + /// Interaction logic for Albums.xaml + /// + public partial class Albums : Window + { + public Albums() + { + InitializeComponent(); + } + } +} diff --git a/MediaPlayerWindow/MediaPlayerWindow/App.config b/MediaPlayerWindow/MediaPlayerWindow/App.config index fad249e..8e15646 100644 --- a/MediaPlayerWindow/MediaPlayerWindow/App.config +++ b/MediaPlayerWindow/MediaPlayerWindow/App.config @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/MediaPlayerWindow/MediaPlayerWindow/App.xaml b/MediaPlayerWindow/MediaPlayerWindow/App.xaml index bfb8fe8..523eead 100644 --- a/MediaPlayerWindow/MediaPlayerWindow/App.xaml +++ b/MediaPlayerWindow/MediaPlayerWindow/App.xaml @@ -1,12 +1,13 @@ - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +