Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lesson12/Lekcja12b/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions Lesson12/Lekcja12b/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="Lekcja12b.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Lekcja12b"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions Lesson12/Lekcja12b/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -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 Lekcja12b
{
/// <summary>
/// Logika interakcji dla klasy App.xaml
/// </summary>
public partial class App : Application
{
}
}
98 changes: 98 additions & 0 deletions Lesson12/Lekcja12b/Lekcja12b.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CCA088E1-6348-47D5-B149-A44582DFEF84}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Lekcja12b</RootNamespace>
<AssemblyName>Lekcja12b</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
25 changes: 25 additions & 0 deletions Lesson12/Lekcja12b/Lekcja12b.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lekcja12b", "Lekcja12b.csproj", "{CCA088E1-6348-47D5-B149-A44582DFEF84}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CCA088E1-6348-47D5-B149-A44582DFEF84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CCA088E1-6348-47D5-B149-A44582DFEF84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CCA088E1-6348-47D5-B149-A44582DFEF84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CCA088E1-6348-47D5-B149-A44582DFEF84}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4D9A330C-D2D6-400A-970A-4A1FDB77A2EA}
EndGlobalSection
EndGlobal
15 changes: 15 additions & 0 deletions Lesson12/Lekcja12b/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Window x:Class="Lekcja12b.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:Lekcja12b"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<ComboBox x:Name="Kalkulator" Margin="100,50,100,0" VerticalAlignment="Top" Height="30" Loaded="ComboBox_Loaded" SelectionChanged="ComboBox_SelectionChanged"/>
<TextBox x:Name="pierwsza" HorizontalAlignment="Left" Height="30" Margin="100,210,0,0" Text="Pierwsza liczba" VerticalAlignment="Top" Width="200" TextWrapping="Wrap" TextAlignment="Center"/>
<TextBox x:Name="druga" HorizontalAlignment="Right" Height="30" Margin="0,210,100,0" TextWrapping="Wrap" Text="Druga liczba" VerticalAlignment="Top" Width="200" TextAlignment="Center"/>
<Button x:Name="licz" Content="Licz" HorizontalAlignment="Left" Margin="300,286,0,0" VerticalAlignment="Top" Width="192" Height="35" Click="Licz_Click"/>
</Grid>
</Window>
80 changes: 80 additions & 0 deletions Lesson12/Lekcja12b/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
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.Navigation;
using System.Windows.Shapes;

namespace Lekcja12b
{
/// <summary>
/// Logika interakcji dla klasy MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.Title = "Kalkulator";
}
int działanie;

private void ComboBox_Loaded(object sender, RoutedEventArgs e)
{
// ... lista
List<string> data = new List<string>() { "Dodawanie", "Odejmowanie", "Mnożenie", "Dzielenie" };

// ... ustawienie referencji
var comboBox = sender as ComboBox;

// ... ustawienie zródla
comboBox.ItemsSource = data;

// ... czy cos domyslnie ma byc wybrane
comboBox.SelectedIndex = 0;
}
public void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// ... dostep do combo.
var comboBox = sender as ComboBox;

działanie = comboBox.SelectedIndex;
}

private void Licz_Click(object sender, RoutedEventArgs e)
{

try
{

switch (działanie)
{
case 0:
MessageBox.Show(Convert.ToString(Convert.ToDouble(pierwsza.Text)+Convert.ToDouble(druga.Text)));
break;
case 1:
MessageBox.Show(Convert.ToString(Convert.ToDouble(pierwsza.Text) - Convert.ToDouble(druga.Text)));
break;
case 2:
MessageBox.Show(Convert.ToString(Convert.ToDouble(pierwsza.Text) * Convert.ToDouble(druga.Text)));
break;
case 3:
MessageBox.Show(Convert.ToString(Convert.ToDouble(pierwsza.Text) / Convert.ToDouble(druga.Text)));
break;
}
}
catch
{
MessageBox.Show("Błąd");
}
}
}
}
55 changes: 55 additions & 0 deletions Lesson12/Lekcja12b/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// Ogólne informacje o zestawie są kontrolowane poprzez następujący
// zestaw atrybutów. Zmień wartości tych atrybutów, aby zmodyfikować informacje
// powiązane z zestawem.
[assembly: AssemblyTitle("Lekcja12b")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lekcja12b")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Ustawienie elementu ComVisible na wartość false sprawia, że typy w tym zestawie są niewidoczne
// dla składników COM. Jeśli potrzebny jest dostęp do typu w tym zestawie z
// COM, ustaw wartość true dla atrybutu ComVisible tego typu.
[assembly: ComVisible(false)]

//Aby rozpocząć kompilację aplikacji możliwych do zlokalizowania, ustaw
//<UICulture>Kultura_używana_podczas_kodowania</UICulture> w pliku csproj
//w grupie <PropertyGroup>. Jeśli na przykład jest używany język angielski (USA)
//w plikach źródłowych ustaw dla elementu <UICulture> wartość en-US. Następnie usuń komentarz dla
//poniższego atrybutu NeutralResourceLanguage. Zaktualizuj wartość „en-US” w
//poniższej linii tak, aby dopasować ustawienie UICulture w pliku projektu.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //gdzie znajdują się słowniki zasobów specyficznych dla motywów
//(używane, jeśli nie można odnaleźć zasobu na stronie,
// lub słowniki zasobów aplikacji)
ResourceDictionaryLocation.SourceAssembly //gdzie znajduje się słownik zasobów ogólnych
//(używane, jeśli nie można odnaleźć zasobu na stronie,
// aplikacji lub słowników zasobów specyficznych dla motywów)
)]


// Informacje o wersji zestawu zawierają następujące cztery wartości:
//
// Wersja główna
// Wersja pomocnicza
// Numer kompilacji
// Rewizja
//
// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
// przy użyciu symbolu „*”, tak jak pokazano poniżej:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
71 changes: 71 additions & 0 deletions Lesson12/Lekcja12b/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading