Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first checkin of Cassandra support for LINQPad

  • Loading branch information...
commit 245f6fd43a2a805101ebb3f6d55b9202ba76438b 1 parent 6b59025
@nberardi nberardi authored
Showing with 959 additions and 142 deletions.
  1. +6 −0 .nuget/NuGet.Config
  2. BIN  .nuget/NuGet.exe
  3. +52 −0 .nuget/NuGet.targets
  4. +18 −0 FluentCassandra.sln
  5. BIN  lib/LINQPad.exe
  6. BIN  lib/NuGet.exe
  7. BIN  lib/nunit.framework.dll
  8. +8 −3 src/CassandraContext.cs
  9. +3 −0  src/FluentCassandra.csproj
  10. +0 −14 test/FluentCassandra.Blog.Tests/App.config
  11. +0 −36 test/FluentCassandra.Blog.Tests/Controllers/PostsControllerTest.cs
  12. +0 −77 test/FluentCassandra.Blog.Tests/FluentCassandra.Blog.Tests.csproj
  13. +3 −0  test/FluentCassandra.Sandbox/FluentCassandra.Sandbox.csproj
  14. +3 −0  test/FluentCassandra.StressTest/FluentCassandra.StressTest.csproj
  15. +15 −2 test/FluentCassandra.Tests/FluentCassandra.Tests.csproj
  16. 0  test/{FluentCassandra.Blog.Tests → FluentCassandra.Tests}/packages.config
  17. +6 −0 utility/FluentCassandra.LinqPad/App.xaml
  18. +45 −0 utility/FluentCassandra.LinqPad/CassandraConectionDialog.xaml
  19. +30 −0 utility/FluentCassandra.LinqPad/CassandraConectionDialog.xaml.cs
  20. +219 −0 utility/FluentCassandra.LinqPad/CassandraConnectionInfo.cs
  21. +102 −0 utility/FluentCassandra.LinqPad/CassandraDriver.cs
  22. +78 −0 utility/FluentCassandra.LinqPad/CassandraDriverContext.cs
  23. +1 −0  utility/FluentCassandra.LinqPad/DevDeploy.bat
  24. +122 −0 utility/FluentCassandra.LinqPad/FluentCassandra.LinqPad.csproj
  25. +9 −10 {test/FluentCassandra.Blog.Tests → utility/FluentCassandra.LinqPad}/Properties/AssemblyInfo.cs
  26. +125 −0 utility/FluentCassandra.LinqPad/RavenLinqpadDriver.csproj
  27. +13 −0 utility/FluentCassandra.LinqPad/Utility.cs
  28. +34 −0 utility/FluentCassandra.LinqPad/ViewModel/MainViewModel.cs
  29. +58 −0 utility/FluentCassandra.LinqPad/ViewModel/ViewModelLocator.cs
  30. +5 −0 utility/FluentCassandra.LinqPad/header.xml
  31. +4 −0 utility/FluentCassandra.LinqPad/packages.config
