From 36dcf50eec20835ab1955932e89f9c6ffc68acde Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 21 Nov 2018 14:30:01 +0200 Subject: Working on Touch FileExplorer ! --- .../Tango.Explorer/ExplorerControl.cs | 115 +++++++++++++++++ .../Tango.Explorer/ExplorerFileDefinition.cs | 88 +++++++++++++ .../Tango.Explorer/ExplorerFileItem.cs | 27 ++++ .../Tango.Explorer/ExplorerFolderItem.cs | 56 ++++++++ .../Visual_Studio/Tango.Explorer/ExplorerItem.cs | 17 +++ .../Visual_Studio/Tango.Explorer/Images/color.png | Bin 0 -> 2287 bytes .../Visual_Studio/Tango.Explorer/Images/file.png | Bin 0 -> 1184 bytes .../Visual_Studio/Tango.Explorer/Images/folder.png | Bin 0 -> 756 bytes .../Visual_Studio/Tango.Explorer/Images/job.png | Bin 0 -> 6419 bytes .../Visual_Studio/Tango.Explorer/Images/pulse.png | Bin 0 -> 9007 bytes .../Visual_Studio/Tango.Explorer/Images/update.png | Bin 0 -> 1331 bytes .../Tango.Explorer/Properties/AssemblyInfo.cs | 18 +++ .../Properties/Resources.Designer.cs | 62 +++++++++ .../Tango.Explorer/Properties/Resources.resx | 117 +++++++++++++++++ .../Tango.Explorer/Properties/Settings.Designer.cs | 30 +++++ .../Tango.Explorer/Properties/Settings.settings | 7 + .../Tango.Explorer/Tango.Explorer.csproj | 114 +++++++++++++++++ .../Tango.Explorer/Themes/Generic.xaml | 36 ++++++ .../Tango.Hive/Properties/AssemblyInfo.cs | 15 ++- .../Tango.Touch/Controls/TouchListBox.cs | 7 +- Software/Visual_Studio/Tango.sln | 42 ++++++ .../Utilities/Tango.UITests/MainWindow.xaml | 14 +- .../Utilities/Tango.UITests/MainWindow.xaml.cs | 141 +-------------------- .../Utilities/Tango.UITests/Tango.UITests.csproj | 6 +- 24 files changed, 765 insertions(+), 147 deletions(-) create mode 100644 Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs create mode 100644 Software/Visual_Studio/Tango.Explorer/ExplorerFileDefinition.cs create mode 100644 Software/Visual_Studio/Tango.Explorer/ExplorerFileItem.cs create mode 100644 Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs create mode 100644 Software/Visual_Studio/Tango.Explorer/ExplorerItem.cs create mode 100644 Software/Visual_Studio/Tango.Explorer/Images/color.png create mode 100644 Software/Visual_Studio/Tango.Explorer/Images/file.png create mode 100644 Software/Visual_Studio/Tango.Explorer/Images/folder.png create mode 100644 Software/Visual_Studio/Tango.Explorer/Images/job.png create mode 100644 Software/Visual_Studio/Tango.Explorer/Images/pulse.png create mode 100644 Software/Visual_Studio/Tango.Explorer/Images/update.png create mode 100644 Software/Visual_Studio/Tango.Explorer/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/Tango.Explorer/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/Tango.Explorer/Properties/Resources.resx create mode 100644 Software/Visual_Studio/Tango.Explorer/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/Tango.Explorer/Properties/Settings.settings create mode 100644 Software/Visual_Studio/Tango.Explorer/Tango.Explorer.csproj create mode 100644 Software/Visual_Studio/Tango.Explorer/Themes/Generic.xaml (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs new file mode 100644 index 000000000..6f276f184 --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.IO; +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; +using Tango.Core.Commands; + +namespace Tango.Explorer +{ + public class ExplorerControl : Control + { + private bool _changing_current_path; + + public String CurrentPath + { + get { return (String)GetValue(CurrentPathProperty); } + set { SetValue(CurrentPathProperty, value); } + } + public static readonly DependencyProperty CurrentPathProperty = + DependencyProperty.Register("CurrentPath", typeof(String), typeof(ExplorerControl), new PropertyMetadata(null, (d, e) => (d as ExplorerControl).OnCurrentPathChanged())); + + public ExplorerFolderItem CurrentFolder + { + get { return (ExplorerFolderItem)GetValue(CurrentFolderProperty); } + set { SetValue(CurrentFolderProperty, value); } + } + public static readonly DependencyProperty CurrentFolderProperty = + DependencyProperty.Register("CurrentFolder", typeof(ExplorerFolderItem), typeof(ExplorerControl), new PropertyMetadata(null, (d, e) => (d as ExplorerControl).OnCurrentFolderChanged())); + + public ExplorerItem SelectedItem + { + get { return (ExplorerItem)GetValue(SelectedItemProperty); } + set { SetValue(SelectedItemProperty, value); } + } + public static readonly DependencyProperty SelectedItemProperty = + DependencyProperty.Register("SelectedItem", typeof(ExplorerItem), typeof(ExplorerControl), new PropertyMetadata(null, (d, e) => (d as ExplorerControl).OnSelectedItemChanged())); + + public RelayCommand BackCommand + { + get { return (RelayCommand)GetValue(BackCommandProperty); } + set { SetValue(BackCommandProperty, value); } + } + public static readonly DependencyProperty BackCommandProperty = + DependencyProperty.Register("BackCommand", typeof(RelayCommand), typeof(ExplorerControl), new PropertyMetadata(null)); + + static ExplorerControl() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(ExplorerControl), new FrameworkPropertyMetadata(typeof(ExplorerControl))); + } + + public ExplorerControl() + { + BackCommand = new RelayCommand(NavigateBack); + } + + private void OnCurrentPathChanged() + { + if (_changing_current_path) return; + + _changing_current_path = true; + + if (Directory.Exists(CurrentPath)) + { + CurrentFolder = ExplorerFolderItem.LoadFromPath(CurrentPath); + } + + _changing_current_path = false; + } + + private void OnCurrentFolderChanged() + { + if (_changing_current_path) return; + + _changing_current_path = true; + + CurrentPath = CurrentFolder.Path; + + _changing_current_path = false; + } + + private void OnSelectedItemChanged() + { + if (SelectedItem != null) + { + if (SelectedItem is ExplorerFolderItem) + { + var folder = SelectedItem as ExplorerFolderItem; + folder = ExplorerFolderItem.LoadFromPath(folder.Path); + CurrentFolder = folder; + SelectedItem = null; + } + } + } + + private void NavigateBack() + { + var parentPath = CurrentFolder.GetParentPath(); + + if (parentPath != null) + { + CurrentFolder = ExplorerFolderItem.LoadFromPath(parentPath); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerFileDefinition.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerFileDefinition.cs new file mode 100644 index 000000000..67f93dc6c --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerFileDefinition.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +namespace Tango.Explorer +{ + public class ExplorerFileDefinition + { + private static List _definitions; + + public String Extension { get; set; } + public String Description { get; set; } + public BitmapSource Icon { get; set; } + + public static ExplorerFileDefinition Folder => new ExplorerFileDefinition() + { + Icon = ResourceHelper.GetImageFromResources("/Images/folder.png") + }; + + public static ExplorerFileDefinition File => new ExplorerFileDefinition() + { + Icon = ResourceHelper.GetImageFromResources("/Images/file.png"), + Description = "Unknown Type" + }; + + public static ExplorerFileDefinition Job => new ExplorerFileDefinition() + { + Icon = ResourceHelper.GetImageFromResources("/Images/job.png"), + Description = "Tango Job Definition", + Extension = ".job", + }; + + public static ExplorerFileDefinition Pulse => new ExplorerFileDefinition() + { + Icon = ResourceHelper.GetImageFromResources("/Images/pulse.png"), + Description = "Twine Embroidery Design", + Extension = ".twn", + }; + + public static ExplorerFileDefinition Update => new ExplorerFileDefinition() + { + Icon = ResourceHelper.GetImageFromResources("/Images/update.png"), + Description = "Tango Software Update Package", + Extension = ".tup", + }; + + public static ExplorerFileDefinition ColorProfile => new ExplorerFileDefinition() + { + Icon = ResourceHelper.GetImageFromResources("/Images/color.png"), + Description = "Tango Color Profile", + Extension = ".ccp", + }; + + static ExplorerFileDefinition() + { + _definitions = typeof(ExplorerFileDefinition).GetProperties(BindingFlags.Public | BindingFlags.Static).Where(x => x.PropertyType == typeof(ExplorerFileDefinition)).ToList().Select(x => x.GetValue(null,null) as ExplorerFileDefinition).ToList(); + } + + public static ExplorerFileDefinition GetByExtension(String ext) + { + return _definitions.Where(x => x.Extension != null).SingleOrDefault(x => x.Extension.ToLower() == ext.ToLower()); + + //switch (ext.ToLower()) + //{ + // case ".job": + // return Job; + // case ".twn": + // return Pulse; + // case ".tup": + // return Update; + // case ".ccp": + // return ColorProfile; + // default: + // return File; + //} + } + + public static List GetSupportedExtensions() + { + return _definitions.Where(x => x.Extension != null).Select(x => x.Extension).ToList(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerFileItem.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerFileItem.cs new file mode 100644 index 000000000..e4ac8f5d4 --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerFileItem.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; + +namespace Tango.Explorer +{ + public class ExplorerFileItem : ExplorerItem + { + public static ExplorerFileItem LoadFromPath(String path) + { + ExplorerFileItem fileItem = new ExplorerFileItem(); + + var definition = ExplorerFileDefinition.GetByExtension(System.IO.Path.GetExtension(path)); + + fileItem.Path = path; + fileItem.Description = definition.Description; + fileItem.Name = System.IO.Path.GetFileName(path); + fileItem.Icon = definition.Icon; + + return fileItem; + } + } +} diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs new file mode 100644 index 000000000..48f870b20 --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerFolderItem.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace Tango.Explorer +{ + public class ExplorerFolderItem : ExplorerItem + { + private static List extensions = ExplorerFileDefinition.GetSupportedExtensions().Select(x => x.Replace(".","")).ToList(); + + public List Items { get; set; } + + public ExplorerFolderItem() + { + Items = new List(); + } + + public static ExplorerFolderItem LoadFromPath(String path) + { + ExplorerFolderItem folderItem = new ExplorerFolderItem(); + + folderItem.Path = path; + folderItem.Icon = ExplorerFileDefinition.Folder.Icon; + folderItem.Name = System.IO.Path.GetFileName(path); + + foreach (var folder in new DirectoryInfo(path).GetDirectories().Where(x => !x.Attributes.HasFlag(FileAttributes.Hidden))) + { + ExplorerFolderItem fItem = new ExplorerFolderItem(); + fItem.Path = folder.FullName; + fItem.Icon = ExplorerFileDefinition.Folder.Icon; + fItem.Name = System.IO.Path.GetFileName(folder.FullName); + folderItem.Items.Add(fItem); + } + + foreach (var file in Directory.GetFiles(path,"*.*").Where(f => extensions.Contains(f.Split('.').Last().ToLower())).ToArray()) + { + folderItem.Items.Add(ExplorerFileItem.LoadFromPath(file)); + } + + return folderItem; + } + + public String GetParentPath() + { + var parent = new DirectoryInfo(Path).Parent; + var parentPath = parent != null ? parent.FullName : null; + return parentPath; + } + } +} diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerItem.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerItem.cs new file mode 100644 index 000000000..b604c71b5 --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerItem.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Tango.Explorer +{ + public abstract class ExplorerItem + { + public String Name { get; set; } + public String Description { get; set; } + public String Path { get; set; } + public BitmapSource Icon { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.Explorer/Images/color.png b/Software/Visual_Studio/Tango.Explorer/Images/color.png new file mode 100644 index 000000000..44ca22ae2 Binary files /dev/null and b/Software/Visual_Studio/Tango.Explorer/Images/color.png differ diff --git a/Software/Visual_Studio/Tango.Explorer/Images/file.png b/Software/Visual_Studio/Tango.Explorer/Images/file.png new file mode 100644 index 000000000..a8cf88667 Binary files /dev/null and b/Software/Visual_Studio/Tango.Explorer/Images/file.png differ diff --git a/Software/Visual_Studio/Tango.Explorer/Images/folder.png b/Software/Visual_Studio/Tango.Explorer/Images/folder.png new file mode 100644 index 000000000..1d32e80bf Binary files /dev/null and b/Software/Visual_Studio/Tango.Explorer/Images/folder.png differ diff --git a/Software/Visual_Studio/Tango.Explorer/Images/job.png b/Software/Visual_Studio/Tango.Explorer/Images/job.png new file mode 100644 index 000000000..a41bcf8f0 Binary files /dev/null and b/Software/Visual_Studio/Tango.Explorer/Images/job.png differ diff --git a/Software/Visual_Studio/Tango.Explorer/Images/pulse.png b/Software/Visual_Studio/Tango.Explorer/Images/pulse.png new file mode 100644 index 000000000..1cabab56d Binary files /dev/null and b/Software/Visual_Studio/Tango.Explorer/Images/pulse.png differ diff --git a/Software/Visual_Studio/Tango.Explorer/Images/update.png b/Software/Visual_Studio/Tango.Explorer/Images/update.png new file mode 100644 index 000000000..3e2475359 Binary files /dev/null and b/Software/Visual_Studio/Tango.Explorer/Images/update.png differ diff --git a/Software/Visual_Studio/Tango.Explorer/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Explorer/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..82a33f7c2 --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("Tango - File System Explorer Library")] +[assembly: AssemblyVersion("2.0.8.1119")] +[assembly: ComVisible(false)] + +[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) +)] diff --git a/Software/Visual_Studio/Tango.Explorer/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.Explorer/Properties/Resources.Designer.cs new file mode 100644 index 000000000..78e8696e7 --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/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.Explorer.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.Explorer.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/Tango.Explorer/Properties/Resources.resx b/Software/Visual_Studio/Tango.Explorer/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/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/Tango.Explorer/Properties/Settings.Designer.cs b/Software/Visual_Studio/Tango.Explorer/Properties/Settings.Designer.cs new file mode 100644 index 000000000..25995bb0c --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/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.Explorer.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/Tango.Explorer/Properties/Settings.settings b/Software/Visual_Studio/Tango.Explorer/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Explorer/Tango.Explorer.csproj b/Software/Visual_Studio/Tango.Explorer/Tango.Explorer.csproj new file mode 100644 index 000000000..a436400a4 --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/Tango.Explorer.csproj @@ -0,0 +1,114 @@ + + + + + Debug + AnyCPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5} + library + Tango.Explorer + Tango.Explorer + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + true + full + false + ..\Build\Core\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\Build\Core\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + GlobalVersionInfo.cs + + + Code + + + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + {fd86424c-6e84-491b-8df9-3d0f5c236a2a} + Tango.Touch + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Explorer/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Explorer/Themes/Generic.xaml new file mode 100644 index 000000000..a141dc88f --- /dev/null +++ b/Software/Visual_Studio/Tango.Explorer/Themes/Generic.xaml @@ -0,0 +1,36 @@ + + + + + + diff --git a/Software/Visual_Studio/Tango.Hive/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Hive/Properties/AssemblyInfo.cs index 8741d2b15..15a68880b 100644 --- a/Software/Visual_Studio/Tango.Hive/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Hive/Properties/AssemblyInfo.cs @@ -4,14 +4,15 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; -[assembly: AssemblyTitle("Tango - Hive UI Components")] -[assembly: AssemblyVersion("2.0.14.1737")] +[assembly: AssemblyTitle("Tango - File System Explorer Library")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: ComVisible(false)] -[assembly:ThemeInfo( +[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) + //(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) + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) )] diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs index ac446b9fd..c410351aa 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs @@ -55,7 +55,7 @@ namespace Tango.Touch.Controls set { SetValue(ItemsSourceProperty, value); } } public static readonly DependencyProperty ItemsSourceProperty = - DependencyProperty.Register("ItemsSource", typeof(IList), typeof(TouchListBox), new PropertyMetadata(null)); + DependencyProperty.Register("ItemsSource", typeof(IList), typeof(TouchListBox), new PropertyMetadata(null, (d, e) => (d as TouchListBox).OnItemsSourceChanged())); public DataTemplate ItemTemplate { @@ -319,6 +319,11 @@ namespace Tango.Touch.Controls } } + private void OnItemsSourceChanged() + { + ScrollViewer.ScrollToTop(); + } + public void ScrollToItem(Object item) { var ee = ScrollViewer.FindVisualChildren(); diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 11b623c9b..cd4b7121f 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -232,6 +232,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xceed.Wpf.Toolkit", "SideCh EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.Statistics", "MachineStudio\Modules\Tango.MachineStudio.Statistics\Tango.MachineStudio.Statistics.csproj", "{8A65AD6A-A9B4-48C0-9301-4B7434B712F8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Explorer", "Tango.Explorer\Tango.Explorer.csproj", "{4399AF76-DB52-4CFB-8020-6F85BDB29FD5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution AppVeyor|Any CPU = AppVeyor|Any CPU @@ -4115,6 +4117,46 @@ Global {8A65AD6A-A9B4-48C0-9301-4B7434B712F8}.Release|x64.Build.0 = Release|Any CPU {8A65AD6A-A9B4-48C0-9301-4B7434B712F8}.Release|x86.ActiveCfg = Release|Any CPU {8A65AD6A-A9B4-48C0-9301-4B7434B712F8}.Release|x86.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|Any CPU.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|Any CPU.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|ARM.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|ARM.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|ARM64.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|ARM64.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|x64.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|x64.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|x86.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.AppVeyor|x86.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|ARM.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|ARM.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|ARM64.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|x64.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|x64.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|x86.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Debug|x86.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|Any CPU.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|Any CPU.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|ARM.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|ARM.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|ARM64.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|ARM64.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|x64.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|x64.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|x86.ActiveCfg = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.DefaultBuild|x86.Build.0 = Debug|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|Any CPU.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|ARM.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|ARM.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|ARM64.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|ARM64.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|x64.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|x64.Build.0 = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|x86.ActiveCfg = Release|Any CPU + {4399AF76-DB52-4CFB-8020-6F85BDB29FD5}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml index bccc5f3cc..ff1afdd22 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml @@ -12,13 +12,21 @@ xmlns:stubs="clr-namespace:Tango.Stubs.Views;assembly=Tango.Stubs" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common" + xmlns:explorer="clr-namespace:Tango.Explorer;assembly=Tango.Explorer" mc:Ignorable="d" - Title="MainWindow" Height="500" Width="800" Foreground="Red" DataContext="{Binding RelativeSource={RelativeSource Self}}"> + Title="MainWindow" Height="564.721" Width="504.315" DataContext="{Binding RelativeSource={RelativeSource Self}}"> + + + + + - - + + + + diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs index c3eca4c76..0ff703178 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs @@ -23,156 +23,27 @@ using Tango.SharedUI; namespace Tango.UITests { - public class VM : ViewModel - { - public List Names { get; set; } - - private String _email; - public String Email - { - get { return _email; } - set { _email = value; RaisePropertyChangedAuto(); } - } - - private String _password; - - public String Password - { - get { return _password; } - set { _password = value; RaisePropertyChangedAuto(); } - } - - public RelayCommand LoginCommand { get; set; } - - public VM() - { - LoginCommand = new RelayCommand(Login); - - Names = new List(); - - for (int i = 0; i < 100; i++) - { - Names.Add("ITEM " + (i + 1).ToString()); - } - } - - private void Login() - { - Validate(); - } - - protected override void OnValidating() - { - base.OnValidating(); - - if (Email == "1234") - { - InsertError(nameof(Email), "This email is not good"); - } - } - } - - public class Person : ExtendedObject - { - public String FirstName { get; set; } - public String LastName { get; set; } - private int _index; - - public int Index - { - get { return _index; } - set { _index = value; RaisePropertyChangedAuto(); } - } - - public int Age { get; set; } - - public override string ToString() - { - return FirstName; - } - } - /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { - - - public ObservableCollection Persons - { - get { return (ObservableCollection)GetValue(PersonsProperty); } - set { SetValue(PersonsProperty, value); } - } - public static readonly DependencyProperty PersonsProperty = - DependencyProperty.Register("Persons", typeof(ObservableCollection), typeof(MainWindow), new PropertyMetadata(null)); - - - public RelayCommand DropCommand { get; set; } - - public int Value - { - get { return (int)GetValue(ValueProperty); } - set { SetValue(ValueProperty, value); } - } - public static readonly DependencyProperty ValueProperty = - DependencyProperty.Register("Value", typeof(int), typeof(MainWindow), new PropertyMetadata(0)); - public MainWindow() { - Persons = new ObservableCollection(); - - for (int i = 1; i < 10; i++) - { - Persons.Add(new Person() - { - Age = i, - FirstName = i.ToString() + " Roy", - LastName = "Ben Shabat " + i.ToString(), - Index = i, - }); - } - - DropCommand = new RelayCommand(OnDrop); - - Value = 10; - InitializeComponent(); - - //DataContext = new VM(); } - private void OnDrop(DropEventArgs e) + public String CurrentPath { - var dragPerson = (e.Draggable as FrameworkElement).DataContext as Person; - var dropPerson = (e.Droppable as FrameworkElement).DataContext as Person; - - Debug.WriteLine(dragPerson.FirstName + " dropped on " + dropPerson.FirstName); - - int dragIndex = dragPerson.Index; - dragPerson.Index = dropPerson.Index; - dropPerson.Index = dragIndex; + get { return (String)GetValue(CurrentPathProperty); } + set { SetValue(CurrentPathProperty, value); } } + public static readonly DependencyProperty CurrentPathProperty = + DependencyProperty.Register("CurrentPath", typeof(String), typeof(MainWindow), new PropertyMetadata(null)); private void Button_Click(object sender, RoutedEventArgs e) { - MessageBox.Show("Done"); - } - - private void Button_Click_1(object sender, RoutedEventArgs e) - { - Persons.Add(new Person() - { - FirstName = "New", - LastName = "Person", - Age = 200, - Index = 0 - }); - } - - private void TouchButton_Click(object sender, RoutedEventArgs e) - { - MessageBox.Show("Clicked"); + CurrentPath = @"D:\PPC Explorer Test"; } } } diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj b/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj index bb5501f0b..909acedb6 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj +++ b/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj @@ -128,6 +128,10 @@ {b112d89a-a106-41ae-a0c1-4abc84c477f5} Tango.DragAndDrop + + {4399af76-db52-4cfb-8020-6f85bdb29fd5} + Tango.Explorer + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI @@ -144,7 +148,7 @@ - + \ No newline at end of file -- cgit v1.3.1