consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

View File

@@ -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

View File

@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp", "MyApp\MyApp.csproj", "{2369758D-3F33-42D7-9BC4-A533BEA699F3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2369758D-3F33-42D7-9BC4-A533BEA699F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2369758D-3F33-42D7-9BC4-A533BEA699F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2369758D-3F33-42D7-9BC4-A533BEA699F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2369758D-3F33-42D7-9BC4-A533BEA699F3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {68710C64-2333-46BE-BCE3-8C5BF65066F9}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,17 @@
<Application x:Class="MyApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MyApp"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resorce/ButtonDictionary.xaml"/>
<ResourceDictionary Source="Resorce/ImageDictionary.xaml"/>
<ResourceDictionary Source="Resorce/ListDictionary.xaml"/>
<ResourceDictionary Source="Resorce/WindowDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace MyApp
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View File

@@ -0,0 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

View File

@@ -0,0 +1,36 @@
<Window x:Class="MyApp.EditWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MyApp"
mc:Ignorable="d"
Title="EditWindow" Height="450" Width="400">
<Grid Margin="10">
<StackPanel>
<Label Content="Ime datoteke:"/>
<TextBox Text="{Binding Path=Name, Mode=TwoWay}"/>
<Label Content="Zvrsti:"/>
<ComboBox
Name="comboBox"
SelectionChanged="comboBox_SelectionChanged"
Text="Haha"
SelectedValue="{Binding Path=Genra}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Image Name="MovieIcon" Source="{Binding Path=IconSource}" Style="{StaticResource BigImage}"/>
<Button Click="Image_Button_Click" Content="Change Imgae"/>
<Label Content="Pot datoteke:"/>
<TextBlock TextWrapping="Wrap" Text="{Binding Path=FilePath}"/>
</StackPanel>
</Grid>
</Window>

View File

@@ -0,0 +1,47 @@
using System.Windows;
using System.Windows.Controls;
namespace MyApp
{
/// <summary>
/// Interaction logic for EditWindow.xaml
/// </summary>
public partial class EditWindow : Window
{
ProgramData data;
internal EditWindow(ProgramData data)
{
InitializeComponent();
this.data = data;
this.DataContext = data.SelectedItem;
comboBox.ItemsSource = data.GenreList;
}
private void Image_Button_Click(object sender, RoutedEventArgs e)
{
var dialog = new Microsoft.Win32.OpenFileDialog();
//dialog.FileName = "Document"; // Default file name
dialog.DefaultExt = "*.*"; // Default file extension
dialog.Filter = "Image Files|*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.TIF;*.TIFF;*.PNG;";
bool? result = dialog.ShowDialog();
if (result == true)
{
data.SelectedItem.IconSource = dialog.FileName;
}
}
private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if(comboBox.SelectedItem is string s)
{
data.SelectedItem.Genra = s;
}
}
}
}

View File

