Skip to content

Commit

Permalink
Merge pull request #6 from MichalJankowskii/master
Browse files Browse the repository at this point in the history
UI improvements
  • Loading branch information
kranthimeda authored Apr 1, 2019
2 parents 93ccd5d + c6dbe66 commit 019a668
Show file tree
Hide file tree
Showing 19 changed files with 357 additions and 391 deletions.
4 changes: 4 additions & 0 deletions CosmosClone/CloneConsoleRun/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
38 changes: 38 additions & 0 deletions CosmosClone/CloneConsoleRun/CloneConsoleRun.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -32,11 +34,36 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.CosmosDB.BulkImport, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.CosmosDB.BulkExecutor.1.2.0\lib\net451\Microsoft.Azure.CosmosDB.BulkImport.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Documents.Client, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.DocumentDB.2.1.3\lib\net461\Microsoft.Azure.Documents.Client.dll</HintPath>
</Reference>
<Reference Include="MongoDB.Bson, Version=2.4.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MongoDB.Bson.2.4.4\lib\net45\MongoDB.Bson.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.0\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WinHttpHandler, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.WinHttpHandler.4.5.0\lib\net461\System.Net.Http.WinHttpHandler.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -47,6 +74,10 @@
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Sample\CosmosSampleDBHelper.cs" />
<Compile Include="Sample\Entity.cs" />
<Compile Include="Sample\EntityV2.cs" />
<Compile Include="Sample\SampleDBCreator.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand All @@ -59,4 +90,11 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Azure.DocumentDB.2.1.3\build\Microsoft.Azure.DocumentDB.targets" Condition="Exists('..\packages\Microsoft.Azure.DocumentDB.2.1.3\build\Microsoft.Azure.DocumentDB.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Azure.DocumentDB.2.1.3\build\Microsoft.Azure.DocumentDB.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Azure.DocumentDB.2.1.3\build\Microsoft.Azure.DocumentDB.targets'))" />
</Target>
</Project>
1 change: 0 additions & 1 deletion CosmosClone/CloneConsoleRun/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using CosmosCloneCommon;
using CosmosCloneCommon.Migrator;
using CosmosCloneCommon.Model;
using CosmosCloneCommon.Sample;
using CosmosCloneCommon.Utility;
using logger = CosmosCloneCommon.Utility.CloneLogger;
using Newtonsoft.Json;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Documents.Client;
using Microsoft.Azure.Documents;
using CosmosCloneCommon.Model;
using logger = CosmosCloneCommon.Utility.CloneLogger;
using CosmosCloneCommon.Utility;

