Added Ovals, upgraded to VS2010.

This commit is contained in:
karak 2015-03-15 00:47:45 -07:00
Родитель 198c76044a
Коммит f32b8d98e4
8 изменённых файлов: 171 добавлений и 38 удалений

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -20,7 +20,6 @@
<SignManifests>true</SignManifests>
<IsWebBootstrapper>true</IsWebBootstrapper>
<ApplicationIcon>App.ico</ApplicationIcon>
<TargetFrameworkSubset>Full</TargetFrameworkSubset>
<PublishUrl>ftp://www.hanselman.com/babysmash/</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
@ -43,6 +42,10 @@
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -53,6 +56,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -61,6 +65,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationFramework.Luna">
@ -99,34 +104,54 @@
<Page Include="Shapes\allShapes.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolCircle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolHeart.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolHexagon.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolOval.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolSquare.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolStar.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolTrapezoid.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\FunCursor1.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="Shapes\CoolCircle.xaml.cs">
<DependentUpon>CoolCircle.xaml</DependentUpon>
@ -137,6 +162,9 @@
<Compile Include="Shapes\CoolHexagon.xaml.cs">
<DependentUpon>CoolHexagon.xaml</DependentUpon>
</Compile>
<Compile Include="Shapes\CoolOval.xaml.cs">
<DependentUpon>CoolOval.xaml</DependentUpon>
</Compile>
<Compile Include="Shapes\CoolSquare.xaml.cs">
<DependentUpon>CoolSquare.xaml</DependentUpon>
</Compile>
@ -154,30 +182,44 @@
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="Shapes\CoolTriangle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolLetter.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Options.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\CoolRectangle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Shapes\FunCursor2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>

Просмотреть файл

@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BabySmash", "BabySmash.csproj", "{FB378E07-FDE4-4FC7-9210-68F80B561164}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BabySmashScreenSaver", "..\BabySmashScreensaver\BabySmashScreenSaver\BabySmashScreenSaver.csproj", "{8548BCE3-8FE7-4EF9-8EB7-3D0CC256D53D}"

46
Properties/Resources.Designer.cs сгенерированный
Просмотреть файл

@ -1,17 +1,17 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1434
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BabySmash.Properties
{
namespace BabySmash.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -19,51 +19,43 @@ namespace BabySmash.Properties
// 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", "2.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
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()
{
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 ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BabySmash.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
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}

4
Properties/Settings.Designer.cs сгенерированный
Просмотреть файл

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1434
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -12,7 +12,7 @@ namespace BabySmash.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

58
Shapes/CoolOval.xaml Normal file
Просмотреть файл

@ -0,0 +1,58 @@
<UserControl
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"
mc:Ignorable="d"
x:Class="BabySmash.CoolOval"
x:Name="UserControl"
d:DesignWidth="6.666" d:DesignHeight="10"
>
<UserControl.Resources>
<Storyboard x:Key="OvalEyesSB">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="OvalEye1" Storyboard.TargetProperty="(UIElement.Opacity)" RepeatBehavior="Forever">
<SplineDoubleKeyFrame KeyTime="00:00:02.1000000" Value="1"/>
<SplineDoubleKeyFrame KeyTime="00:00:02.1000000" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:02.300000" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:02.300000" Value="1"/>
<SplineDoubleKeyFrame KeyTime="00:00:7.300000" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="OvalEye2" Storyboard.TargetProperty="(UIElement.Opacity)" RepeatBehavior="Forever">
<SplineDoubleKeyFrame KeyTime="00:00:02.1000000" Value="1"/>
<SplineDoubleKeyFrame KeyTime="00:00:02.1000000" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:02.300000" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:02.300000" Value="1"/>
<SplineDoubleKeyFrame KeyTime="00:00:7.300000" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource OvalEyesSB}"/>
</EventTrigger>
</UserControl.Triggers>
<Grid x:Name="LayoutRoot">
<Canvas
x:Name="Oval" Height="0" Margin="0,-71.372,0,0" VerticalAlignment="Top">
<Ellipse x:Name="Body" StrokeThickness="10" Stroke="#ff000000" Width="190" Height="250">
<Ellipse.Fill>
<RadialGradientBrush MappingMode="Absolute" GradientOrigin="123,198" Center="123,198" RadiusX="102" RadiusY="102">
<RadialGradientBrush.Transform>
<MatrixTransform Matrix="1,0,-0,-1,-16,305" />
</RadialGradientBrush.Transform>
<GradientStop Offset="0" Color="#ffffff00"/>
<GradientStop Offset="1" Color="#ff98ff00"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<Canvas x:Name="Face"></Canvas>
<Path StrokeThickness="10" Stroke="#ff000000" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeMiterLimit="1" Data="F1 M 58.970703,66.372070 C 64.513184,62.001953 71.509277,59.393555 79.114258,59.393555 C 86.719727,59.393555 93.715820,62.001953 99.258301,66.372070" Height="71.372" Canvas.Left="-12" Canvas.Top="0" Width="104" />
<Path StrokeThickness="10" Stroke="#ff000000" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeMiterLimit="1" Data="F1 M 114.742188,66.372070 C 120.284180,62.001953 127.280273,59.393555 134.885742,59.393555 C 142.491211,59.393555 149.487305,62.001953 155.029297,66.372070" Canvas.Left="-10" Width="190" Height="71.372" Canvas.Top="0" />
<Path Fill="#ff000000" Data="F1 M 124.545898,151.451172 C 124.529297,161.141602 116.688477,168.981445 107.000977,168.998047 L 107.000977,168.998047 C 97.310547,168.981445 89.469727,161.141602 89.453125,151.451172 L 89.453125,151.451172 C 89.453125,148.690430 87.213867,146.451172 84.453125,146.451172 L 84.453125,146.451172 Z" Height="179" Canvas.Left="-10" Canvas.Top="6" Width="166" />
<Path x:Name="OvalEye1" Data="F1M100.433594,88.735352C103.952148,88.735352,107.389648,89.074707,110.728516,89.693848L110.728516,58.061035C110.728516,55.126465,108.349609,52.74707,105.414063,52.74707L95.451172,52.74707C92.517578,52.74707,90.138672,55.126465,90.138672,58.061035L90.138672,89.693848C93.477539,89.074707,96.915039,88.735352,100.433594,88.735352z" Fill="Black" Height="90" Width="111" Canvas.Left="-34" Canvas.Top="18" />
<Path x:Name="OvalEye2" Data="F1M100.433594,88.735352C103.952148,88.735352,107.389648,89.074707,110.728516,89.693848L110.728516,58.061035C110.728516,55.126465,108.349609,52.74707,105.414063,52.74707L95.451172,52.74707C92.517578,52.74707,90.138672,55.126465,90.138672,58.061035L90.138672,89.693848C93.477539,89.074707,96.915039,88.735352,100.433594,88.735352z" Fill="Black" Height="90" Width="111" Canvas.Left="24" Canvas.Top="18" />
</Canvas>
</Grid>
</UserControl>