@@ -0,0 +1,146 @@
<Window x:Class="MyApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MyApp"
mc:Ignorable="d"
Closing="Window_Closing"
Style="{StaticResource MainWindow}">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition />
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0">
<Menu>
<MenuItem Header="Datoteka">
<MenuItem Header="Izhod" Click="MenuItem_Exit_Click"/>
<MenuItem Header="Shrani" Click="MenuItem_Save_Click"/>
<MenuItem Header="Uvozi" Click="MenuItem_Load_Click"/>
</MenuItem>
<MenuItem Header="Seznam">
<MenuItem Header="Dodaj" Click="MenuItem_Add_Click"/>
<MenuItem Header="Odstrani" Click="MenuItem_Remove_Click" IsEnabled="{Binding SelectedItems.Count, ElementName=PlayListView}"/>
<MenuItem Header="Uredi" Click="MenuItem_Edit_Click" IsEnabled="{Binding SelectedItems.Count, ElementName=PlayListView}"/>
</MenuItem>
<MenuItem Header="Orodje">
<MenuItem Header="Nastavitve" Click="MenuItem_Settings_Click"/>
</MenuItem>
</Menu>
</DockPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="2"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ListView Style="{StaticResource Playlist}" Name="PlayListView" SelectionChanged="PlayListView_SelectionChanged" MouseDoubleClick="PlayListView_MouseDoubleClick">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<Label Name="Naslov" Content="{Binding Path=Name}"/>
<Image Source="{Binding Path=IconSource}" Style="{StaticResource SmallImage}"/>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=IsPlaying }" Value="True">
<Setter TargetName="Naslov" Property="Foreground" Value="Green"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ContextMenu>
<ContextMenu>
<MenuItem Header="Dodaj" Click="MenuItem_Add_Click" />
<MenuItem Header="Odstrani" Click="MenuItem_Remove_Click" />
<MenuItem Header="Uredi" Click="MenuItem_Edit_Click"/>
</ContextMenu>
</ListView.ContextMenu>
</ListView>
<GridSplitter Grid.Column="1" Width="2" HorizontalAlignment="Stretch"/>
<local:MediaController x:Name="MediaPlayer"
Grid.Column="2"
OnTimeChage="MediaPlayer_OnTimeChage"
OnMediaLoad="MediaPlayer_OnMediaLoad"/>
<Canvas HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2">
<Ellipse Width="10" Height="10" Fill="Black" >
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever" Duration="0:0:1">
<DoubleAnimationUsingPath Source="X" Storyboard.TargetProperty="(Canvas.Left)"
PathGeometry="{StaticResource Krozenje}" />
<DoubleAnimationUsingPath Source="Y" Storyboard.TargetProperty="(Canvas.Top)"
PathGeometry="{StaticResource Krozenje}" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
</Canvas>
</Grid>
<Border Grid.Row="2" BorderBrush="Black" BorderThickness="2">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0">
<Label Name="CurrentTime" Content="00:00:00"/>
<Label Content="/"/>
<Label Name="TotalTime" Content="00:00:00"/>
<Slider Name="ProgresBar"
Thumb.DragCompleted="ProgresBar_DragCompleted"
Thumb.DragStarted="ProgresBar_DragStarted"
Margin="5"/>
</DockPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Click="PlayButton_Click" Style="{StaticResource ControllButton}">
<Image Name="PlayPouseImg" Source="pack://application:,,,/assets/play_icon.png"/>
</Button>
<Button Style="{StaticResource ControllButton}" Click="Rewind_Click">
<Image Source="pack://application:,,,/assets/next_icon.png" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<ScaleTransform ScaleX="-1"/>
</Image.RenderTransform>
</Image>
</Button>
<Button Style="{StaticResource ControllButton}" Click="Stop_Click">
<Image Source="pack://application:,,,/assets/stop_icon.png" Margin="3"/>
</Button>
<Button Style="{StaticResource ControllButton}" Click="Forward_Click">
<Image Source="pack://application:,,,/assets/next_icon.png" />
</Button>
<Button Style="{StaticResource ControllButton}">
<Image Source="pack://application:,,,/assets/shuffle_icon.png"/>
</Button>
<Button Style="{StaticResource ControllButton}">
<Image Source="pack://application:,,,/assets/repeat_icon.png"/>
</Button>
</StackPanel>
</Grid>
</Border>
</Grid>
</Window>

View File

