From 76b22e4d05cbd8d771f678e4b5adc2dc5159afa8 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 14 Nov 2020 22:02:45 +0200 Subject: Moved data store projects to DataStore folder. --- .../Tango.DataStore.Editing/CustomControl1.cs | 25 ++++ .../DataStoreCollectionModel.cs | 29 +++++ .../Tango.DataStore.Editing/DataStoreItemModel.cs | 140 +++++++++++++++++++++ .../Tango.DataStore.Editing/DataStoreModel.cs | 20 +++ .../Properties/AssemblyInfo.cs | 55 ++++++++ .../Properties/Resources.Designer.cs | 62 +++++++++ .../Properties/Resources.resx | 117 +++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Properties/Settings.settings | 7 ++ .../Tango.DataStore.Editing.csproj | 106 ++++++++++++++++ .../Tango.DataStore.Editing/Themes/Generic.xaml | 18 +++ .../UpdateDataStoreRequest.cs | 21 ++++ .../UpdateDataStoreResponse.cs | 13 ++ 13 files changed, 643 insertions(+) create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/CustomControl1.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreCollectionModel.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreItemModel.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreModel.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Resources.resx create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Settings.settings create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Themes/Generic.xaml create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreRequest.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreResponse.cs (limited to 'Software/Visual_Studio/DataStore/Tango.DataStore.Editing') diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/CustomControl1.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/CustomControl1.cs new file mode 100644 index 000000000..fab0127e8 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/CustomControl1.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.DataStore.Editing +{ + public class CustomControl1 : Control + { + static CustomControl1() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1))); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreCollectionModel.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreCollectionModel.cs new file mode 100644 index 000000000..3e58aa4b1 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreCollectionModel.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.DataStore.Editing +{ + public class DataStoreCollectionModel : ExtendedObject + { + public String Name { get; set; } + public ObservableCollection Items { get; set; } + public bool IsDeleted { get; set; } + + private bool _isSelected; + public bool IsSelected + { + get { return _isSelected; } + set { _isSelected = value; RaisePropertyChangedAuto(); Items.ToList().ForEach(x => x.IsSelected = value); } + } + + public DataStoreCollectionModel() + { + Items = new ObservableCollection(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreItemModel.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreItemModel.cs new file mode 100644 index 000000000..3b1741395 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreItemModel.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.DataStore.Editing +{ + public class DataStoreItemModel : ExtendedObject, IDataStoreItem + { + public IDataStoreItem GlobalItem { get; set; } + + public DataType OriginalType { get; set; } + public Object OriginalValue { get; set; } + + private Object _value; + public Object Value + { + get { return _value; } + set { _value = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasDifference)); RaisePropertyChanged(nameof(FormattedValue)); } + } + + private bool _isSelected; + public bool IsSelected + { + get { return _isSelected; } + set { _isSelected = value; RaisePropertyChangedAuto(); } + } + + public bool HasDifference + { + get + { + if (OriginalType != Type) + { + return true; + } + + if (OriginalType == DataType.Bytes && Type == DataType.Bytes) + { + if (OriginalValue != null && Value != null) + { + return !Enumerable.SequenceEqual(OriginalValue as byte[], Value as byte[]); + } + } + + if (Value == null && OriginalValue == null) return false; + + return !OriginalValue.ToStringSafe().Equals(Value.ToStringSafe()) || (IsGlobal && GlobalItem.Value != Value); + } + } + + public String FormattedValue + { + get { return this.ToString().ToOneLine(); } + } + + public string Guid { get; set; } + public string Key { get; set; } + + private DataType _type; + public DataType Type + { + get { return _type; } + set { _type = value; RaisePropertyChangedAuto(); } + } + + private DateTime _date; + public DateTime Date + { + get { return _date; } + set { _date = value; RaisePropertyChangedAuto(); } + } + + public bool IsSynchronized { get; set; } + public bool ExistsOnMachine { get; set; } + + private bool _isGlobal; + public bool IsGlobal + { + get { return _isGlobal; } + set { _isGlobal = value; RaisePropertyChangedAuto(); } + } + + private bool _isDeleted; + public bool IsDeleted + { + get { return _isDeleted; } + set { _isDeleted = value; RaisePropertyChangedAuto(); } + } + + public static DataStoreItemModel FromLocalDataStoreItem(IDataStoreItem local, IDataStoreItem globalItem) + { + DataStoreItemModel model = new DataStoreItemModel(); + + model.OriginalValue = local.Value; + model.Value = local.Value; + model.Guid = local.Guid; + model.Key = local.Key; + model.OriginalType = local.Type; + model.Type = local.Type; + model.Date = local.Date; + model.IsGlobal = false; + model.IsSynchronized = local.IsSynchronized; + + model.GlobalItem = globalItem; + + return model; + } + + public static DataStoreItemModel FromGlobalDataStoreItem(IDataStoreItem global) + { + DataStoreItemModel model = new DataStoreItemModel(); + + model.GlobalItem = global; + model.Guid = global.Guid; + model.Key = global.Key; + model.Type = global.Type; + model.OriginalType = global.Type; + model.Date = global.Date; + model.IsGlobal = true; + model.IsSynchronized = global.IsSynchronized; + + return model; + } + + public override string ToString() + { + if (this.Value != null) + { + return DataStoreHelper.FormatDataStoreItem(this); + } + else + { + return null; + } + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreModel.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreModel.cs new file mode 100644 index 000000000..a68cc0af9 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/DataStoreModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.DataStore.Editing +{ + public class DataStoreModel : ExtendedObject + { + public ObservableCollection Collections { get; set; } + + public DataStoreModel() + { + Collections = new ObservableCollection(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/AssemblyInfo.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..9f04af8ea --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("Tango.DataStore.Editing")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.DataStore.Editing")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[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)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// 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")] diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Resources.Designer.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Resources.Designer.cs new file mode 100644 index 000000000..c23f8f4eb --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DataStore.Editing.Properties { + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.DataStore.Editing.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Resources.resx b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Settings.Designer.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Settings.Designer.cs new file mode 100644 index 000000000..28f49dcd4 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DataStore.Editing.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Settings.settings b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj new file mode 100644 index 000000000..b7da15e51 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj @@ -0,0 +1,106 @@ + + + + + Debug + AnyCPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C} + library + Tango.DataStore.Editing + Tango.DataStore.Editing + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + + + MSBuild:Compile + Designer + + + Code + + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Themes/Generic.xaml b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Themes/Generic.xaml new file mode 100644 index 000000000..795842292 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/Themes/Generic.xaml @@ -0,0 +1,18 @@ + + + diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreRequest.cs new file mode 100644 index 000000000..dc95ea6ae --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreRequest.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.DTO; + +namespace Tango.DataStore.Editing +{ + public class UpdateDataStoreRequest + { + public List ToDelete { get; set; } + public List ToUpsert { get; set; } + + public UpdateDataStoreRequest() + { + ToDelete = new List(); + ToUpsert = new List(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreResponse.cs new file mode 100644 index 000000000..697ae341d --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Editing +{ + public class UpdateDataStoreResponse + { + + } +} -- cgit v1.3.1