View
6 .nuget/NuGet.Config
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <solution>
+ <add key="disableSourceControlIntegration" value="true" />
+ </solution>
+</configuration>
View
BIN  .nuget/NuGet.exe
Binary file not shown
View
52 .nuget/NuGet.targets
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
+ <NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
+ <NuGetExePath>$(NuGetToolsPath)\nuget.exe</NuGetExePath>
+ <PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
+ <PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
+ <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
+
+ <!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
+ <PackageSources>""</PackageSources>
+
+ <!-- Enable the restore command to run before builds -->
+ <RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>
+
+ <!-- Property that enables building a package from a project -->
+ <BuildPackage Condition="$(BuildPackage) == ''">false</BuildPackage>
+
+ <!-- Commands -->
+ <RestoreCommand>"$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)"</RestoreCommand>
+ <BuildCommand>"$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
+
+ <!-- Make the build depend on restore packages -->
+ <BuildDependsOn Condition="$(RestorePackages) == 'true'">
+ RestorePackages;
+ $(BuildDependsOn);
+ </BuildDependsOn>
+
+ <!-- Make the build depend on restore packages -->
+ <BuildDependsOn Condition="$(BuildPackage) == 'true'">
+ $(BuildDependsOn);
+ BuildPackage;
+ </BuildDependsOn>
+ </PropertyGroup>
+
+ <Target Name="CheckPrerequisites">
+ <!-- Raise an error if we're unable to locate nuget.exe -->
+ <Error Condition="!Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
+ </Target>
+
+ <Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
+ <Exec Command="$(RestoreCommand)"
+ LogStandardErrorAsError="true"
+ Condition="Exists('$(PackagesConfig)')" />
+ </Target>
+
+ <Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
+ <Exec Command="$(BuildCommand)"
+ LogStandardErrorAsError="true" />
+ </Target>
+</Project>
View
18 FluentCassandra.sln
@@ -14,6 +14,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.StressTest", "test\FluentCassandra.StressTest\FluentCassandra.StressTest.csproj", "{AC3818E2-E260-4193-A3D1-6E3FF87383F6}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.LinqPad", "utility\FluentCassandra.LinqPad\FluentCassandra.LinqPad.csproj", "{CACA3463-BBEE-4C7E-AC89-49240B0D8F46}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{BF5D399F-A637-4DE2-980F-1CF057A6953C}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FluentCassandra.vsmdi
@@ -67,6 +75,16 @@ Global
{AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Release|Mixed Platforms.Build.0 = Release|x86
{AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Release|x86.ActiveCfg = Release|x86
{AC3818E2-E260-4193-A3D1-6E3FF87383F6}.Release|x86.Build.0 = Release|x86
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {CACA3463-BBEE-4C7E-AC89-49240B0D8F46}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
BIN  lib/LINQPad.exe
Binary file not shown
View
BIN  lib/NuGet.exe
Binary file not shown
View
BIN  lib/nunit.framework.dll
Binary file not shown
View
11 src/CassandraContext.cs
@@ -18,7 +18,6 @@ public static ConnectionBuilder CurrentConnectionBuilder
}
private IList<IFluentMutationTracker> _trackers;
- private bool _disposed;
/// <summary>
///
@@ -181,6 +180,12 @@ public TResult ExecuteOperation<TResult>(Operation<TResult> action, bool? throwO
#region IDisposable Members
+ public bool WasDisposed
+ {
+ get;
+ private set;
+ }
+
/// <summary>
///
/// </summary>
@@ -198,13 +203,13 @@ public void Dispose()
/// </param>
protected virtual void Dispose(bool disposing)
{
- if (!_disposed && disposing && CassandraSession.Current != null)
+ if (!WasDisposed && disposing && CassandraSession.Current != null)
{
CassandraSession.Current.Dispose();
CassandraSession.Current = null;
}
- _disposed = true;
+ WasDisposed = true;
}
/// <summary>
View
3  src/FluentCassandra.csproj
@@ -17,6 +17,8 @@
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\FluentCassandra\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -280,6 +282,7 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
14 test/FluentCassandra.Blog.Tests/App.config
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
- Note: Add entries to the App.config file for configuration settings
- that apply only to the Test project.
--->
-<configuration>
- <appSettings>
-
- </appSettings>
-
- <connectionStrings>
-
- </connectionStrings>
-</configuration>
View
36 test/FluentCassandra.Blog.Tests/Controllers/PostsControllerTest.cs
@@ -1,36 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Web.Mvc;
-using FluentCassandra.Blog;
-using FluentCassandra.Blog.Controllers;
-using NUnit.Framework;
-
-namespace FluentCassandra.Blog.Tests.Controllers
-{
- [TestFixture]
- public class PostsControllerTest
- {
- private PostsController _controller = new PostsController();
-
- [Test]
- public void Index()
- {
- // arrange
- var count = 5;
-
- // act
- var result = _controller.Index();
-
- // assert
- Assert.IsInstanceOf<ViewResult>(result);
-
- var viewResult = (ViewResult)result;
- Assert.IsNotNull(viewResult.Model);
-
- dynamic posts = viewResult.Model;
- Assert.AreEqual(count, posts.Count);
- }
- }
-}
View
77 test/FluentCassandra.Blog.Tests/FluentCassandra.Blog.Tests.csproj
@@ -1,77 +0,0 @@
-<?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>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{C3E57452-3D37-435B-9DEE-8B222B6724E3}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>FluentCassandra.Blog.Tests</RootNamespace>
- <AssemblyName>FluentCassandra.Blog.Tests</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- </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="Microsoft.CSharp" />
- <Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <HintPath>..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="nunit.mocks, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <HintPath>..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
- </Reference>
- <Reference Include="pnunit.framework">
- <HintPath>..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Core" />
- <Reference Include="System.Data" />
- <Reference Include="System.Web" />
- <Reference Include="System.Web.ApplicationServices" />
- <Reference Include="System.Web.Extensions" />
- <Reference Include="System.Web.Abstractions" />
- <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Web.Routing" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Controllers\PostsControllerTest.cs" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="App.config" />
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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  test/FluentCassandra.Sandbox/FluentCassandra.Sandbox.csproj
@@ -14,6 +14,8 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\FluentCassandra\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -58,6 +60,7 @@
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
3  test/FluentCassandra.StressTest/FluentCassandra.StressTest.csproj
@@ -14,6 +14,8 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\FluentCassandra\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -55,6 +57,7 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
17 test/FluentCassandra.Tests/FluentCassandra.Tests.csproj
@@ -14,6 +14,8 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\FluentCassandra\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -34,8 +36,15 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
- <Reference Include="nunit.framework">
- <HintPath>..\..\lib\nunit.framework.dll</HintPath>
+ <Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.mocks">
+ <HintPath>..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
+ </Reference>
+ <Reference Include="pnunit.framework">
+ <HintPath>..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
@@ -94,7 +103,11 @@
<Name>FluentCassandra</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.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">
View
0  ...luentCassandra.Blog.Tests/packages.config → test/FluentCassandra.Tests/packages.config
File renamed without changes
View
6 utility/FluentCassandra.LinqPad/App.xaml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="FluentCassandra.LinqPad.App" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:vm="clr-namespace:FluentCassandra.LinqPad.ViewModel">
+ <Application.Resources>
+ <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
+ </Application.Resources>
+</Application>
View
45 utility/FluentCassandra.LinqPad/CassandraConectionDialog.xaml
@@ -0,0 +1,45 @@
+<Window x:Class="FluentCassandra.LinqPad.CassandraConectionDialog"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:FluentCassandra.LinqPad"
+ mc:Ignorable="d" Title="Cassandra Connection" Height="345" Width="574">
+
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="281*" />
+ </Grid.ColumnDefinitions>
+
+ <TextBlock Grid.Row="0" Text="Keyspace *" Margin="6" VerticalAlignment="Center" />
+ <TextBox Grid.Row="0" Grid.Column="1" Name="KeyspaceValue" Margin="6" Text="{Binding Keyspace, Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnExceptions=True,NotifyOnValidationError=True,UpdateSourceTrigger=PropertyChanged}" />
+
+ <TextBlock Grid.Row="1" Text="Host *" Margin="6" VerticalAlignment="Center" />
+ <TextBox Grid.Row="1" Grid.Column="1" Name="HostValue" Margin="6" Text="{Binding Host, Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnExceptions=True,NotifyOnValidationError=True,UpdateSourceTrigger=PropertyChanged}" />
+
+ <TextBlock Grid.Row="2" Text="Port" Margin="6" VerticalAlignment="Center" />
+ <TextBox Grid.Row="2" Grid.Column="1" Name="PortValue" Margin="6" Text="{Binding Port, Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnExceptions=True,NotifyOnValidationError=True}" />
+
+ <TextBlock Grid.Row="3" Text="Timeout" Margin="6" VerticalAlignment="Center" />
+ <TextBox Grid.Row="3" Grid.Column="1" Name="TimeoutValue" Margin="6" Text="{Binding Timeout, Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnExceptions=True,NotifyOnValidationError=True}" />
+
+ <TextBlock Grid.Row="4" Text="Username" Margin="6" VerticalAlignment="Center" />
+ <TextBox Grid.Row="4" Grid.Column="1" Name="UsernameValue" Margin="6" Text="{Binding Username, Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnExceptions=True,NotifyOnValidationError=True}" />
+
+ <TextBlock Grid.Row="5" Text="Password" Margin="6" VerticalAlignment="Center" />
+ <PasswordBox Grid.Row="5" Grid.Column="1" Name="PasswordValue" Margin="6" PasswordChanged="PasswordValue_PasswordChanged" />
+
+ <Button Grid.Row="9" Grid.Column="1" Content="OK" Name="OkButton" HorizontalAlignment="Right" Margin="6" Width="60" Click="OkButton_Click" Command="{Binding SaveCommand}" />
+ </Grid>
+</Window>
View
30 utility/FluentCassandra.LinqPad/CassandraConectionDialog.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Windows;
+
+namespace FluentCassandra.LinqPad
+{
+ public partial class CassandraConectionDialog : Window
+ {
+ private CassandraConnectionInfo _connInfo;
+
+ public CassandraConectionDialog(CassandraConnectionInfo conn)
+ {
+ if (conn == null)
+ throw new ArgumentNullException("conn", "conn is null.");
+
+ InitializeComponent();
+
+ DataContext = _connInfo = conn;
+ PasswordValue.Password = conn.Password;
+ }
+ private void OkButton_Click(object sender, RoutedEventArgs e)
+ {
+ DialogResult = true;
+ }
+
+ private void PasswordValue_PasswordChanged(object sender, RoutedEventArgs e)
+ {
+ _connInfo.Password = PasswordValue.Password;
+ }
+ }
+}
View
219 utility/FluentCassandra.LinqPad/CassandraConnectionInfo.cs
@@ -0,0 +1,219 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Reflection;
+using System.Xml.Linq;
+using GalaSoft.MvvmLight;
+using GalaSoft.MvvmLight.Command;
+using LINQPad.Extensibility.DataContext;
+using FluentCassandra.Connections;
+
+namespace FluentCassandra.LinqPad
+{
+ public class CassandraConnectionInfo : ViewModelBase
+ {
+ public const string CassandraConnectionInfoKey = "CassandraConnectionInfo";
+
+ public IConnectionInfo ConntectionInfo { get; set; }
+
+ public RelayCommand SaveCommand { get; set; }
+
+ public const string HostPropertyName = "Host";
+ private string _host = "127.0.0.1";
+ [Required]
+ public string Host
+ {
+ get
+ {
+ return _host;
+ }
+
+ set
+ {
+ if (_host == value)
+ {
+ return;
+ }
+
+ _host = value;
+
+ RaisePropertyChanged(HostPropertyName);
+ }
+ }
+
+ public const string PortPropertyName = "Port";
+ private int _port = Server.DefaultPort;
+ [Required]
+ public int Port
+ {
+ get
+ {
+ return _port;
+ }
+
+ set
+ {
+ if (_port == value)
+ {
+ return;
+ }
+
+ _port = value;
+
+ RaisePropertyChanged(PortPropertyName);
+ }
+ }
+
+ public const string TimeoutPropertyName = "Timeout";
+ private int _timeout = Server.DefaultTimeout;
+ public int Timeout
+ {
+ get
+ {
+ return _timeout;
+ }
+
+ set
+ {
+ if (_timeout == value)
+ {
+ return;
+ }
+ _timeout = value;
+
+ RaisePropertyChanged(TimeoutPropertyName);
+ }
+ }
+
+ public const string KeyspacePropertyName = "Keyspace";
+ private string _keyspace = null;
+ public string Keyspace
+ {
+ get
+ {
+ return _keyspace;
+ }
+
+ set
+ {
+ if (_keyspace == value)
+ {
+ return;
+ }
+
+ _keyspace = value;
+
+ RaisePropertyChanged(KeyspacePropertyName);
+ }
+ }
+
+ public const string UsernamePropertyName = "Username";
+ private string _username = null;
+ public string Username
+ {
+ get
+ {
+ return _username;
+ }
+
+ set
+ {
+ if (_username == value)
+ {
+ return;
+ }
+
+ _username = value;
+
+ RaisePropertyChanged(UsernamePropertyName);
+ }
+ }
+
+ public const string PasswordPropertyName = "Password";
+ private string _password = null;
+ public string Password
+ {
+ get
+ {
+ return _password;
+ }
+
+ set
+ {
+ if (_password == value)
+ return;
+
+ _password = value;
+
+ RaisePropertyChanged(PasswordPropertyName);
+ }
+ }
+
+ public CassandraConnectionInfo()
+ {
+ SaveCommand = new RelayCommand(Save, CanSave);
+ }
+
+ public void Save()
+ {
+ string pw = Password;
+ if (!Password.IsNullOrWhitespace())
+ Password = ConntectionInfo.Encrypt(Password);
+
+ var builder = new ConnectionBuilder(
+ keyspace: Keyspace,
+ host: Host,
+ port: Port,
+ connectionTimeout: Timeout,
+ username: Username,
+ password: Password);
+
+ ConntectionInfo.DriverData.SetElementValue(CassandraConnectionInfoKey, builder.ConnectionString);
+
+ Password = pw;
+ }
+
+ public bool CanSave()
+ {
+ return !Host.IsNullOrWhitespace()
+ && !Keyspace.IsNullOrWhitespace();
+ }
+
+ public CassandraContext CreateContext()
+ {
+ return new CassandraContext(
+ keyspace: Keyspace,
+ host: Host,
+ port: Port,
+ timeout: Timeout,
+ username: Username,
+ password: Password);
+ }
+
+ public static CassandraConnectionInfo Load(IConnectionInfo connectionInfo)
+ {
+ XElement xe = connectionInfo.DriverData.Element(CassandraConnectionInfoKey);
+ if (xe != null)
+ {
+ var connectionString = xe.Value;
+ var builder = new ConnectionBuilder(connectionString);
+ var info = new CassandraConnectionInfo();
+ info.ConntectionInfo = connectionInfo;
+
+ info.Keyspace = builder.Keyspace;
+ info.Host = builder.Servers[0].Host;
+ info.Port = builder.Servers[0].Port;
+ info.Timeout = builder.Servers[0].Timeout;
+ info.Username = builder.Username;
+ info.Password = builder.Password;
+
+ return info;
+ }
+
+ return null;
+ }
+ }
+}
View
102 utility/FluentCassandra.LinqPad/CassandraDriver.cs
@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using LINQPad.Extensibility.DataContext;
+
+namespace FluentCassandra.LinqPad
+{
+ /// <seealso href="https://github.com/ronnieoverby/RavenDB-Linqpad-Driver">Inspired by RavenDB LINQPad Driver</seealso>
+ public class CassandraDriver : StaticDataContextDriver
+ {
+ CassandraConnectionInfo _connInfo;
+
+ public override string Author
+ {
+ get { return "Nick Berardi"; }
+ }
+
+ public override string GetConnectionDescription(IConnectionInfo cxInfo)
+ {
+ _connInfo = CassandraConnectionInfo.Load(cxInfo);
+ return string.Format("Cassandra: {0}", _connInfo.Host);
+ }
+
+ public override string Name
+ {
+ get { return "Cassandra Driver"; }
+ }
+
+ public override bool ShowConnectionDialog(IConnectionInfo cxInfo, bool isNewConnection)
+ {
+ CassandraConnectionInfo conn;
+ conn = isNewConnection
+ ? new CassandraConnectionInfo { ConntectionInfo = cxInfo }
+ : CassandraConnectionInfo.Load(cxInfo);
+
+ var win = new CassandraConectionDialog(conn);
+ var result = win.ShowDialog() == true;
+
+ if (result)
+ {
+ conn.Save();
+ cxInfo.CustomTypeInfo.CustomAssemblyPath = Assembly.GetAssembly(typeof(CassandraDriverContext)).Location;
+ cxInfo.CustomTypeInfo.CustomTypeName = "FluentCassandra.LinqPad.CassandraContext";
+ }
+
+ return result;
+ }
+
+ public override ParameterDescriptor[] GetContextConstructorParameters(IConnectionInfo cxInfo)
+ {
+ return new[] { new ParameterDescriptor("connInfo", "FluentCassandra.LinqPad.CassandraConnectionInfo") };
+ }
+
+ public override object[] GetContextConstructorArguments(IConnectionInfo cxInfo)
+ {
+ CassandraConnectionInfo connInfo = CassandraConnectionInfo.Load(cxInfo);
+ return new[] { connInfo };
+ }
+
+ public override IEnumerable<string> GetAssembliesToAdd()
+ {
+ return new[] {
+ "FluentCassandra"
+ };
+ }
+
+ public override IEnumerable<string> GetNamespacesToRemove()
+ {
+ // linqpad uses System.Data.Linq by default, which isn't needed
+ return new[] { "System.Data.Linq" };
+ }
+
+ public override IEnumerable<string> GetNamespacesToAdd()
+ {
+ return base.GetNamespacesToAdd().Union(new[] {
+ "FluentCassandra",
+ "FluentCassandra.Types",
+ "FluentCassandra.Connections"
+ });
+ }
+
+ public override List<ExplorerItem> GetSchema(IConnectionInfo cxInfo, Type customType)
+ {
+ return new List<ExplorerItem>();
+ }
+
+ public override void InitializeContext(IConnectionInfo cxInfo, object context, QueryExecutionManager executionManager)
+ {
+ var rc = context as CassandraDriverContext;
+ rc.LogWriter = executionManager.SqlTranslationWriter;
+ }
+
+ public override void TearDownContext(IConnectionInfo cxInfo, object context, QueryExecutionManager executionManager, object[] constructorArguments)
+ {
+ base.TearDownContext(cxInfo, context, executionManager, constructorArguments);
+ var rc = context as CassandraDriverContext;
+ if (rc != null)
+ rc.Dispose();
+ }
+ }
+}
View
78 utility/FluentCassandra.LinqPad/CassandraDriverContext.cs
@@ -0,0 +1,78 @@
+using System;
+using System.IO;
+using System.Linq;
+
+namespace FluentCassandra.LinqPad
+{
+ public class CassandraDriverContext : IDisposable
+ {
+ public CassandraContext Context { get; private set; }
+ public CassandraSession Session { get; private set; }
+ internal TextWriter LogWriter { get; set; }
+
+ public CassandraDriverContext(CassandraConnectionInfo connInfo)
+ {
+ if (connInfo == null)
+ throw new ArgumentNullException("conn", "conn is null.");
+
+ InitContext(connInfo);
+ SetupLogWriting();
+ InitSession();
+ }
+
+ private void SetupLogWriting()
+ {
+// // The following code is evil
+// // DocumentStore: private HttpJsonRequestFactory jsonRequestFactory;
+// var type = typeof(DocumentStore);
+// var field = type.GetField("jsonRequestFactory", BindingFlags.NonPublic | BindingFlags.Instance);
+// var jrf = (HttpJsonRequestFactory)field.GetValue(Context);
+// jrf.LogRequest += new EventHandler<RequestResultArgs>(LogRequest);
+// }
+
+// void LogRequest(object sender, RequestResultArgs e)
+// {
+// if (LogWriter == null) return;
+
+// LogWriter.WriteLine(string.Format(@"
+//{0} - {1}
+//Url: {2}
+//Duration: {3} milliseconds
+//Method: {4}
+//Posted Data: {5}
+//Http Result: {6}
+//Result Data: {7}
+//",
+// e.At, // 0
+// e.Status, // 1
+// e.Url, // 2
+// e.DurationMilliseconds, // 3
+// e.Method, // 4
+// e.PostedData, // 5
+// e.HttpResult, // 6
+// e.Result)); // 7
+ }
+
+ private void InitContext(CassandraConnectionInfo conn)
+ {
+ if (conn == null)
+ throw new ArgumentNullException("conn", "conn is null.");
+
+ Context = conn.CreateContext();
+ }
+
+ private void InitSession()
+ {
+ Session = new CassandraSession();
+ }
+
+ public void Dispose()
+ {
+ if (Session != null)
+ Session.Dispose();
+
+ if (Context != null && !Context.WasDisposed)
+ Context.Dispose();
+ }
+ }
+}
View
1  utility/FluentCassandra.LinqPad/DevDeploy.bat
@@ -0,0 +1 @@
+robocopy "C:\Code\RavenLinqpadDriver\RavenLinqpadDriver\bin\Debug" "C:\ProgramData\LINQPad\Drivers\DataContext\4.0\RavenLinqpadDriver (585b2b0c3c4c2d89)" /mir
View
122 utility/FluentCassandra.LinqPad/FluentCassandra.LinqPad.csproj
@@ -0,0 +1,122 @@
+<?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>{CACA3463-BBEE-4C7E-AC89-49240B0D8F46}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>FluentCassandra.LinqPad</RootNamespace>
+ <AssemblyName>FluentCassandra.LinqPad</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\FluentCassandra\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </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>
+ <PropertyGroup>
+ <SignAssembly>false</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <DefineConstants Condition=" '$(TargetFrameworkVersion)' == 'v3.5' ">$(DefineConstants);NET35</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="GalaSoft.MvvmLight.Extras.WPF4">
+ <HintPath>..\..\packages\MvvmLight.3.1.1\lib\net40\GalaSoft.MvvmLight.Extras.WPF4.dll</HintPath>
+ </Reference>
+ <Reference Include="GalaSoft.MvvmLight.WPF4">
+ <HintPath>..\..\packages\MvvmLight.3.1.1\lib\net40\GalaSoft.MvvmLight.WPF4.dll</HintPath>
+ </Reference>
+ <Reference Include="LINQPad">
+ <HintPath>..\..\lib\LINQPad.exe</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\MvvmLight.3.1.1\lib\net40\System.Windows.Interactivity.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xaml" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="CassandraDriver.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="CassandraConectionDialog.xaml.cs">
+ <DependentUpon>CassandraConectionDialog.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="CassandraConnectionInfo.cs" />
+ <Compile Include="CassandraDriverContext.cs" />
+ <Compile Include="Utility.cs" />
+ <Compile Include="ViewModel\MainViewModel.cs" />
+ <Compile Include="ViewModel\ViewModelLocator.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="header.xml">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="CassandraConectionDialog.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\FluentCassandra.csproj">
+ <Project>{EAA32600-3C2A-4B34-B9B2-5764F280FCE3}</Project>
+ <Name>FluentCassandra</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+ <Import Project="$(SolutionDir)\.nuget\nuget.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
19 ...dra.Blog.Tests/Properties/AssemblyInfo.cs → ...sandra.LinqPad/Properties/AssemblyInfo.cs
@@ -1,16 +1,15 @@
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("FluentCassandra.Blog.Tests")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyTitle("FluentCassandra.LinqPad")]
+[assembly: AssemblyDescription("Provides Cassandra support for LINQPad.")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("FluentCassandra.Blog.Tests")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("FluentCassandra.LinqPad")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +19,7 @@
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("b0f76369-6736-4713-8e4d-5810a703fcba")]
+[assembly: Guid("0c020f32-b4de-42de-99f0-cda3cddc63f8")]
// Version information for an assembly consists of the following four values:
//
@@ -29,7 +28,7 @@
// Build Number
// Revision
//
-// You can specify all the values or you can default the Revision and Build Numbers
+// 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.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.1.0.0")]
View
125 utility/FluentCassandra.LinqPad/RavenLinqpadDriver.csproj
@@ -0,0 +1,125 @@
+<?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>{FAA16900-38B9-4891-86C3-F595DA1FA6F7}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>RavenLinqpadDriver</RootNamespace>
+ <AssemblyName>RavenLinqpadDriver</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </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>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>RavenLinqpadDriverStrongNameKey.pfx</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <DefineConstants Condition=" '$(TargetFrameworkVersion)' == 'v3.5' ">$(DefineConstants);NET35</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="GalaSoft.MvvmLight.Extras.WPF4">
+ <HintPath>..\packages\MvvmLight.3.0.3\lib\net40\GalaSoft.MvvmLight.Extras.WPF4.dll</HintPath>
+ </Reference>
+ <Reference Include="GalaSoft.MvvmLight.WPF4">
+ <HintPath>..\packages\MvvmLight.3.0.3\lib\net40\GalaSoft.MvvmLight.WPF4.dll</HintPath>
+ </Reference>
+ <Reference Include="LINQPad">
+ <HintPath>..\lib\LINQPad.exe</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\lib\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\lib\NLog.dll</HintPath>
+ </Reference>
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ <Reference Include="Raven.Abstractions">
+ <HintPath>..\lib\Raven.Abstractions.dll</HintPath>
+ </Reference>
+ <Reference Include="Raven.Client.Lightweight">
+ <HintPath>..\lib\Raven.Client.Lightweight.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\MvvmLight.3.0.3\lib\net40\System.Windows.Interactivity.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xaml" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AssemblyVersion.cs" />
+ <Compile Include="GuidValueConverter.cs" />
+ <Compile Include="RavenDriver.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="RavenConectionDialog.xaml.cs">
+ <DependentUpon>RavenConectionDialog.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="RavenConnectionInfo.cs" />
+ <Compile Include="RavenContext.cs" />
+ <Compile Include="Utility.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ <None Include="RavenLinqpadDriverStrongNameKey.pfx" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="header.xml">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="RavenConectionDialog.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+ <!-- 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
13 utility/FluentCassandra.LinqPad/Utility.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Linq;
+
+namespace FluentCassandra.LinqPad
+{
+ public static class Utility
+ {
+ public static bool IsNullOrWhitespace(this string source)
+ {
+ return source == null || source.Trim() == string.Empty;
+ }
+ }
+}
View
34 utility/FluentCassandra.LinqPad/ViewModel/MainViewModel.cs
@@ -0,0 +1,34 @@
+using GalaSoft.MvvmLight;
+
+namespace FluentCassandra.LinqPad.ViewModel
+{
+ /// <summary>
+ /// This class contains properties that the main View can data bind to.
+ /// <para>
+ /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
+ /// </para>
+ /// <para>
+ /// You can also use Blend to data bind with the tool's support.
+ /// </para>
+ /// <para>
+ /// See http://www.galasoft.ch/mvvm
+ /// </para>
+ /// </summary>
+ public class MainViewModel : ViewModelBase
+ {
+ /// <summary>
+ /// Initializes a new instance of the MainViewModel class.
+ /// </summary>
+ public MainViewModel()
+ {
+ ////if (IsInDesignMode)
+ ////{
+ //// // Code runs in Blend --> create design time data.
+ ////}
+ ////else
+ ////{
+ //// // Code runs "for real"
+ ////}
+ }
+ }
+}
View
58 utility/FluentCassandra.LinqPad/ViewModel/ViewModelLocator.cs
@@ -0,0 +1,58 @@
+/*
+ In App.xaml:
+ <Application.Resources>
+ <vm:ViewModelLocatorTemplate xmlns:vm="clr-namespace:FluentCassandra.LinqPad"
+ x:Key="Locator" />
+ </Application.Resources>
+
+ In the View:
+ DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}"
+
+ You can also use Blend to do all this with the tool's support.
+ See http://www.galasoft.ch/mvvm
+*/
+
+using GalaSoft.MvvmLight;
+
+namespace FluentCassandra.LinqPad.ViewModel
+{
+ /// <summary>
+ /// This class contains static references to all the view models in the
+ /// application and provides an entry point for the bindings.
+ /// </summary>
+ public class ViewModelLocator
+ {
+ private static MainViewModel _main;
+
+ /// <summary>
+ /// Initializes a new instance of the ViewModelLocator class.
+ /// </summary>
+ public ViewModelLocator()
+ {
+ ////if (ViewModelBase.IsInDesignModeStatic)
+ ////{
+ //// // Create design time services and viewmodels
+ ////}
+ ////else
+ ////{
+ //// // Create run time services and view models
+ ////}
+
+ _main = new MainViewModel();
+ }
+
+ /// <summary>
+ /// Gets the Main property which defines the main viewmodel.
+ /// </summary>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance",
+ "CA1822:MarkMembersAsStatic",
+ Justification = "This non-static member is needed for data binding purposes.")]
+ public MainViewModel Main
+ {
+ get
+ {
+ return _main;
+ }
+ }
+ }
+}
View
5 utility/FluentCassandra.LinqPad/header.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<DataContextDriver>
+ <MainAssembly>FluentCassandra.LinqPad.dll</MainAssembly>
+ <SupportUri>https://github.com/managedfusion/fluentcassandra</SupportUri>
+</DataContextDriver>
View
4 utility/FluentCassandra.LinqPad/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="MvvmLight" version="3.1.1" />
+</packages>
Please sign in to comment.
Something went wrong with that request. Please try again.