diff --git a/CosmosClone/CloneConsoleRun/App.config b/CosmosClone/CloneConsoleRun/App.config
index 6f12b01..0ee77ab 100644
--- a/CosmosClone/CloneConsoleRun/App.config
+++ b/CosmosClone/CloneConsoleRun/App.config
@@ -65,6 +65,10 @@
+
+
+
+
\ No newline at end of file
diff --git a/CosmosClone/CloneConsoleRun/CloneConsoleRun.csproj b/CosmosClone/CloneConsoleRun/CloneConsoleRun.csproj
index e5209e4..4314182 100644
--- a/CosmosClone/CloneConsoleRun/CloneConsoleRun.csproj
+++ b/CosmosClone/CloneConsoleRun/CloneConsoleRun.csproj
@@ -11,6 +11,8 @@
v4.6.1
512
true
+
+
AnyCPU
@@ -32,11 +34,36 @@
4
+
+ ..\packages\Microsoft.Azure.CosmosDB.BulkExecutor.1.2.0\lib\net451\Microsoft.Azure.CosmosDB.BulkImport.dll
+
+
+ ..\packages\Microsoft.Azure.DocumentDB.2.1.3\lib\net461\Microsoft.Azure.Documents.Client.dll
+
+
+ ..\packages\MongoDB.Bson.2.4.4\lib\net45\MongoDB.Bson.dll
+
..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll
+
+ ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll
+
+
+ ..\packages\System.Memory.4.5.0\lib\netstandard2.0\System.Memory.dll
+
+
+ ..\packages\System.Net.Http.WinHttpHandler.4.5.0\lib\net461\System.Net.Http.WinHttpHandler.dll
+
+
+
+ ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
+
@@ -47,6 +74,10 @@
+
+
+
+
@@ -59,4 +90,11 @@
+
+
+
+ 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}.
+
+
+
\ No newline at end of file
diff --git a/CosmosClone/CloneConsoleRun/Program.cs b/CosmosClone/CloneConsoleRun/Program.cs
index 8934e25..d989ca9 100644
--- a/CosmosClone/CloneConsoleRun/Program.cs
+++ b/CosmosClone/CloneConsoleRun/Program.cs
@@ -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;
diff --git a/CosmosClone/CosmosCloneCommon/Sample/CosmosSampleDBHelper.cs b/CosmosClone/CloneConsoleRun/Sample/CosmosSampleDBHelper.cs
similarity index 95%
rename from CosmosClone/CosmosCloneCommon/Sample/CosmosSampleDBHelper.cs
rename to CosmosClone/CloneConsoleRun/Sample/CosmosSampleDBHelper.cs
index 98f1fa5..d2cad27 100644
--- a/CosmosClone/CosmosCloneCommon/Sample/CosmosSampleDBHelper.cs
+++ b/CosmosClone/CloneConsoleRun/Sample/CosmosSampleDBHelper.cs
@@ -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;
diff --git a/CosmosClone/CosmosCloneCommon/Sample/Entity.cs b/CosmosClone/CloneConsoleRun/Sample/Entity.cs
similarity index 88%
rename from CosmosClone/CosmosCloneCommon/Sample/Entity.cs
rename to CosmosClone/CloneConsoleRun/Sample/Entity.cs
index 3455208..b3412c8 100644
--- a/CosmosClone/CosmosCloneCommon/Sample/Entity.cs
+++ b/CosmosClone/CloneConsoleRun/Sample/Entity.cs
@@ -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; }
@@ -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;
@@ -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();
@@ -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;
diff --git a/CosmosClone/CosmosCloneCommon/Sample/EntityV2.cs b/CosmosClone/CloneConsoleRun/Sample/EntityV2.cs
similarity index 81%
rename from CosmosClone/CosmosCloneCommon/Sample/EntityV2.cs
rename to CosmosClone/CloneConsoleRun/Sample/EntityV2.cs
index fa224dc..0658f30 100644
--- a/CosmosClone/CosmosCloneCommon/Sample/EntityV2.cs
+++ b/CosmosClone/CloneConsoleRun/Sample/EntityV2.cs
@@ -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; }
@@ -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;
diff --git a/CosmosClone/CosmosCloneCommon/Sample/SampleDBCreator.cs b/CosmosClone/CloneConsoleRun/Sample/SampleDBCreator.cs
similarity index 89%
rename from CosmosClone/CosmosCloneCommon/Sample/SampleDBCreator.cs
rename to CosmosClone/CloneConsoleRun/Sample/SampleDBCreator.cs
index 7574450..49741dc 100644
--- a/CosmosClone/CosmosCloneCommon/Sample/SampleDBCreator.cs
+++ b/CosmosClone/CloneConsoleRun/Sample/SampleDBCreator.cs
@@ -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
diff --git a/CosmosClone/CloneConsoleRun/packages.config b/CosmosClone/CloneConsoleRun/packages.config
index 50e4724..3bdc108 100644
--- a/CosmosClone/CloneConsoleRun/packages.config
+++ b/CosmosClone/CloneConsoleRun/packages.config
@@ -1,4 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CosmosClone/CosmicCloneUI/App.xaml b/CosmosClone/CosmicCloneUI/App.xaml
index bf42e4c..0adc324 100644
--- a/CosmosClone/CosmicCloneUI/App.xaml
+++ b/CosmosClone/CosmicCloneUI/App.xaml
@@ -4,6 +4,36 @@
xmlns:local="clr-namespace:CosmicCloneUI"
StartupUri="MainWindow.xaml">
-
+
+
+
+
+
+
+
+
diff --git a/CosmosClone/CosmicCloneUI/CloneOptionsPage.xaml b/CosmosClone/CosmicCloneUI/CloneOptionsPage.xaml
index 16c22b5..aacdc40 100644
--- a/CosmosClone/CosmicCloneUI/CloneOptionsPage.xaml
+++ b/CosmosClone/CosmicCloneUI/CloneOptionsPage.xaml
@@ -7,45 +7,17 @@
mc:Ignorable="d"
d:DesignHeight="320" d:DesignWidth="800"
Title="CloneOptionsPage">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Select Options for Copying Collection
+
+
+
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/CosmosClone/CosmicCloneUI/CopyCollectionPage.xaml b/CosmosClone/CosmicCloneUI/CopyCollectionPage.xaml
index 6c3f7e9..a366783 100644
--- a/CosmosClone/CosmicCloneUI/CopyCollectionPage.xaml
+++ b/CosmosClone/CosmicCloneUI/CopyCollectionPage.xaml
@@ -7,34 +7,34 @@
mc:Ignorable="d"
d:DesignHeight="320" d:DesignWidth="800"
Title="CopyCollectionPage">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/CosmosClone/CosmicCloneUI/DataAnonymizationPage.xaml b/CosmosClone/CosmicCloneUI/DataAnonymizationPage.xaml
index 37c1edb..57ec9f2 100644
--- a/CosmosClone/CosmicCloneUI/DataAnonymizationPage.xaml
+++ b/CosmosClone/CosmicCloneUI/DataAnonymizationPage.xaml
@@ -9,56 +9,31 @@
Title="DataAnonymizationPage">
-
-
- Enter
- Data Anonymization
- rules
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Enter Data Anonymization rules
+
+
+
+
+
+
+
-
-
+
+
+
diff --git a/CosmosClone/CosmicCloneUI/DataAnonymizationPage.xaml.cs b/CosmosClone/CosmicCloneUI/DataAnonymizationPage.xaml.cs
index b4afa94..beaaa01 100644
--- a/CosmosClone/CosmicCloneUI/DataAnonymizationPage.xaml.cs
+++ b/CosmosClone/CosmicCloneUI/DataAnonymizationPage.xaml.cs
@@ -51,18 +51,11 @@ private void BtnAddScrubRule(object sender, RoutedEventArgs e)
private void CreateScrubRule(ScrubRule scrubRule = null)
{
- StackPanel parentStackPanelLeft = (StackPanel)this.FindName("RulesStackPanelLeft");
- StackPanel parentStackPanelRight = (StackPanel)this.FindName("RulesStackPanelRight");
-
+
+ WrapPanel parentStackPanelLeft = (WrapPanel) this.FindName("WrapPanel");
+
int newRuleIndex = newIndex(scrubRule);
- if (newRuleIndex % 2 == 1)
- {
- AddRuleWithData(parentStackPanelLeft, newRuleIndex, scrubRule);
- }
- else
- {
- AddRuleWithData(parentStackPanelRight, newRuleIndex, scrubRule);
- }
+ AddRuleWithData(parentStackPanelLeft, newRuleIndex, scrubRule);
}
int newIndex(ScrubRule scrubRule = null)
@@ -82,7 +75,7 @@ int newIndex(ScrubRule scrubRule = null)
}
return newRuleIndex;
}
- void AddRuleWithData(StackPanel parentStackPanel, int ruleIndex, ScrubRule scrubRule = null)
+ void AddRuleWithData(WrapPanel parentStackPanel, int ruleIndex, ScrubRule scrubRule = null)
{
StackPanel RuleHeadersp = new StackPanel();
RuleHeadersp.Orientation = Orientation.Horizontal;
@@ -284,30 +277,20 @@ private void DeleteBtn_Click(object sender, RoutedEventArgs e)
var btnDelete = (Button)sender;
string expname = "RuleExpander_" + btnDelete.Name.Substring(btnDelete.Name.IndexOf('_')+1);
- StackPanel parentStackPanel = (StackPanel)this.FindName("RulesStackPanel");
- UIElementCollection ChildrenSPs = parentStackPanel.Children;
- foreach (UIElement LeftRightSPUI in ChildrenSPs)
+ WrapPanel wrapPanel = (WrapPanel)this.FindName("WrapPanel");
+ foreach (UIElement SPUI in wrapPanel.Children)
{
- StackPanel sp = (StackPanel)LeftRightSPUI;
- UIElementCollection uiElementsLeftRight = sp.Children;
-
- foreach (UIElement SPUI in uiElementsLeftRight)
+ Expander exp = (Expander)SPUI;
+ if (exp.Name == expname)
{
- Expander exp = (Expander)SPUI;
- if (exp.Name == expname)
- {
- sp.Children.Remove(SPUI);
- break;
- }
+ wrapPanel.Children.Remove(SPUI);
+ break;
}
}
var rules = getScrubRules();
//Delete all scrub rules
- StackPanel parentStackPanelLeft = (StackPanel)this.FindName("RulesStackPanelLeft");
- StackPanel parentStackPanelRight = (StackPanel)this.FindName("RulesStackPanelRight");
- parentStackPanelLeft.Children.RemoveRange(0, parentStackPanelLeft.Children.Count);
- parentStackPanelRight.Children.RemoveRange(0, parentStackPanelRight.Children.Count);
+ wrapPanel.Children.RemoveRange(0, wrapPanel.Children.Count);
//Re initialize rule index
this.RuleIndex = 1;
@@ -322,87 +305,82 @@ private void DeleteBtn_Click(object sender, RoutedEventArgs e)
public List getScrubRules()
{
//List sb = new List();
- TextBox filterCondition = (TextBox)this.FindName("FilterCondition");
+ TextBox filterCondition = (TextBox) this.FindName("FilterCondition");
//sb.filterQuery = filterCondition.Text;
- List srList = new List();
-
- StackPanel parentStackPanel = (StackPanel)this.FindName("RulesStackPanel");
- UIElementCollection ChildrenSPs = parentStackPanel.Children;
+ List srList = new List();
- foreach (UIElement LeftRightSPUI in ChildrenSPs)
+ WrapPanel wrapPanel = (WrapPanel) this.FindName("WrapPanel");
+ foreach (UIElement SPUI in wrapPanel.Children)
{
- StackPanel sp = (StackPanel)LeftRightSPUI;
- UIElementCollection uiElementsLeftRight = sp.Children;
+ Expander exp = (Expander) SPUI;
+ StackPanel lrsp = (StackPanel) exp.Content;
+ UIElementCollection uiElementsSP = lrsp.Children;
- foreach (UIElement SPUI in uiElementsLeftRight)
- {
- Expander exp = (Expander)SPUI;
- StackPanel lrsp = (StackPanel)exp.Content;
- UIElementCollection uiElementsSP = lrsp.Children;
+ ScrubRule sr = new ScrubRule();
- ScrubRule sr = new ScrubRule();
+ foreach (UIElement uiElementSP in uiElementsSP)
+ {
+ StackPanel tempSP = (StackPanel) uiElementSP;
+ UIElementCollection uiElements = tempSP.Children;
- foreach (UIElement uiElementSP in uiElementsSP)
+ foreach (UIElement uiElement in uiElements)
{
- StackPanel tempSP = (StackPanel)uiElementSP;
- UIElementCollection uiElements = tempSP.Children;
-
- foreach (UIElement uiElement in uiElements)
+ if (uiElement.GetType().Name == "Label")
{
- if (uiElement.GetType().Name == "Label")
+ var ruleIdLabel = (Label) uiElement;
+ int ruleId;
+ if (int.TryParse(ruleIdLabel.Content.ToString(), out ruleId))
{
- var ruleIdLabel = (Label)uiElement;
- int ruleId;
- if (int.TryParse(ruleIdLabel.Content.ToString(), out ruleId))
- {
- sr.RuleId = ruleId;
- }
- else sr.RuleId = 0;
+ sr.RuleId = ruleId;
+ }
+ else sr.RuleId = 0;
+ }
+
+ if (uiElement.GetType().Name == "TextBox")
+ {
+ TextBox tb = (TextBox) uiElement;
+ string name = tb.Name.Substring(0, tb.Name.Length - 1);
+
+ if (name == "Filter")
+ {
+ sr.FilterCondition = tb.Text.Trim();
+ }
+ else if (name == "ScrubAttribute")
+ {
+ sr.PropertyName = tb.Text.Trim();
+ }
+ else if (name == "ScrubValue")
+ {
+ sr.UpdateValue = tb.Text.Trim();
}
+ }
- if (uiElement.GetType().Name == "TextBox")
+ if (uiElement.GetType().Name == "ComboBox")
+ {
+ ComboBox cb = (ComboBox) uiElement;
+ string name = cb.Name.Substring(0, cb.Name.Length - 1);
+ if (name == "ScrubType")
{
- TextBox tb = (TextBox)uiElement;
- string name = tb.Name.Substring(0, tb.Name.Length - 1);
+ //sr.Type = (RuleType) Enum.Parse(typeof(RuleType), cb.Text);
+ RuleType rType;
- if (name == "Filter")
+ if (Enum.TryParse(cb.Text, out rType))
{
- sr.FilterCondition = tb.Text.Trim();
+ sr.Type = rType;
}
- else if (name == "ScrubAttribute")
+ else
{
- sr.PropertyName = tb.Text.Trim();
- }
- else if (name == "ScrubValue")
- {
- sr.UpdateValue = tb.Text.Trim();
- }
- }
- if (uiElement.GetType().Name == "ComboBox")
- {
- ComboBox cb = (ComboBox)uiElement;
- string name = cb.Name.Substring(0, cb.Name.Length - 1);
- if (name == "ScrubType")
- {
- //sr.Type = (RuleType) Enum.Parse(typeof(RuleType), cb.Text);
- RuleType rType;
-
- if (Enum.TryParse(cb.Text, out rType))
- {
- sr.Type = rType;
- }
- else
- {
- sr.Type = null;
- }
+ sr.Type = null;
}
}
}
-
}
- srList.Add(sr);
- }
+
+ }
+
+ srList.Add(sr);
}
+
return srList;
}
@@ -497,10 +475,8 @@ private void LoadRuleButton_Click(object sender, RoutedEventArgs e)
var orderedRules = rules.OrderBy(o => o.RuleId).ToList();
//Delete all scrub rules
- StackPanel parentStackPanelLeft = (StackPanel)this.FindName("RulesStackPanelLeft");
- StackPanel parentStackPanelRight = (StackPanel)this.FindName("RulesStackPanelRight");
- parentStackPanelLeft.Children.RemoveRange(0, parentStackPanelLeft.Children.Count);
- parentStackPanelRight.Children.RemoveRange(0, parentStackPanelRight.Children.Count);
+ WrapPanel wrapPanel = (WrapPanel)this.FindName("WrapPanel");
+ wrapPanel.Children.Clear();
//Re initialize rule index
this.RuleIndex = 1;
diff --git a/CosmosClone/CosmicCloneUI/DestinationPage.xaml b/CosmosClone/CosmicCloneUI/DestinationPage.xaml
index f70ca8e..f70074c 100644
--- a/CosmosClone/CosmicCloneUI/DestinationPage.xaml
+++ b/CosmosClone/CosmicCloneUI/DestinationPage.xaml
@@ -9,38 +9,40 @@
Title="DestinationPage">
-
-
-
- Enter
- Target
- connection details
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Enter Target connection details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CosmosClone/CosmicCloneUI/MainWindow.xaml b/CosmosClone/CosmicCloneUI/MainWindow.xaml
index 893a58c..55e6013 100644
--- a/CosmosClone/CosmicCloneUI/MainWindow.xaml
+++ b/CosmosClone/CosmicCloneUI/MainWindow.xaml
@@ -5,31 +5,26 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CosmicCloneUI"
mc:Ignorable="d"
- Title="CosmicClone v2.0" Height="500" Width="800" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Icon="/Images/CosmosIcon2.ico">
+ Title="CosmicClone v2.0" Height="500" Width="797" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Icon="/Images/CosmosIcon2.ico">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CosmosClone/CosmicCloneUI/SourcePage.xaml b/CosmosClone/CosmicCloneUI/SourcePage.xaml
index d6f110a..16ccce5 100644
--- a/CosmosClone/CosmicCloneUI/SourcePage.xaml
+++ b/CosmosClone/CosmicCloneUI/SourcePage.xaml
@@ -9,39 +9,39 @@
Title="SourcePage">
-
-
-
- Enter
- Source
- connection details
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Enter Source connection details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CosmosClone/CosmosCloneCommon/CosmosCloneCommon.csproj b/CosmosClone/CosmosCloneCommon/CosmosCloneCommon.csproj
index f3ffbbf..4e1c594 100644
--- a/CosmosClone/CosmosCloneCommon/CosmosCloneCommon.csproj
+++ b/CosmosClone/CosmosCloneCommon/CosmosCloneCommon.csproj
@@ -79,10 +79,6 @@
-
-
-
-
diff --git a/CosmosClone/CosmosCloneCommon/Model/RandomNumberGenerator.cs b/CosmosClone/CosmosCloneCommon/Model/RandomNumberGenerator.cs
index cb05eaa..c7e8d1a 100644
--- a/CosmosClone/CosmosCloneCommon/Model/RandomNumberGenerator.cs
+++ b/CosmosClone/CosmosCloneCommon/Model/RandomNumberGenerator.cs
@@ -1,53 +1,40 @@
// 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;
-using System.Threading.Tasks;
-
namespace CosmosCloneCommon.Model
{
+ using System;
+ using System.Collections.Generic;
+ using System.Threading;
+
public static class RandomNumberGenerator
{
- private static Random _random;
- static RandomNumberGenerator()
+ private static readonly Random _random = new Random(unchecked(Environment.TickCount * 31 + Thread.CurrentThread.ManagedThreadId));;
+
+ public static int GetNext(int maxValue)
{
- _random = new Random(unchecked(Environment.TickCount * 31 + Thread.CurrentThread.ManagedThreadId));
- _random.Next();
- }
- public static int getNext(int maxValue)
- {
- _random.Next();
- _random.Next(0, maxValue);
return _random.Next(0,maxValue);
}
- public static int getNext()
+ public static int GetNext()
{
return _random.Next(1, 99999999);
}
public static string GetRandomEntityType()
{
- string returnvalue;
- switch (RandomNumberGenerator.getNext() % 5)
+ switch (RandomNumberGenerator.GetNext(5))
{
case 1:
- returnvalue = "Individual"; break;
+ return "Individual";
case 2:
- returnvalue = "Organization"; break;
+ return "Organization";
case 3:
- returnvalue = "Supplier"; break;
+ return "Supplier";
case 4:
- returnvalue = "Partner"; break;
+ return "Partner";
case 0:
- returnvalue = "External"; break;
+ return "External";
default:
- returnvalue = "External"; break;
+ return "External";
}
- return returnvalue;
}
//A simple implementation of Fisher yates algorithm for shuffling
@@ -57,12 +44,13 @@ public static List Shuffle(List list)
while (n > 1)
{
n--;
- int k = RandomNumberGenerator.getNext(n + 1);
+ int k = RandomNumberGenerator.GetNext(n + 1);
T value = list[k];
list[k] = list[n];
list[n] = value;
}
+
return list;
}
}
-}
+}
\ No newline at end of file
diff --git a/CosmosClone/CosmosCloneCommon/Utility/ObjectScrubber.cs b/CosmosClone/CosmosCloneCommon/Utility/ObjectScrubber.cs
index 8163d9f..a60577f 100644
--- a/CosmosClone/CosmosCloneCommon/Utility/ObjectScrubber.cs
+++ b/CosmosClone/CosmosCloneCommon/Utility/ObjectScrubber.cs
@@ -4,12 +4,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using CosmosCloneCommon.Model;
-using CosmosCloneCommon.Sample;
namespace CosmosCloneCommon.Utility
{