mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-05 23:42:58 +02:00
Initial WPF content migrated (#17)
* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
<Application x:Class="StringReaderWriter.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:StringReaderWriter"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
+17
@@ -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 StringReaderWriter
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<Window x:Class="StringReaderWriter.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:StringReaderWriter"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="450" Width="800" Loaded="Window_Loaded">
|
||||
<Grid>
|
||||
<TextBox Name="UserInput" Margin="0,0,0,215">Only 1234567890 letters!</TextBox>
|
||||
<TextBlock Name="Result" Margin="0,204,0,0" />
|
||||
</Grid>
|
||||
</Window>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.IO;
|
||||
|
||||
namespace StringReaderWriter
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private async void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
char[] charsRead = new char[UserInput.Text.Length];
|
||||
using (StringReader reader = new StringReader(UserInput.Text))
|
||||
{
|
||||
await reader.ReadAsync(charsRead, 0, UserInput.Text.Length);
|
||||
}
|
||||
|
||||
StringBuilder reformattedText = new StringBuilder();
|
||||
using (StringWriter writer = new StringWriter(reformattedText))
|
||||
{
|
||||
foreach (char c in charsRead)
|
||||
{
|
||||
if (char.IsLetter(c) || char.IsWhiteSpace(c))
|
||||
{
|
||||
await writer.WriteLineAsync(char.ToLower(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
Result.Text = reformattedText.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<UseWpf>true</UseWpf>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user