Permalink
Browse files

add cs files

  • Loading branch information...
1 parent 729ec19 commit 6647a6bfe4768cdbaa17ecf145b8b13bcb6eaf9c @dharmatech committed Jan 27, 2012
View
20 FluentWpf.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C# Express 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentWpf", "FluentWpf\FluentWpf.csproj", "{B7B3D369-D06C-4AAF-99BD-C6619B3235E8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B7B3D369-D06C-4AAF-99BD-C6619B3235E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B7B3D369-D06C-4AAF-99BD-C6619B3235E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B7B3D369-D06C-4AAF-99BD-C6619B3235E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B7B3D369-D06C-4AAF-99BD-C6619B3235E8}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
BIN FluentWpf.suo
Binary file not shown.
View
101 FluentWpf/FluentWpf.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+
+namespace FluentWpf
+{
+ public static class Fluent
+ {
+ public static T CallOnSelf<T>(this T obj, Action<T> proc)
+ { proc(obj); return obj; }
+ }
+
+ public static class FluentApplication
+ {
+ public static Application AddStartup(this Application obj, StartupEventHandler proc)
+ { obj.Startup += proc; return obj; }
+ }
+
+ public static class FluentUIElement
+ {
+ public static T AddCommandBindings<T>(this T obj, params CommandBinding[] elts)
+ where T : UIElement
+ {
+ Array.ForEach(elts, elt => obj.CommandBindings.Add(elt));
+ return obj;
+ }
+
+ public static T AddMouseEnter<T>(this T obj, MouseEventHandler proc)
+ where T : UIElement
+ { obj.MouseEnter += proc; return obj; }
+
+ public static T AddMouseLeave<T>(this T obj, MouseEventHandler proc)
+ where T : UIElement
+ { obj.MouseLeave += proc; return obj; }
+
+ public static T SetDock<T>(this T obj, Dock val)
+ where T : UIElement
+ { DockPanel.SetDock(obj, val); return obj; }
+
+ public static T SetColumn<T>(this T obj, int val) where T : UIElement
+ { Grid.SetColumn(obj, val); return obj; }
+ }
+
+ public static class FluentItemsControl
+ {
+ public static T AddItems<T>(this T obj, params Object[] elts)
+ where T : ItemsControl
+ {
+ Array.ForEach(elts, elt => obj.Items.Add(elt));
+ return obj;
+ }
+ }
+
+ public static class FluentMenuItem
+ {
+ public static MenuItem AddClick(this MenuItem obj, RoutedEventHandler proc)
+ { obj.Click += proc; return obj; }
+ }
+
+ public static class FluentButtonBase
+ {
+ public static T AddClick<T>(this T obj, RoutedEventHandler proc)
+ where T : ButtonBase
+ { obj.Click += proc; return obj; }
+ }
+
+ public static class FluentContentControl
+ {
+ public static T SetContent<T>(this T obj, Object val)
+ where T : ContentControl
+ { obj.Content = val; return obj; }
+
+ }
+
+ public static class FluentPanel
+ {
+ public static T AddChildren<T>(this T obj, params UIElement[] elts)
+ where T : Panel
+ { Array.ForEach(elts, elt => obj.Children.Add(elt)); return obj; }
+ }
+
+ public static class FluentGrid
+ {
+ public static Grid AddColumnDefinitions(this Grid obj, params ColumnDefinition[] elts)
+ { Array.ForEach(elts, elt => obj.ColumnDefinitions.Add(elt)); return obj; }
+ }
+
+ public static class FluentCommandBinding
+ {
+ public static CommandBinding AddCanExecute(this CommandBinding obj, CanExecuteRoutedEventHandler proc)
+ { obj.CanExecute += proc; return obj; }
+
+ public static CommandBinding AddExecuted(this CommandBinding obj, ExecutedRoutedEventHandler proc)
+ { obj.Executed += proc; return obj; }
+ }
+}
View
58 FluentWpf/FluentWpf.csproj
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B7B3D369-D06C-4AAF-99BD-C6619B3235E8}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>FluentWpf</RootNamespace>
+ <AssemblyName>FluentWpf</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <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' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xaml" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="FluentWpf.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
3 FluentWpf/FluentWpf.csproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
View
36 FluentWpf/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("FluentWpf")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("FluentWpf")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("bbcdd17d-d393-4d31-b4e6-05a02652efec")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

0 comments on commit 6647a6b

Please sign in to comment.