40
Shapes/CoolOval.xaml.cs Normal file
Просмотреть файл

@ -0,0 +1,40 @@
namespace BabySmash
{
using System;
using System.Windows;
using System.Windows.Media;
/// <summary>
/// Interaction logic for CoolOval.xaml
/// </summary>
[Serializable]
public partial class CoolOval : IHasFace
{
public CoolOval(Brush x)
: this()
{
this.Body.Fill = x;
}
public CoolOval()
{
this.InitializeComponent();
}
#region IHasFace Members
public Visibility FaceVisible
{
get
{
return Face.Visibility;
}
set
{
Face.Visibility = value;
}
}
#endregion
}
}

Просмотреть файл

@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Effects;
using BrushControlFunc = System.Func<System.Windows.Media.Brush, System.Windows.Controls.UserControl>;
using System.Windows;
namespace BabySmash
{
@ -23,6 +23,7 @@ namespace BabySmash
private static readonly List<KeyValuePair<string, BrushControlFunc>> hashTableOfFigureGenerators = new List<KeyValuePair<string, BrushControlFunc>>
{
new KeyValuePair<string, BrushControlFunc>("Circle", x => new CoolCircle(x) ),
new KeyValuePair<string, BrushControlFunc>("Oval", x => new CoolOval(x) ),
new KeyValuePair<string, BrushControlFunc>("Rectangle", x => new CoolRectangle(x) ),
new KeyValuePair<string, BrushControlFunc>("Hexagon", x => new CoolHexagon(x) ),
new KeyValuePair<string, BrushControlFunc>("Trapezoid", x => new CoolTrapezoid(x) ),

Просмотреть файл

@ -1,11 +1,10 @@
<?xml version="1.0"?>
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="BabySmash.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<system.diagnostics>
<sources>
<source name="System.Windows.Data" switchName="SourceSwitch">
@ -21,7 +20,7 @@
<add name="default" type="System.Diagnostics.DefaultTraceListener"/>
</sharedListeners>
<trace autoflush="true" indentsize="4"></trace>
</system.diagnostics>
</system.diagnostics>
<userSettings>
<BabySmash.Properties.Settings>
<setting name="ForceUppercase" serializeAs="String">
@ -59,4 +58,5 @@
</setting>
</BabySmash.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
<startup/>
</configuration>