From f32b8d98e4589bd90a59327a7c0cc41294de1db5 Mon Sep 17 00:00:00 2001 From: karak Date: Sun, 15 Mar 2015 00:47:45 -0700 Subject: [PATCH] Added Ovals, upgraded to VS2010. --- BabySmash.csproj | 46 +++++++++++++++++++++++-- BabySmash.sln | 4 +-- Properties/Resources.Designer.cs | 46 +++++++++++-------------- Properties/Settings.Designer.cs | 4 +-- Shapes/CoolOval.xaml | 58 ++++++++++++++++++++++++++++++++ Shapes/CoolOval.xaml.cs | 40 ++++++++++++++++++++++ Shapes/FigureGenerator.cs | 3 +- app.config | 8 ++--- 8 files changed, 171 insertions(+), 38 deletions(-) create mode 100644 Shapes/CoolOval.xaml create mode 100644 Shapes/CoolOval.xaml.cs diff --git a/BabySmash.csproj b/BabySmash.csproj index 8d6adbc..e0c9e5f 100644 --- a/BabySmash.csproj +++ b/BabySmash.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -20,7 +20,6 @@ true true App.ico - Full ftp://www.hanselman.com/babysmash/ true Web @@ -43,6 +42,10 @@ false true true + + + 3.5 + true @@ -53,6 +56,7 @@ prompt 4 x86 + AllRules.ruleset pdbonly @@ -61,6 +65,7 @@ TRACE prompt 4 + AllRules.ruleset @@ -99,34 +104,54 @@ MSBuild:Compile Designer + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer MSBuild:Compile Designer + MSBuild:Compile + Designer CoolCircle.xaml @@ -137,6 +162,9 @@ CoolHexagon.xaml + + CoolOval.xaml + CoolSquare.xaml @@ -154,30 +182,44 @@ MSBuild:Compile Designer + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer MSBuild:Compile Designer + MSBuild:Compile + Designer App.xaml diff --git a/BabySmash.sln b/BabySmash.sln index abea12b..05e5280 100644 --- a/BabySmash.sln +++ b/BabySmash.sln @@ -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}" diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 7738c4c..f88aa91 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -1,17 +1,17 @@ //------------------------------------------------------------------------------ // // 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. // //------------------------------------------------------------------------------ -namespace BabySmash.Properties -{ - - +namespace BabySmash.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -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() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [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; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [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; } } diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index 36d0e32..3b14c90 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // 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()))); diff --git a/Shapes/CoolOval.xaml b/Shapes/CoolOval.xaml new file mode 100644 index 0000000..3986442 --- /dev/null +++ b/Shapes/CoolOval.xaml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Shapes/CoolOval.xaml.cs b/Shapes/CoolOval.xaml.cs new file mode 100644 index 0000000..37b9a5b --- /dev/null +++ b/Shapes/CoolOval.xaml.cs @@ -0,0 +1,40 @@ +namespace BabySmash +{ + using System; + using System.Windows; + using System.Windows.Media; + + /// + /// Interaction logic for CoolOval.xaml + /// + [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 + } +} \ No newline at end of file diff --git a/Shapes/FigureGenerator.cs b/Shapes/FigureGenerator.cs index 3cd322b..d711cc5 100644 --- a/Shapes/FigureGenerator.cs +++ b/Shapes/FigureGenerator.cs @@ -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; -using System.Windows; namespace BabySmash { @@ -23,6 +23,7 @@ namespace BabySmash private static readonly List> hashTableOfFigureGenerators = new List> { new KeyValuePair("Circle", x => new CoolCircle(x) ), + new KeyValuePair("Oval", x => new CoolOval(x) ), new KeyValuePair("Rectangle", x => new CoolRectangle(x) ), new KeyValuePair("Hexagon", x => new CoolHexagon(x) ), new KeyValuePair("Trapezoid", x => new CoolTrapezoid(x) ), diff --git a/app.config b/app.config index 363ea89..bd831cf 100644 --- a/app.config +++ b/app.config @@ -1,11 +1,10 @@ - +
- @@ -21,7 +20,7 @@ - + @@ -59,4 +58,5 @@ - + +