@@ -0,0 +1,277 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
using System.Xml.Serialization;
using Microsoft.Win32;
namespace MyApp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
ProgramData data = new ProgramData();
string fileName = "";
int currentlyPlaying = 0;
bool progresBarDragging = false;
EditWindow? editWindow = null;
public DispatcherTimer timer = new DispatcherTimer();
public MainWindow()
{
InitializeComponent();
this.DataContext = this;
PlayListView.ItemsSource = data.PlayList;
timer.Interval = TimeSpan.FromMinutes(1);
timer.Tick += AutoUpdate;
}
private void AutoUpdate(object? sender, EventArgs e)
{
Save();
}
void Save()
{
if (fileName == "")
{
SaveFileDialog dialog = new SaveFileDialog();
dialog.FileName = "Save";
dialog.DefaultExt = "*.xml";
dialog.Filter = "Data|*.xml";
dialog.RestoreDirectory = true;
if (dialog.ShowDialog() == true)
{
fileName = dialog.FileName;
}
}
if (fileName != "")
{
using (StreamWriter sw = new StreamWriter(fileName))
{
XmlSerializer xml = new XmlSerializer(typeof(ProgramData));
xml.Serialize(sw, data);
}
}
}
void Load()
{
if (fileName == "") return;
using (StreamReader sr = new StreamReader(fileName))
{
XmlSerializer xml = new XmlSerializer(typeof(ProgramData));
if (xml.Deserialize(sr) is ProgramData m)
{
data = m;
PlayListView.ItemsSource = data.PlayList;
if(data.AutoSave) timer.Start();
else timer.Stop();
}
}
}
void Window_Closing(object sender, CancelEventArgs e)
{
if(fileName == "")
{
MessageBoxResult result = MessageBox.Show("Data was not saved.\n Do you want to save it?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result == MessageBoxResult.Yes)
{
//e.Cancel = true;
Save();
}
}
else
{
Save();
}
}
private void PlayButton_Click(object sender, RoutedEventArgs e)
{
if (!MediaPlayer.IsPlaying())
{
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/pause_icon.png"));
MediaPlayer.Play();
}
else
{
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/play_icon.png"));
MediaPlayer.Pause();
}
}
private void Stop_Click(object sender, RoutedEventArgs e)
{
MediaPlayer.Stop();
ProgresBar.Value = 0;
CurrentTime.Content = TimeSpan.FromSeconds(0).ToString(@"hh\:mm\:ss");
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/play_icon.png"));
}
private void Rewind_Click(object sender, RoutedEventArgs e)
{
data.PlayList[currentlyPlaying].IsPlaying = false;
currentlyPlaying--;
if (currentlyPlaying < 0)
{
currentlyPlaying = 0;
}
MediaPlayer.ChangeContent(data.PlayList[currentlyPlaying].FilePath);
data.PlayList[currentlyPlaying].IsPlaying = true;
}
private void Forward_Click(object sender, RoutedEventArgs e)
{
data.PlayList[currentlyPlaying].IsPlaying = false;
currentlyPlaying++;
if (currentlyPlaying >= data.PlayList.Count)
{
currentlyPlaying = data.PlayList.Count - 1;
}
MediaPlayer.ChangeContent(data.PlayList[currentlyPlaying].FilePath);
data.PlayList[currentlyPlaying].IsPlaying = true;
}
private void ProgresBar_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
{
progresBarDragging = false;
MediaPlayer.ChangeTime(ProgresBar.Value);
}
private void ProgresBar_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
{
progresBarDragging = true;
}
private void PlayListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (PlayListView.SelectedItem is Media m)
{
data.PlayList[currentlyPlaying].IsPlaying = false;
m.IsPlaying = true;
MediaPlayer.ChangeContent(m.FilePath);
MediaPlayer.Play();
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/pause_icon.png"));
currentlyPlaying = PlayListView.SelectedIndex;
}
}
private void PlayListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (PlayListView.SelectedItem is Media m)
{
data.SelectedItem = m;
if (editWindow != null)
{
if (data.SelectedItem == null) { editWindow.Close(); }
else { editWindow.DataContext = data.SelectedItem; }
}
}
}
private void MenuItem_Exit_Click(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
private void MenuItem_Add_Click(object sender, RoutedEventArgs e)
{
var dialog = new OpenFileDialog();
//dialog.FileName = "Document"; // Default file name
dialog.DefaultExt = "*.*"; // Default file extension
dialog.Filter = "All files|*.*|Video media|*.mkv;*.wmv;*.mp4"; // Filter files by extension
dialog.Multiselect = true;
bool? result = dialog.ShowDialog();
if (result == true)
{
string[] files = dialog.FileNames;
foreach(string file in files)
{
string filename = file.Split("\\").Last();
data.PlayList.Add(new Media(filename, file));
}
}
}
private void MenuItem_Remove_Click(object sender, RoutedEventArgs e)
{
if(PlayListView.SelectedItem is Media m)
{
if(editWindow != null) { editWindow.Close(); }
data.PlayList.Remove(m);
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void MenuItem_Settings_Click(object sender, RoutedEventArgs e)
{
SettingsWindow? settingsWindow = new SettingsWindow(data);
settingsWindow.Owner = this;
settingsWindow.ShowDialog();
}
private void MenuItem_Save_Click(object sender, RoutedEventArgs e)
{
Save();
}
private void MenuItem_Edit_Click(object sender, RoutedEventArgs e)
{
if(!(PlayListView.SelectedItem is Media)) return;
if(editWindow == null)
{
editWindow = new EditWindow(data);
editWindow.Owner = this;
editWindow.Show();
}
if (!editWindow.IsLoaded)
{
editWindow = new EditWindow(data);
editWindow.Owner = this;
editWindow.Show();
}
}
private void MenuItem_Load_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.FileName = "Save"; // Default file name
dialog.DefaultExt = "*.xml"; // Default file extension
dialog.Filter = "Data|*.xml"; // Filter files by extension
bool? result = dialog.ShowDialog();
if (result == true)
{
fileName = dialog.FileName;
Load();
}
}
private void MediaPlayer_OnTimeChage(object sender, double time)
{
if (!progresBarDragging)
{
ProgresBar.Value = time;
CurrentTime.Content = TimeSpan.FromSeconds(time).ToString(@"hh\:mm\:ss");
}
}
private void MediaPlayer_OnMediaLoad(object sender, bool loded, double totalTimeInMilS)
{
if (loded)
{
ProgresBar.Minimum = 0;
ProgresBar.Maximum = totalTimeInMilS;
TotalTime.Content = TimeSpan.FromSeconds(totalTimeInMilS).ToString(@"hh\:mm\:ss");
}
else
{
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/play_icon.png"));
}
}
}
}