namespace CosmosCloneCommon.Sample
namespace CloneConsoleRun.Sample
{
using System;
using System.Threading.Tasks;
using CosmosCloneCommon.Utility;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Client;

public class CosmosSampleDBHelper
{
private ConnectionPolicy ConnectionPolicy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
// Licensed under the MIT License.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using CosmosCloneCommon.Model;

namespace CosmosCloneCommon.Sample
namespace CloneConsoleRun.Sample
{
using System;
using System.Collections.Generic;
using CosmosCloneCommon.Model;

public class Entity
{
public int Id { get; set; }
Expand All @@ -25,7 +21,7 @@ public class Entity
public static Entity getRandomEntity()
{
var entity = new Entity();
entity.Id = RandomNumberGenerator.getNext();
entity.Id = RandomNumberGenerator.GetNext();
entity.Name = "Test Sample Name " + entity.Id.ToString();
entity.Description = "Test Sample Description " + entity.Id.ToString();
entity.IsActive = true;
Expand Down Expand Up @@ -58,10 +54,10 @@ public static CompositeEntity getRandomCompositeEntity()
{
var compositeEntity = new CompositeEntity();
compositeEntity.id = Guid.NewGuid().ToString();
compositeEntity.EmployeeId = RandomNumberGenerator.getNext().ToString();
compositeEntity.EmployeeId = RandomNumberGenerator.GetNext().ToString();
compositeEntity.EntityType = RandomNumberGenerator.GetRandomEntityType();
compositeEntity.CompositeName = "Test Sample CompositeName " + RandomNumberGenerator.getNext();
compositeEntity.EmailAddress = "test" + RandomNumberGenerator.getNext() + "@microsoft.com";
compositeEntity.CompositeName = "Test Sample CompositeName " + RandomNumberGenerator.GetNext();
compositeEntity.EmailAddress = "test" + RandomNumberGenerator.GetNext() + "@microsoft.com";
compositeEntity.EntityValue = Entity.getRandomEntity();

compositeEntity.SuperKeys = new List<EntityKey>();
Expand All @@ -82,7 +78,7 @@ public class EntityKey
public static EntityKey getRandomEntityKey()
{
var entityKey = new EntityKey();
entityKey.KeyId = RandomNumberGenerator.getNext().ToString();
entityKey.KeyId = RandomNumberGenerator.GetNext().ToString();
entityKey.KeyName = "TestKeyName-" + entityKey.KeyId.ToString();
entityKey.KeyValue = "TestKeyValue-" + entityKey.KeyId.ToString();
return entityKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using CosmosCloneCommon.Model;

namespace CosmosCloneCommon.Sample
namespace CloneConsoleRun.Sample
{
using System;
using System.Collections.Generic;
using CosmosCloneCommon.Model;

public class EntityV2
{
public string FullName { get; set; }
Expand All @@ -28,14 +24,14 @@ public class EntityV2
public static EntityV2 getRandomEntity()
{
var entity = new EntityV2();
entity.SuperId = RandomNumberGenerator.getNext();
entity.SuperId = RandomNumberGenerator.GetNext();
entity.id = Guid.NewGuid().ToString();
entity.FullName = "Test Sample Name " + entity.SuperId.ToString();
entity.Description = "Test Sample Description " + entity.SuperId.ToString();
entity.EntityType = RandomNumberGenerator.GetRandomEntityType();
var employeeid = RandomNumberGenerator.getNext();
var employeeid = RandomNumberGenerator.GetNext();
entity.EmailAddress = "intialTest"+ employeeid .ToString()+ "@test.com";
entity.PhoneNumber = RandomNumberGenerator.getNext().ToString();
entity.PhoneNumber = RandomNumberGenerator.GetNext().ToString();
entity.IsActive = true;
entity.ModifiedTime = DateTime.UtcNow;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
// Licensed under the MIT License.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Client;
using CosmosCloneCommon.Utility;
//using CollectionMigrator.Model;
using System.Diagnostics;
using Microsoft.Azure.CosmosDB.BulkExecutor;
using Microsoft.Azure.CosmosDB.BulkExecutor.BulkImport;
using Microsoft.Azure.Documents.Linq;
using logger = CosmosCloneCommon.Utility.CloneLogger;

namespace CosmosCloneCommon.Sample
namespace CloneConsoleRun.Sample
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using CosmosCloneCommon.Utility;
using Microsoft.Azure.CosmosDB.BulkExecutor.BulkImport;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Client;

public class SampleDBCreator
{
#region declare variables
Expand Down
8 changes: 8 additions & 0 deletions CosmosClone/CloneConsoleRun/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Azure.CosmosDB.BulkExecutor" version="1.2.0" targetFramework="net461" />
<package id="Microsoft.Azure.DocumentDB" version="2.1.3" targetFramework="net461" />
<package id="MongoDB.Bson" version="2.4.4" targetFramework="net461" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net461" />
<package id="System.Buffers" version="4.5.0" targetFramework="net461" />
<package id="System.Memory" version="4.5.0" targetFramework="net461" />
<package id="System.Net.Http.WinHttpHandler" version="4.5.0" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.0" targetFramework="net461" />
</packages>
32 changes: 31 additions & 1 deletion CosmosClone/CosmicCloneUI/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@
xmlns:local="clr-namespace:CosmicCloneUI"
StartupUri="MainWindow.xaml">
<Application.Resources>

<Style x:Key="BaseFontSize" TargetType="Control">
<Setter Property="FontSize" Value="15px"/>
</Style>
<Style x:Key="GridRowLabelStyle" TargetType="Label" BasedOn="{StaticResource BaseFontSize}">
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style x:Key="TextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource BaseFontSize}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Right"/>
<Setter Property="Width" Value="80px"/>
<Setter Property="Margin" Value="10 0 0 0"/>
</Style>
<Style x:Key="GridRowTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource BaseFontSize}">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="CheckBoxStyle" TargetType="CheckBox" BasedOn="{StaticResource BaseFontSize}">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="IsChecked" Value="True"/>
<Setter Property="Margin" Value="0 0 0 10"/>
</Style>
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="15px"/>
<Setter Property="Margin" Value="0 0 0 10"/>
</Style>
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="Width" Value="100px"/>
<Setter Property="Margin" Value="10 0 0 0"/>
</Style>
<Style x:Key="ProgressBarStyle" TargetType="ProgressBar">
<Setter Property="Height" Value="15px"/>
</Style>
</Application.Resources>
</Application>
54 changes: 13 additions & 41 deletions CosmosClone/CosmicCloneUI/CloneOptionsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,17 @@
mc:Ignorable="d"
d:DesignHeight="320" d:DesignWidth="800"
Title="CloneOptionsPage">

<Grid>
<StackPanel>
<Label Content="Select Options for Copying Collection" FontSize="15" />
<StackPanel Orientation="Horizontal" Margin="20,20,0,0">
<CheckBox x:Name="Documents" VerticalAlignment="Center" IsChecked="True"/>
<TextBlock Text="Documents" FontSize="15" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="20,20,0,0">
<CheckBox x:Name="SPs" VerticalAlignment="Center" IsChecked="True"/>
<TextBlock Text="Stored Procedures" FontSize="15" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="20,20,0,0">
<CheckBox x:Name="UDFs" VerticalAlignment="Center" IsChecked="True"/>
<TextBlock Text="User Defined Functions" FontSize="15" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="20,20,0,0">
<CheckBox x:Name="CosmosTriggers" VerticalAlignment="Center" IsChecked="True"/>
<TextBlock Text="Triggers" FontSize="15" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="20,20,0,0">
<CheckBox x:Name="IPs" VerticalAlignment="Center" IsChecked="True"/>
<TextBlock Text="Indexing Policies" FontSize="15" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>


<StackPanel Orientation="Horizontal" Margin="20,20,0,0">
<CheckBox x:Name="PKs" VerticalAlignment="Center" IsChecked="True"/>
<TextBlock Text="Partition Keys" FontSize="15" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>


<StackPanel Orientation="Horizontal" Margin="20,20,0,0">
<TextBlock Text="Offer Throughput" FontSize="15" VerticalAlignment="Center" Margin="10,0,0,0"/>
<TextBox x:Name="OfferThroughput" Text="10000" HorizontalContentAlignment="Right" Width="80" Margin="10,0,0,0" />
</StackPanel>
<StackPanel>
<TextBlock Style="{StaticResource TextBlockStyle}">Select Options for Copying Collection</TextBlock>
<CheckBox x:Name="Documents" Content="Documents" Style="{StaticResource CheckBoxStyle}"/>
<CheckBox x:Name="SPs" Content="Stored Procedures" Style="{StaticResource CheckBoxStyle}"/>
<CheckBox x:Name="UDFs" Content="User Defined Functions" Style="{StaticResource CheckBoxStyle}"/>
<CheckBox x:Name="CosmosTriggers" Content="Triggers" Style="{StaticResource CheckBoxStyle}"/>
<CheckBox x:Name="IPs" Content="Indexing Policies" Style="{StaticResource CheckBoxStyle}"/>
<CheckBox x:Name="PKs" Content="Partition Keys" Style="{StaticResource CheckBoxStyle}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Offer Throughput" Style="{StaticResource TextBlockStyle}"/>
<TextBox x:Name="OfferThroughput" Text="10000" Style="{StaticResource TextBoxStyle}" VerticalAlignment="Top"/>
</StackPanel>
</Grid>
</Page>
</StackPanel>
</Page>
Loading

0 comments on commit 019a668

Please sign in to comment.