View File

@@ -0,0 +1,79 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Xml.Serialization;
namespace MyApp
{
public class Media : INotifyPropertyChanged
{
public string Name
{
get { return name; }
set
{
name = value;
OnPropertyChanged();
}
}
string name = "";
public string IconSource
{
get { return iconSource; }
set
{
iconSource = value;
OnPropertyChanged();
}
}
string iconSource = "";
public string FilePath
{
get { return filePath; }
set
{
filePath = value;
OnPropertyChanged();
}
}
string filePath = "";
[XmlIgnore]
public bool IsPlaying
{
get { return isPlaying; }
set
{
isPlaying = value;
OnPropertyChanged();
}
}
bool isPlaying = false;
public string Genra
{
get { return genra; }
set
{
genra = value;
OnPropertyChanged();
}
}
string genra = "";
public Media(string name, string filePath)
{
this.name = name;
this.filePath = filePath;
iconSource = "pack://application:,,,/assets/video_icon.png";
}
public Media() { }
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
}

View File

@@ -0,0 +1,17 @@
<UserControl x:Class="MyApp.MediaController"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:MyApp"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<MediaElement
Name="MediaPlayer"
LoadedBehavior="Manual"
MediaOpened="MediaPlayer_MediaOpened"
MediaEnded="MediaPlayer_MediaEnded"
UnloadedBehavior="Stop"/>
</Grid>
</UserControl>

View File

@@ -0,0 +1,89 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
namespace MyApp
{
/// <summary>
/// Interaction logic for MediaController.xaml
/// </summary>
public partial class MediaController : UserControl
{
DispatcherTimer timer;
bool isPlaying = false;
public MediaController()
{
InitializeComponent();
timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(1);
timer.Tick += Timer_Tick;
}
public delegate void TimeChange(object sender, double time);
public event TimeChange? OnTimeChage;
public delegate void MediaLoded(object sender, bool loded, double totalTimeInMilS);
public event MediaLoded? OnMediaLoad;
private void Timer_Tick(object? sender, EventArgs e)
{
OnTimeChage?.Invoke(this, MediaPlayer.Position.TotalSeconds);
}
public bool IsPlaying()
{
return isPlaying;
}
public void Play()
{
timer.Start();
MediaPlayer.Play();
isPlaying = true;
}
public void Stop()
{
timer.Stop();
MediaPlayer.Stop();
isPlaying = false;
OnMediaLoad?.Invoke(this, false, 0);
}
public void Pause()
{
timer.Stop();
MediaPlayer.Pause();
isPlaying = false;
}
public void ChangeTime(double time)
{
MediaPlayer.Position = TimeSpan.FromSeconds(time);
}
public void ChangeContent(string contentAdress)
{
MediaPlayer.Stop();
timer.Stop();
isPlaying = false;
MediaPlayer.Source = new Uri(contentAdress);
OnMediaLoad?.Invoke(this, false, 0);
}
private void MediaPlayer_MediaOpened(object sender, RoutedEventArgs e)
{
OnMediaLoad?.Invoke(this, true, MediaPlayer.NaturalDuration.TimeSpan.TotalSeconds);
}
private void MediaPlayer_MediaEnded(object sender, RoutedEventArgs e)
{
timer?.Stop();
MediaPlayer.Stop();
isPlaying = false;
OnMediaLoad?.Invoke(this, false, 0);
}
}
}

View File

@@ -0,0 +1,66 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<None Remove="assets\film-icon.png" />
<None Remove="assets\next_icon.png" />
<None Remove="assets\pause_icon.png" />
<None Remove="assets\play_icon.png" />
<None Remove="assets\repeat_icon.png" />
<None Remove="assets\rewind_icon.png" />
<None Remove="assets\shuffle_icon.png" />
<None Remove="assets\stop_icon.png" />
<None Remove="assets\video_icon.png" />
<None Remove="play_icon.png" />
<None Remove="repeat_icon.png" />
<None Remove="rewind_icon.png" />
<None Remove="shuffle_icon.png" />
<None Remove="stop_icon.png" />
</ItemGroup>
<ItemGroup>
<COMReference Include="{d37e2a3e-8545-3a39-9f4f-31827c9124ab}">
<WrapperTool>tlbimp</WrapperTool>
<VersionMinor>4</VersionMinor>
<VersionMajor>2</VersionMajor>
<Guid>d37e2a3e-8545-3a39-9f4f-31827c9124ab</Guid>
</COMReference>
</ItemGroup>
<ItemGroup>
<Resource Include="assets\film-icon.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="assets\next_icon.png" />
<Resource Include="assets\pause_icon.png" />
<Resource Include="assets\play_icon.png" />
<Resource Include="assets\repeat_icon.png" />
<Resource Include="assets\rewind_icon.png" />
<Resource Include="assets\shuffle_icon.png" />
<Resource Include="assets\stop_icon.png" />
<Resource Include="assets\video_icon.png" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,31 @@
using System.Collections.ObjectModel;
using System.Windows.Threading;
namespace MyApp
{
public class ProgramData
{
ObservableCollection<Media> playList = new ObservableCollection<Media>();
ObservableCollection<string> genreList = new ObservableCollection<string>();
Media selectedItem = new Media("Ha", "ha");
bool autoSave = false;
public bool AutoSave { get; set; }
public ObservableCollection<Media> PlayList
{
get { return playList; }
set { playList = value; }
}
public ObservableCollection<string> GenreList
{
get { return genreList; }
set { genreList = value; }
}
public Media SelectedItem
{
get { return selectedItem; }
set { selectedItem = value; }
}
}
}

View File

@@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MyApp.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyApp.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] pause_icon {
get {
object obj = ResourceManager.GetObject("pause_icon", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] play_icon {
get {
object obj = ResourceManager.GetObject("play_icon", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] repeat_icon {
get {
object obj = ResourceManager.GetObject("repeat_icon", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] rewind_icon {
get {
object obj = ResourceManager.GetObject("rewind_icon", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] shuffle_icon {
get {
object obj = ResourceManager.GetObject("shuffle_icon", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] stop_icon {
get {
object obj = ResourceManager.GetObject("stop_icon", resourceCulture);
return ((byte[])(obj));
}
}
}
}

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="pause_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\assets\pause_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="play_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\assets\play_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="repeat_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\assets\repeat_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="rewind_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\assets\rewind_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="shuffle_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\assets\shuffle_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="stop_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\assets\stop_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@@ -0,0 +1,29 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="Button" x:Key="ControllButton">
<Setter Property="Background" Value="Aquamarine"/>
<Setter Property="Margin" Value="5,5,5,5"/>
<Setter Property="Padding" Value="2"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:00">
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="10,5,10,5"/>
<SplineThicknessKeyFrame KeyTime="00:00:01" Value="5,5,5,5"/>
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,15 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="Image" x:Key="SmallImage">
<Setter Property="Width" Value="32"/>
<Setter Property="Height" Value="32"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<Style TargetType="Image" x:Key="BigImage">
<Setter Property="Width" Value="100"/>
<Setter Property="Height" Value="100"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="ListView" x:Key="Playlist">
<Setter Property="Grid.Column" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,19 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="Window" x:Key="MainWindow">
<Setter Property="Title" Value="VideoPlayer I don't know?"/>
<Setter Property="Height" Value="450"/>
<Setter Property="Width" Value="800"/>
<Setter Property="MinHeight" Value="450"/>
<Setter Property="MinWidth" Value="800"/>
<Setter Property="Icon" Value="pack://application:,,,/assets/film-icon.png"/>
<Setter Property="Background" Value="LightGoldenrodYellow"/>
</Style>
<PathGeometry x:Key="Krozenje">
<PathFigure StartPoint="0,0">
<ArcSegment IsLargeArc="True" Size="10,10" Point="1,0" SweepDirection="Clockwise" />
</PathFigure>
</PathGeometry>
</ResourceDictionary>

View File

@@ -0,0 +1,39 @@
<Window x:Class="MyApp.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MyApp"
mc:Ignorable="d"
Title="Settings" Height="450" Width="800" ResizeMode="NoResize">
<Grid Margin="5">
<TabControl>
<TabItem Header="Something">
<Grid Background="#FFE5E5E5">
<StackPanel>
<CheckBox Name="CheckAutoSave" Content="AutoSave" Click="CheckBox_Click"/>
</StackPanel>
</Grid>
</TabItem>
<TabItem Header="Zvrst">
<Grid Background="#FFE5E5E5">
<StackPanel>
<TextBox Name="InputTextBox" Height="30"/>
<Button Content="Add" Click="Add_Click" Height="25"/>
<Button Content="Remove" Click="Remove_Click" Height="25"/>
<ListView Name="GenreListView">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<Label Content="{Binding}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Grid>
</TabItem>
</TabControl>
</Grid>
</Window>

View File

@@ -0,0 +1,53 @@
using System;
using System.Windows;
namespace MyApp
{
/// <summary>
/// Interaction logic for Settings.xaml
/// </summary>
public partial class SettingsWindow : Window
{
ProgramData data;
internal SettingsWindow(ProgramData pD)
{
InitializeComponent();
data = pD;
GenreListView.ItemsSource = data.GenreList;
}
private void Add_Click(object sender, RoutedEventArgs e)
{
if (InputTextBox.Text != "")
data.GenreList.Add(InputTextBox.Text);
}
private void Remove_Click(object sender, RoutedEventArgs e)
{
if (GenreListView.SelectedItem is String s)
{
data.GenreList.Remove(s);
}
}
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
if (CheckAutoSave.IsChecked is bool check)
{
if (Owner is MainWindow my)
{
if (check)
{
my.timer.Start();
data.AutoSave = true;
}
else
{
my.timer.Stop();
data.AutoSave = false;
}
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB