From d48b2d23515d06a21ad241380986bf8f31773195 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 22 Mar 2020 00:04:44 +0200 Subject: Implemented WebRtcTransportAdapter. Implemented FileSystem via WebRTC. Improved FileSystemControl keyboard control. Implemented FileSystemControl context menu. Improved Transported custom request handler registration. Implemented FS copy/move/delete. Implemented InputBox. --- .../Tango.FileSystem/FileExplorerControl.cs | 380 ++++++++++++++++++++- 1 file changed, 372 insertions(+), 8 deletions(-) (limited to 'Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs') diff --git a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs index 23cac7733..60061780b 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs @@ -16,6 +16,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.Commands; using Tango.Core.IO; namespace Tango.FileSystem @@ -28,6 +29,41 @@ namespace Tango.FileSystem private Point _dragOutStartPoint; private bool _isMouseDown; private List _selectedItemsBeforeDrag; + private List _copyItems; + private bool _isCut; + private bool _isAfterContextMenu; + + #region IsCut Attached Property + + /// + /// Determines whether the draggable element is currently being dragged. + /// + public static readonly DependencyProperty IsCutProperty = + DependencyProperty.RegisterAttached("IsCut", + typeof(bool), typeof(FileExplorerControl), + new FrameworkPropertyMetadata(false)); + + /// + /// Sets the IsCut attached property. + /// + /// The element. + /// if set to true [value]. + public static void SetIsCut(FrameworkElement element, bool value) + { + element.SetValue(IsCutProperty, value); + } + + /// + /// Gets the is dragging attached property. + /// + /// The element. + /// + public static bool GetIsCut(FrameworkElement element) + { + return (bool)element.GetValue(IsCutProperty); + } + + #endregion public IFileSystemContainer CurrentItem { @@ -35,7 +71,7 @@ namespace Tango.FileSystem set { SetValue(CurrentItemProperty, value); } } public static readonly DependencyProperty CurrentItemProperty = - DependencyProperty.Register("CurrentItem", typeof(IFileSystemContainer), typeof(FileExplorerControl), new PropertyMetadata(null)); + DependencyProperty.Register("CurrentItem", typeof(IFileSystemContainer), typeof(FileExplorerControl), new PropertyMetadata(null, (d, e) => (d as FileExplorerControl).OnCurrentItemChanged())); public FileSystemItem SelectedItem { @@ -61,6 +97,14 @@ namespace Tango.FileSystem public static readonly DependencyProperty DeleteCommandProperty = DependencyProperty.Register("DeleteCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + public ICommand DeleteCommandInternal + { + get { return (ICommand)GetValue(DeleteCommandInternalProperty); } + set { SetValue(DeleteCommandInternalProperty, value); } + } + public static readonly DependencyProperty DeleteCommandInternalProperty = + DependencyProperty.Register("DeleteCommandInternal", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + public ICommand DropCommand { get { return (ICommand)GetValue(DropCommandProperty); } @@ -77,6 +121,110 @@ namespace Tango.FileSystem public static readonly DependencyProperty DragCommandProperty = DependencyProperty.Register("DragCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + public ICommand CopyCommand + { + get { return (ICommand)GetValue(CopyCommandProperty); } + set { SetValue(CopyCommandProperty, value); } + } + public static readonly DependencyProperty CopyCommandProperty = + DependencyProperty.Register("CopyCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand CutCommand + { + get { return (ICommand)GetValue(CutCommandProperty); } + set { SetValue(CutCommandProperty, value); } + } + public static readonly DependencyProperty CutCommandProperty = + DependencyProperty.Register("CutCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand CopyPasteCommand + { + get { return (ICommand)GetValue(CopyPasteCommandProperty); } + set { SetValue(CopyPasteCommandProperty, value); } + } + public static readonly DependencyProperty CopyPasteCommandProperty = + DependencyProperty.Register("CopyPasteCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand CutPasteCommand + { + get { return (ICommand)GetValue(CutPasteCommandProperty); } + set { SetValue(CutPasteCommandProperty, value); } + } + public static readonly DependencyProperty CutPasteCommandProperty = + DependencyProperty.Register("CutPasteCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand PasteCommandInternal + { + get { return (ICommand)GetValue(PasteCommandInternalProperty); } + set { SetValue(PasteCommandInternalProperty, value); } + } + public static readonly DependencyProperty PasteCommandInternalProperty = + DependencyProperty.Register("PasteCommandInternal", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand SelectAllCommand + { + get { return (ICommand)GetValue(SelectAllCommandProperty); } + set { SetValue(SelectAllCommandProperty, value); } + } + public static readonly DependencyProperty SelectAllCommandProperty = + DependencyProperty.Register("SelectAllCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand DownloadCommandInternal + { + get { return (ICommand)GetValue(DownloadCommandInternalProperty); } + set { SetValue(DownloadCommandInternalProperty, value); } + } + public static readonly DependencyProperty DownloadCommandInternalProperty = + DependencyProperty.Register("DownloadCommandInternal", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand DownloadCommand + { + get { return (ICommand)GetValue(DownloadCommandProperty); } + set { SetValue(DownloadCommandProperty, value); } + } + public static readonly DependencyProperty DownloadCommandProperty = + DependencyProperty.Register("DownloadCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand OpenCommand + { + get { return (ICommand)GetValue(OpenCommandProperty); } + set { SetValue(OpenCommandProperty, value); } + } + public static readonly DependencyProperty OpenCommandProperty = + DependencyProperty.Register("OpenCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand BackCommand + { + get { return (ICommand)GetValue(BackCommandProperty); } + set { SetValue(BackCommandProperty, value); } + } + public static readonly DependencyProperty BackCommandProperty = + DependencyProperty.Register("BackCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand RenameCommand + { + get { return (ICommand)GetValue(RenameCommandProperty); } + set { SetValue(RenameCommandProperty, value); } + } + public static readonly DependencyProperty RenameCommandProperty = + DependencyProperty.Register("RenameCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand RenameCommandInternal + { + get { return (ICommand)GetValue(RenameCommandInternalProperty); } + set { SetValue(RenameCommandInternalProperty, value); } + } + public static readonly DependencyProperty RenameCommandInternalProperty = + DependencyProperty.Register("RenameCommandInternal", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public bool IsContextMenuOpened + { + get { return (bool)GetValue(IsContextMenuOpenedProperty); } + set { SetValue(IsContextMenuOpenedProperty, value); } + } + public static readonly DependencyProperty IsContextMenuOpenedProperty = + DependencyProperty.Register("IsContextMenuOpened", typeof(bool), typeof(FileExplorerControl), new PropertyMetadata(false, (d, e) => (d as FileExplorerControl).OnIsContextMenuOpenedChanged())); + public ImageSource DriveIcon { get { return (ImageSource)GetValue(DriveIconProperty); } @@ -124,7 +272,138 @@ namespace Tango.FileSystem public FileExplorerControl() { + Focusable = true; + + _copyItems = new List(); _selectedItemsBeforeDrag = new List(); + + CopyCommand = new RelayCommand(() => + { + ResetItemsCut(); + _copyItems.Clear(); + _copyItems.AddRange(SelectedItems.ToList()); + _isCut = false; + }, () => SelectedItems != null && SelectedItems.Count > 0); + + CutCommand = new RelayCommand(() => + { + _copyItems.Clear(); + _copyItems.AddRange(SelectedItems.ToList()); + CutSelectedItems(); + _isCut = true; + + }, () => SelectedItems != null && SelectedItems.Count > 0); + + PasteCommandInternal = new RelayCommand(() => + { + if (_isCut) + { + CutPasteCommand?.Execute(_copyItems.ToList()); + } + else + { + CopyPasteCommand?.Execute(_copyItems.ToList()); + } + + ResetItemsCut(); + _copyItems.Clear(); + }, () => _copyItems.Count > 0); + + SelectAllCommand = new RelayCommand(() => + { + ResetItemsCut(); + _copyItems.Clear(); + SelectedItems.Clear(); + + if (CurrentItem != null) + { + foreach (var item in CurrentItem.Items) + { + SelectedItems.Add(item); + } + } + }); + + DownloadCommandInternal = new RelayCommand(() => + { + + DownloadCommand?.Execute(SelectedItems.ToList()); + + }, () => SelectedItems != null && SelectedItems.Count > 0 && SelectedItems.All(x => x.Type != FileSystemItemType.Drive)); + + OpenCommand = new RelayCommand(() => + { + ItemDoubleClickedCommand?.Execute(SelectedItems.FirstOrDefault()); + }, () => SelectedItems != null && SelectedItems.Count == 1); + + DeleteCommandInternal = new RelayCommand(() => + { + + DeleteCommand?.Execute(SelectedItems.ToList()); + + }, () => SelectedItems != null && SelectedItems.Count > 1 && SelectedItems.All(x => x.Type != FileSystemItemType.Drive)); + + RenameCommandInternal = new RelayCommand(() => + { + + RenameCommand?.Execute(SelectedItems.FirstOrDefault()); + + }, () => SelectedItems != null && SelectedItems.Count == 1 && SelectedItems.All(x => x.Type != FileSystemItemType.Drive)); + } + + private void OnIsContextMenuOpenedChanged() + { + _isMouseDown = false; + (PasteCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); + (CutCommand as RelayCommand)?.RaiseCanExecuteChanged(); + (CopyCommand as RelayCommand)?.RaiseCanExecuteChanged(); + (DownloadCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); + (OpenCommand as RelayCommand)?.RaiseCanExecuteChanged(); + (DeleteCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); + (RenameCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); + + if (IsContextMenuOpened) + { + _isAfterContextMenu = true; + } + } + + private void ResetItemsCut() + { + foreach (var item in _listBox.Items) + { + var element = _listBox.ItemContainerGenerator.ContainerFromItem(item) as FrameworkElement; + if (element != null) + { + SetIsCut(element, false); + } + + element = _datagrid.ItemContainerGenerator.ContainerFromItem(item) as FrameworkElement; + if (element != null) + { + SetIsCut(element, false); + } + } + } + + private void CutSelectedItems() + { + ResetItemsCut(); + + foreach (var item in SelectedItems.ToList()) + { + var element = _listBox.ItemContainerGenerator.ContainerFromItem(item) as FrameworkElement; + if (element != null) + { + SetIsCut(element, true); + } + + element = _datagrid.ItemContainerGenerator.ContainerFromItem(item) as FrameworkElement; + if (element != null) + { + SetIsCut(element, true); + } + } } public override void OnApplyTemplate() @@ -138,17 +417,77 @@ namespace Tango.FileSystem _datagrid.SelectionChanged += _datagrid_SelectionChanged; } - protected override void OnPreviewKeyUp(KeyEventArgs e) + protected override void OnPreviewKeyDown(KeyEventArgs e) { - base.OnPreviewKeyUp(e); + base.OnPreviewKeyDown(e); if (e.Key == Key.Delete) { - if (SelectedItems != null && SelectedItems.Count > 0) + if (DeleteCommandInternal != null && DeleteCommandInternal.CanExecute(null)) + { + DeleteCommandInternal?.Execute(null); + } + } + else if (e.Key == Key.Return) + { + if (OpenCommand != null && OpenCommand.CanExecute(null)) + { + OpenCommand?.Execute(null); + } + } + else if (e.Key == Key.C && Keyboard.IsKeyDown(Key.LeftCtrl)) + { + if (CopyCommand != null && CopyCommand.CanExecute(null)) { - DeleteCommand?.Execute(SelectedItems); + CopyCommand.Execute(null); } } + else if (e.Key == Key.X && Keyboard.IsKeyDown(Key.LeftCtrl)) + { + if (CutCommand != null && CutCommand.CanExecute(null)) + { + CutCommand.Execute(null); + } + } + else if (e.Key == Key.V && Keyboard.IsKeyDown(Key.LeftCtrl)) + { + if (PasteCommandInternal != null && PasteCommandInternal.CanExecute(null)) + { + PasteCommandInternal.Execute(null); + } + } + else if (e.Key == Key.A && Keyboard.IsKeyDown(Key.LeftCtrl)) + { + if (SelectAllCommand != null && SelectAllCommand.CanExecute(null)) + { + SelectAllCommand.Execute(null); + } + } + else if (e.Key == Key.D && Keyboard.IsKeyDown(Key.LeftCtrl)) + { + if (DownloadCommandInternal != null && DownloadCommandInternal.CanExecute(null)) + { + DownloadCommandInternal.Execute(null); + } + } + else if (e.Key == Key.F2) + { + if (RenameCommandInternal != null && RenameCommandInternal.CanExecute(null)) + { + RenameCommandInternal.Execute(null); + } + } + else if (e.Key == Key.Down) + { + if (SelectedItems != null && SelectedItems.Count == 0 && CurrentItem != null && CurrentItem.Items.Count > 0) + { + SelectedItems.Add(CurrentItem.Items.FirstOrDefault()); + } + } + else if (e.Key == Key.Back) + { + BackCommand?.Execute(null); + } } private void _datagrid_SelectionChanged(object sender, SelectionChangedEventArgs e) @@ -279,6 +618,12 @@ namespace Tango.FileSystem { base.OnPreviewMouseLeftButtonDown(e); + if (_isAfterContextMenu) + { + _isAfterContextMenu = false; + return; + } + if (!AllowDrag) return; if (e.OriginalSource is FrameworkElement) @@ -309,7 +654,7 @@ namespace Tango.FileSystem { base.OnPreviewMouseMove(e); - if (_isMouseDown) + if (_isMouseDown && !IsContextMenuOpened) { Point mpos = e.GetPosition(null); Vector diff = this._dragOutStartPoint - mpos; @@ -375,7 +720,7 @@ namespace Tango.FileSystem } //Notify to user with all items! - Dispatcher.BeginInvoke(new Action(() => + Dispatcher.BeginInvoke(new Action(() => { DragCommand?.Execute(notifyItems); })); @@ -400,7 +745,16 @@ namespace Tango.FileSystem } string[] files = dropItems.Select(x => x.Item2.Path).ToArray(); - var ef = DragDrop.DoDragDrop(this, new DataObject(DataFormats.FileDrop, files, false), DragDropEffects.Copy); + + try + { + var ef = DragDrop.DoDragDrop(this, new DataObject(DataFormats.FileDrop, files, false), DragDropEffects.Copy); + } + catch (Exception ex) + { + Debug.WriteLine(ex); + Debugger.Break(); + } await Task.Delay(3000); @@ -419,5 +773,15 @@ namespace Tango.FileSystem } } } + + private async void OnCurrentItemChanged() + { + if (IsVisible) + { + await Task.Delay(100); + this.Focus(); + Keyboard.Focus(this); + } + } } } -- cgit v1.3.1 From 912e8423fbf63a025dac977d5749e60d4c57df68 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 24 Mar 2020 18:31:31 +0200 Subject: Working on storage. --- .../Controls/FileSystemControl.xaml | 11 +++-- .../Tango.FSE.Common/Storage/IStorageProvider.cs | 5 +++ .../FSE/Tango.FSE.Common/Storage/StorageMode.cs | 16 +++++++ .../FSE/Tango.FSE.Common/Tango.FSE.Common.csproj | 1 + .../Tango.FSE.UI/Storage/DefaultStorageProvider.cs | 50 ++++++++++++++++++--- .../FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs | 4 +- .../FSE/Tango.FSE.UI/Views/MainView.xaml | 4 +- .../Tango.FileSystem/FileExplorerControl.cs | 51 ++++++++++++++-------- .../Tango.FileSystem/FileSystemManager.cs | 27 +++++++----- .../Network/GetFileSystemItemRequest.cs | 2 + 10 files changed, 131 insertions(+), 40 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/Storage/StorageMode.cs (limited to 'Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs') diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/FileSystemControl.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/FileSystemControl.xaml index fcea26001..eb1007609 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/FileSystemControl.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/FileSystemControl.xaml @@ -93,7 +93,7 @@ - + - + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Storage/IStorageProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Storage/IStorageProvider.cs index 00ec312a5..602e6057c 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Storage/IStorageProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Storage/IStorageProvider.cs @@ -4,6 +4,7 @@ using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Controls; using Tango.Core.Commands; using Tango.FileSystem; @@ -19,6 +20,10 @@ namespace Tango.FSE.Common.Storage FileSystemItem CurrentItem { get; set; } String CurrentPath { get; set; } ObservableCollection SelectedItems { get; set; } + FileSystemItem SelectedItem { get; set; } + SelectionMode SelectionMode { get; set; } + StorageMode StorageMode { get; set; } + String Filter { get; set; } List Drives { get; } RelayCommand OKCommand { get; } RelayCommand CancelCommand { get; } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Storage/StorageMode.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Storage/StorageMode.cs new file mode 100644 index 000000000..d2d519b84 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Storage/StorageMode.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Common.Storage +{ + public enum StorageMode + { + OpenFile, + OpenFiles, + SaveFile, + SelectFolder, + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 8c4165245..ce56e7f69 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -144,6 +144,7 @@ + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/DefaultStorageProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/DefaultStorageProvider.cs index c37400cf6..9a40888a3 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/DefaultStorageProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/DefaultStorageProvider.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; +using System.Windows.Controls; using System.Windows.Input; using Tango.Core; using Tango.Core.Commands; @@ -65,6 +66,8 @@ namespace Tango.FSE.UI.Storage set { _currentPath = value; RaisePropertyChangedAuto(); } } + public String Filter { get; set; } = "*.*"; + private bool _isBusy; public bool IsBusy { @@ -81,6 +84,27 @@ namespace Tango.FSE.UI.Storage public ObservableCollection SelectedItems { get; set; } + private FileSystemItem _selectedItem; + public FileSystemItem SelectedItem + { + get { return _selectedItem; } + set { _selectedItem = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + private SelectionMode _selectionMode; + public SelectionMode SelectionMode + { + get { return _selectionMode; } + set { _selectionMode = value; RaisePropertyChangedAuto(); } + } + + private StorageMode _storageMode; + public StorageMode StorageMode + { + get { return _storageMode; } + set { _storageMode = value; RaisePropertyChangedAuto(); } + } + public RelayCommand OKCommand { get; } public RelayCommand CancelCommand { get; } public RelayCommand BackCommand { get; set; } @@ -99,7 +123,7 @@ namespace Tango.FSE.UI.Storage BackCommand = new RelayCommand(NavigateBack, () => !(CurrentItem is FolderItem) || !(CurrentItem as FolderItem).IsRoot); NavigateSpecialFolderCommand = new RelayCommand(NavigateToSpecialFolder); NavigateToFolderCommand = new RelayCommand(async (x) => await Navigate(x)); - OKCommand = new RelayCommand(OnAccept); + OKCommand = new RelayCommand(OnAccept, CanOK); CancelCommand = new RelayCommand(OnCancel); } @@ -152,7 +176,11 @@ namespace Tango.FSE.UI.Storage var root = await _manager.GetFolder(String.Empty); Drives = (root as IFileSystemContainer).Items.Cast().ToList(); - CurrentItem = await _manager.GetFolder(Environment.CurrentDirectory); + StorageMode = StorageMode.SelectFolder; + SelectionMode = SelectionMode.Single; + + await Navigate(Environment.CurrentDirectory); + IsOpened = true; _okCompletionAction = () => @@ -160,7 +188,7 @@ namespace Tango.FSE.UI.Storage SingleStorageResult result = new SingleStorageResult() { Confirmed = true, - SelectedItem = SelectedItems.First().Path, + SelectedItem = CurrentItem.Path, }; _completionSource.SetResult(result); @@ -237,15 +265,15 @@ namespace Tango.FSE.UI.Storage if (path != null) { - CurrentItem = await _manager.GetFolder(path) as FileSystemItem; + CurrentItem = await _manager.GetFolder(path, StorageMode == StorageMode.SelectFolder, Filter) as FileSystemItem; } else if (specialFolder != null) { - CurrentItem = await _manager.GetFolder(specialFolder.Value) as FileSystemItem; + CurrentItem = await _manager.GetFolder(specialFolder.Value, StorageMode == StorageMode.SelectFolder, Filter) as FileSystemItem; } else { - CurrentItem = await _manager.GetFolder(String.Empty) as FileSystemItem; + CurrentItem = await _manager.GetFolder(String.Empty, StorageMode == StorageMode.SelectFolder, Filter) as FileSystemItem; } } catch (Exception ex) @@ -267,6 +295,16 @@ namespace Tango.FSE.UI.Storage InvalidateRelayCommands(); } + private bool CanOK() + { + if (StorageMode == StorageMode.SelectFolder && CurrentItem.Type == FileSystemItemType.Drive) + { + return false; + } + + return true; + } + #endregion #region Native diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs index 8b14ac69e..8622daab2 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs @@ -131,9 +131,9 @@ namespace Tango.FSE.UI.ViewModels try { - //var s = await StorageProvider.SelectFolder("Select download destination folder"); + var s = await StorageProvider.SelectFolder("Select download destination folder"); - //return; + return; if (!Validate()) { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml index 6a386947f..6941b830a 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml @@ -233,7 +233,7 @@ - + @@ -341,6 +341,8 @@ Mode="{Binding ElementName=listView,Path=SelectedItem.Tag}" CurrentItem="{Binding StorageProvider.CurrentItem,Mode=TwoWay}" SelectedItems="{Binding StorageProvider.SelectedItems}" + SelectedItem="{Binding StorageProvider.SelectedItem}" + SelectionMode="{Binding StorageProvider.SelectionMode}" BackCommand="{Binding StorageProvider.BackCommand}" ItemDoubleClickedCommand="{Binding StorageProvider.OpenCommand}" OpenCommand="{Binding StorageProvider.OpenCommand}"/> diff --git a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs index 60061780b..c624178a0 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs @@ -265,6 +265,15 @@ namespace Tango.FileSystem public static readonly DependencyProperty AllowDragProperty = DependencyProperty.Register("AllowDrag", typeof(bool), typeof(FileExplorerControl), new PropertyMetadata(null)); + public SelectionMode SelectionMode + { + get { return (SelectionMode)GetValue(SelectionModeProperty); } + set { SetValue(SelectionModeProperty, value); } + } + public static readonly DependencyProperty SelectionModeProperty = + DependencyProperty.Register("SelectionMode", typeof(SelectionMode), typeof(FileExplorerControl), new PropertyMetadata(SelectionMode.Extended)); + + static FileExplorerControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(FileExplorerControl), new FrameworkPropertyMetadata(typeof(FileExplorerControl))); @@ -492,39 +501,45 @@ namespace Tango.FileSystem private void _datagrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { - if (!_preventSynchronization) + if (SelectionMode == SelectionMode.Extended) { - _preventSynchronization = true; + if (!_preventSynchronization) + { + _preventSynchronization = true; - _listBox.SelectedItems.Clear(); + _listBox.SelectedItems.Clear(); - foreach (var item in _datagrid.SelectedItems) - { - _listBox.SelectedItems.Add(item); - } + foreach (var item in _datagrid.SelectedItems) + { + _listBox.SelectedItems.Add(item); + } - SynchronizeSelectedItems(_listBox.SelectedItems); + SynchronizeSelectedItems(_listBox.SelectedItems); - _preventSynchronization = false; + _preventSynchronization = false; + } } } private void _listBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { - if (!_preventSynchronization) + if (SelectionMode == SelectionMode.Extended) { - _preventSynchronization = true; + if (!_preventSynchronization) + { + _preventSynchronization = true; - _datagrid.SelectedItems.Clear(); + _datagrid.SelectedItems.Clear(); - foreach (var item in _listBox.SelectedItems) - { - _datagrid.SelectedItems.Add(item); - } + foreach (var item in _listBox.SelectedItems) + { + _datagrid.SelectedItems.Add(item); + } - SynchronizeSelectedItems(_listBox.SelectedItems); + SynchronizeSelectedItems(_listBox.SelectedItems); - _preventSynchronization = false; + _preventSynchronization = false; + } } } diff --git a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs index c18df97c9..f72785f81 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs @@ -73,15 +73,18 @@ namespace Tango.FileSystem }); } - foreach (var file in Directory.GetFiles(request.Path)) + if (!request.FoldersOnly) { - items.Add(new FileSystemItemDTO() + foreach (var file in Directory.GetFiles(request.Path, request.Filter != null ? request.Filter : "*.*")) { - Path = file, - Type = FileSystemItemType.File, - DateModified = File.GetLastWriteTimeUtc(file), - Size = new FileInfo(file).Length - }); + items.Add(new FileSystemItemDTO() + { + Path = file, + Type = FileSystemItemType.File, + DateModified = File.GetLastWriteTimeUtc(file), + Size = new FileInfo(file).Length + }); + } } return new FileSystemItemDTO() @@ -92,24 +95,28 @@ namespace Tango.FileSystem }; } - public Task GetFolder(String path) + public Task GetFolder(String path, bool foldersOnly = false, String filter = "*.*") { return Task.Factory.StartNew(() => { return FileSystemItem.FromDTO(GetFolder(new GetFileSystemItemRequest() { Path = path, + FoldersOnly = foldersOnly, + Filter = filter, })); }); } - public Task GetFolder(Environment.SpecialFolder specialFolder) + public Task GetFolder(Environment.SpecialFolder specialFolder, bool foldersOnly = false, String filter = "*.*") { return Task.Factory.StartNew(() => { return FileSystemItem.FromDTO(GetFolder(new GetFileSystemItemRequest() { - SpecialFolder = specialFolder + SpecialFolder = specialFolder, + FoldersOnly = foldersOnly, + Filter = filter, })); }); } diff --git a/Software/Visual_Studio/Tango.FileSystem/Network/GetFileSystemItemRequest.cs b/Software/Visual_Studio/Tango.FileSystem/Network/GetFileSystemItemRequest.cs index 1ed6c19e4..3cf91e869 100644 --- a/Software/Visual_Studio/Tango.FileSystem/Network/GetFileSystemItemRequest.cs +++ b/Software/Visual_Studio/Tango.FileSystem/Network/GetFileSystemItemRequest.cs @@ -11,5 +11,7 @@ namespace Tango.FileSystem.Network { public String Path { get; set; } public SpecialFolder? SpecialFolder { get; set; } + public bool FoldersOnly { get; set; } + public String Filter { get; set; } = "*.*"; } } -- cgit v1.3.1 From 42c06402ff6648c356fba8315958283762ed2542 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 25 Mar 2020 00:26:47 +0200 Subject: Added Download menu implementation to file system. Added several stun and turn servers to web rtc. --- .../ViewModels/FileSystemViewVM.cs | 53 ++++++++++++++++++++++ .../Tango.FSE.PPCConsole/Views/FileSystemView.xaml | 17 ++++++- .../Controls/FileSystemControl.xaml | 11 ++++- .../FileSystem/IFileSystemProvider.cs | 1 + .../FileSystem/DefaultFileSystemProvider.cs | 11 +++++ .../Tango.FSE.UI/Storage/DefaultStorageProvider.cs | 2 +- .../FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs | 4 +- .../FileSystem/DefaultFileSystemService.cs | 14 ++++++ .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Tango.FileSystem/FileExplorerControl.cs | 53 ++++++++++++++++++++-- .../Tango.FileSystem/FileSystemManager.cs | 17 +++++++ .../Network/CreateFolderRequest.cs | 14 ++++++ .../Network/CreateFolderResponse.cs | 13 ++++++ .../Tango.FileSystem/Tango.FileSystem.csproj | 2 + .../Visual_Studio/Tango.WebRTC/WebRtcClient.cs | 17 +++++++ 15 files changed, 219 insertions(+), 12 deletions(-) create mode 100644 Software/Visual_Studio/Tango.FileSystem/Network/CreateFolderRequest.cs create mode 100644 Software/Visual_Studio/Tango.FileSystem/Network/CreateFolderResponse.cs (limited to 'Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs index 4e2ca1882..e10cc0ad1 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/FileSystemViewVM.cs @@ -58,6 +58,7 @@ namespace Tango.FSE.PPCConsole.ViewModels public RelayCommand> CutPasteCommand { get; set; } public RelayCommand> DownloadCommand { get; set; } public RelayCommand RenameCommand { get; set; } + public RelayCommand NewFolderCommand { get; set; } public FileSystemViewVM() @@ -78,6 +79,7 @@ namespace Tango.FSE.PPCConsole.ViewModels CutPasteCommand = new RelayCommand>((items) => PasteItems(items, true)); DownloadCommand = new RelayCommand>(DownloadSelectedItems); RenameCommand = new RelayCommand(RenameFileSystemItem); + NewFolderCommand = new RelayCommand(CreateNewFolder); } private async void NavigateBack() @@ -341,7 +343,24 @@ namespace Tango.FSE.PPCConsole.ViewModels var result = await StorageProvider.SelectFolder("Select download destination folder"); if (result) { + + String destination = result.SelectedItem; + Debug.WriteLine($"Download to {result.SelectedItem}"); + + foreach (var item in items.Where(x => x.Type != FileSystemItemType.Drive)) + { + if (File.Exists(Path.Combine(destination, item.Name)) || Directory.Exists(Path.Combine(destination, item.Name))) + { + if (!await NotificationProvider.ShowWarningQuestion($"'{item.Name}' already exists on '{Path.GetDirectoryName(destination)}'. Do you want to overwrite?")) + { + continue; + } + } + + var handler = await FileSystemProvider.Download(item, destination); + FileSystemHandlers.Insert(0, handler); + } } } @@ -376,6 +395,40 @@ namespace Tango.FSE.PPCConsole.ViewModels } } + private async void CreateNewFolder() + { + if (CurrentItem == null) return; + if (CurrentItem is FolderItem) + { + if ((CurrentItem as FolderItem).IsRoot) return; + } + + var result = await NotificationProvider.ShowInputBox( + "New Folder", + $"Please enter a folder name and press 'ENTER'.", + PackIconKind.FolderAdd, "untitled", + "folder name", + 100, + "CREATE"); + + if (result.Confirmed) + { + try + { + using (NotificationProvider.PushTaskItem("Creating new folder...")) + { + var folderItem = await FileSystemProvider.CreateFolder(CurrentItem, result.Input); + NavigateToCurrentPath(); //Instead of inserting folder item just refresh the current path... + } + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error creating new folder '{Path.Combine(CurrentItem.Path,result.Input)}."); + await NotificationProvider.ShowError($"Error creating folder '{result.Input}'.\n{ex.FlattenMessage()}"); + } + } + } + private void OnCurrentItemChanged() { CurrentPath = CurrentItem.Path; diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/FileSystemView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/FileSystemView.xaml index d1143ede4..67f1dc1c5 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/FileSystemView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/FileSystemView.xaml @@ -121,6 +121,7 @@ + RenameCommand="{Binding RenameCommand}" + NewFolderCommand="{Binding NewFolderCommand}"/> @@ -163,7 +165,18 @@ - + + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/FileSystemControl.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/FileSystemControl.xaml index eb1007609..5bc75ca54 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/FileSystemControl.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/FileSystemControl.xaml @@ -49,6 +49,13 @@ + + + + + + + @@ -93,7 +100,7 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlDialog.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlDialog.xaml.cs new file mode 100644 index 000000000..db12a70f1 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlDialog.xaml.cs @@ -0,0 +1,218 @@ +using Microsoft.WindowsAPICodePack.Controls; +using Microsoft.WindowsAPICodePack.Shell; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +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.Shapes; + +namespace Tango.FSE.UI.Storage +{ + /// + /// Interaction logic for ExplorerControlWindow.xaml + /// + public partial class ExplorerControlDialog : Window + { + private static string _lastDirectory; + private static Point? _lastLocation; + + private string _currentLocation; + + public List SelectedItems { get; set; } + public String InitialDirectory { get; set; } + + public ObservableCollection ShellHistory + { + get { return (ObservableCollection)GetValue(ShellHistoryProperty); } + set { SetValue(ShellHistoryProperty, value); } + } + public static readonly DependencyProperty ShellHistoryProperty = + DependencyProperty.Register("ShellHistory", typeof(ObservableCollection), typeof(ExplorerControlDialog), new PropertyMetadata(null)); + + public ExplorerControlDialog() + { + SelectedItems = new List(); + ShellHistory = new ObservableCollection(); + + InitializeComponent(); + Loaded += ExplorerControlWindow_Loaded; + SourceInitialized += ExplorerControlWindow_SourceInitialized; + explorer.browser.SelectionChanged += Browser_SelectionChanged; + explorer.browser.NavigationComplete += Browser_NavigationComplete; + btnSelect.IsEnabled = false; + btnBack.IsEnabled = false; + btnForward.IsEnabled = false; + + if (_lastLocation != null) + { + WindowStartupLocation = WindowStartupLocation.Manual; + Left = _lastLocation.Value.X; + Top = _lastLocation.Value.Y; + } + else + { + WindowStartupLocation = WindowStartupLocation.CenterOwner; + } + } + + private void FillShellHistory(ShellObject current) + { + ShellHistory.Clear(); + + ShellObject parent = current; + + while (parent != null) + { + ShellHistory.Insert(0, parent); + + if (parent.ToString() == "This PC") break; + + parent = parent.Parent; + } + } + + private void Browser_NavigationComplete(object sender, Microsoft.WindowsAPICodePack.Controls.NavigationCompleteEventArgs e) + { + _currentLocation = e.NewLocation.ParsingName; + ShellObject shell = ShellObject.FromParsingName(_currentLocation); + + if (shell.ToString() != "This PC") + { + btnUp.IsEnabled = true; + txtLocation.Text = shell.GetDisplayName(DisplayNameType.FileSystemPath); + } + else + { + btnUp.IsEnabled = false; + txtLocation.Text = ""; + } + + FillShellHistory(shell); + + btnBack.IsEnabled = explorer.browser.NavigationLog.CanNavigateBackward; + btnForward.IsEnabled = explorer.browser.NavigationLog.CanNavigateForward; + } + + private void Browser_SelectionChanged(object sender, EventArgs e) + { + if (explorer.browser.SelectedItems.OfType().ToList().Count > 0) + { + btnSelect.IsEnabled = true; + } + else + { + btnSelect.IsEnabled = false; + } + } + + private void ExplorerControlWindow_SourceInitialized(object sender, EventArgs e) + { + this.HideMinimizeAndMaximizeButtons(); + } + + private void ExplorerControlWindow_Loaded(object sender, RoutedEventArgs e) + { + ShellObject initialShellObject = (ShellObject)KnownFolders.Desktop; + + if (InitialDirectory != null && Directory.Exists(InitialDirectory)) + { + initialShellObject = ShellObject.FromParsingName(InitialDirectory); + } + else if (_lastDirectory != null && Directory.Exists(_lastDirectory)) + { + initialShellObject = ShellObject.FromParsingName(_lastDirectory); + } + + explorer.browser.Navigate(initialShellObject); + } + + private void BtnSelect_Click(object sender, RoutedEventArgs e) + { + SelectedItems.Clear(); + + foreach (var item in explorer.browser.SelectedItems.OfType()) + { + SelectedItems.Add(item.ParsingName); + } + + _lastDirectory = _currentLocation; + _lastLocation = new Point(Left, Top); + + + DialogResult = true; + Close(); + } + + private void BtnCancel_Click(object sender, RoutedEventArgs e) + { + _lastLocation = new Point(Left, Top); + Close(); + } + + private void BtnBack_Click(object sender, RoutedEventArgs e) + { + explorer.browser.NavigateLogLocation(NavigationLogDirection.Backward); + } + + private void BtnForward_Click(object sender, RoutedEventArgs e) + { + explorer.browser.NavigateLogLocation(NavigationLogDirection.Forward); + } + + private void BtnUp_Click(object sender, RoutedEventArgs e) + { + ShellObject currentLocation = ShellObject.FromParsingName(_currentLocation); + explorer.browser.Navigate(currentLocation.Parent); + } + + private void TxtLocation_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) + { + listHistory.Visibility = Visibility.Collapsed; + } + + private void TxtLocation_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) + { + listHistory.Visibility = Visibility.Visible; + } + + private void OnHistoryItemClicked(object sender, RoutedEventArgs e) + { + ShellObject shell = (sender as Button).DataContext as ShellObject; + explorer.browser.Navigate(shell); + } + } + + internal static class WindowExtensions + { + // from winuser.h + private const int GWL_STYLE = -16, + WS_MAXIMIZEBOX = 0x10000, + WS_MINIMIZEBOX = 0x20000; + + [DllImport("user32.dll")] + extern private static int GetWindowLong(IntPtr hwnd, int index); + + [DllImport("user32.dll")] + extern private static int SetWindowLong(IntPtr hwnd, int index, int value); + + internal static void HideMinimizeAndMaximizeButtons(this Window window) + { + IntPtr hwnd = new System.Windows.Interop.WindowInteropHelper(window).Handle; + var currentStyle = GetWindowLong(hwnd, GWL_STYLE); + + SetWindowLong(hwnd, GWL_STYLE, (currentStyle & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX)); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.cs new file mode 100644 index 000000000..928baa201 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Tango.FSE.Storage.UI +{ + public partial class ExplorerControlForms : UserControl + { + public ExplorerControlForms() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.designer.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.designer.cs new file mode 100644 index 000000000..f77fdd5cc --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.designer.cs @@ -0,0 +1,109 @@ +namespace Tango.FSE.Storage.UI +{ + partial class ExplorerControlForms + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.browser = new Microsoft.WindowsAPICodePack.Controls.WindowsForms.ExplorerBrowser(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.panel4 = new System.Windows.Forms.Panel(); + this.SuspendLayout(); + // + // browser + // + this.browser.Dock = System.Windows.Forms.DockStyle.Fill; + this.browser.Location = new System.Drawing.Point(0, 0); + this.browser.Name = "browser"; + this.browser.PropertyBagName = "Microsoft.WindowsAPICodePack.Controls.WindowsForms.ExplorerBrowser"; + this.browser.Size = new System.Drawing.Size(398, 311); + this.browser.TabIndex = 1; + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.White; + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(398, 1); + this.panel1.TabIndex = 2; + // + // panel2 + // + this.panel2.BackColor = System.Drawing.Color.White; + this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel2.Location = new System.Drawing.Point(0, 310); + this.panel2.Margin = new System.Windows.Forms.Padding(0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(398, 1); + this.panel2.TabIndex = 3; + // + // panel3 + // + this.panel3.BackColor = System.Drawing.Color.White; + this.panel3.Dock = System.Windows.Forms.DockStyle.Left; + this.panel3.Location = new System.Drawing.Point(0, 1); + this.panel3.Margin = new System.Windows.Forms.Padding(0); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(1, 309); + this.panel3.TabIndex = 4; + // + // panel4 + // + this.panel4.BackColor = System.Drawing.Color.White; + this.panel4.Dock = System.Windows.Forms.DockStyle.Right; + this.panel4.Location = new System.Drawing.Point(397, 1); + this.panel4.Margin = new System.Windows.Forms.Padding(0); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(1, 309); + this.panel4.TabIndex = 5; + // + // ExplorerControlForms + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.panel4); + this.Controls.Add(this.panel3); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.Controls.Add(this.browser); + this.Name = "ExplorerControlForms"; + this.Size = new System.Drawing.Size(398, 311); + this.ResumeLayout(false); + + } + + #endregion + + public Microsoft.WindowsAPICodePack.Controls.WindowsForms.ExplorerBrowser browser; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Panel panel4; + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.resx b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Storage/ExplorerControlForms.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 12b4c9d45..b4854db5a 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -53,6 +53,9 @@ ..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + ..\..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll + ..\..\packages\MahApps.Metro.1.6.5\lib\net46\MahApps.Metro.dll @@ -110,6 +113,7 @@ + @@ -169,6 +173,15 @@ + + ExplorerControlDialog.xaml + + + UserControl + + + ExplorerControlForms.cs + @@ -248,6 +261,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -299,6 +316,9 @@ ResXFileCodeGenerator Resources.Designer.cs + + ExplorerControlForms.cs + SettingsSingleFileGenerator diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs index 9ed73afb2..130839534 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs @@ -178,7 +178,7 @@ namespace Tango.FSE.UI.ViewModels private void DiagnosticsProvider_FrameReceived(object sender, Common.Diagnostics.DiagnosticsFrameReceivedEventArgs e) { - Debug.WriteLine("Diagnostics Received..."); + //Debug.WriteLine("Diagnostics Received..."); } private void Logout() diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml index 6941b830a..0f16697ad 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml @@ -579,6 +579,10 @@ + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/packages.config b/Software/Visual_Studio/FSE/Tango.FSE.UI/packages.config index fda2f4d3f..a55bb6f29 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/packages.config +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/packages.config @@ -4,6 +4,7 @@ + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index acdf20fa8..1c0c52196 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -34,6 +34,7 @@ namespace Tango.PPC.Common.Connection private bool _isInitialized; private Thread _connection_thread; private ObservablesContext _context; + private bool disableConnectionFileLogging; private Machine _machine; /// @@ -106,11 +107,18 @@ namespace Tango.PPC.Common.Connection { if (MachineOperator.State != TransportComponentState.Connected) { + var fileLogger = LogManager.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)); + try { Thread.Sleep(2000); - LogManager.Log("Starting machine connection procedure...", LogCategory.Debug); + if (fileLogger != null && disableConnectionFileLogging) + { + fileLogger.Enabled = false; + } + + LogManager.Log("Starting machine connection procedure...", LogCategory.Info); var settings = SettingsManager.Default.GetOrCreate(); @@ -120,19 +128,19 @@ namespace Tango.PPC.Common.Connection { TimeSpan timeout = TimeSpan.FromSeconds(SettingsManager.Default.GetOrCreate().MachineScanningTimeoutSeconds); - LogManager.Log("Scanning for machine on available serial ports...", LogCategory.Debug); + LogManager.Log("Scanning for machine on available serial ports...", LogCategory.Info); Transport.Discovery.UsbCommunicationScanner scanner = new Transport.Discovery.UsbCommunicationScanner(UsbSerialBaudRates.BR_115200); var response = await scanner.Scan(new ConnectRequest() { Password = "1234" }, settings.EmbeddedDeviceHint, timeout); - LogManager.Log("Machine discovered on port: " + response.Adapter.Address, LogCategory.Debug); + LogManager.Log("Machine discovered on port: " + response.Adapter.Address, LogCategory.Info); LogManager.Log("Device Information:", LogCategory.Debug); - LogManager.Log(response.Response.DeviceInformation.ToJsonString(), LogCategory.Debug); + LogManager.Log(response.Response.DeviceInformation.ToJsonString(), LogCategory.Info); - LogManager.Log("Disconnecting machine operator...", LogCategory.Debug); + LogManager.Log("Disconnecting machine operator...", LogCategory.Info); await MachineOperator.Disconnect(); MachineOperator.Adapter = response.Adapter; MachineOperator.JobHandlingMode = JobHandlerModes.SettingUp; - LogManager.Log("Connecting machine operator...", LogCategory.Debug); + LogManager.Log("Connecting machine operator...", LogCategory.Info); try { await MachineOperator.Connect(); @@ -142,6 +150,8 @@ namespace Tango.PPC.Common.Connection settings.FirmwareVersion = MachineOperator.DeviceInformation.Version; settings.Save(); } + + disableConnectionFileLogging = false; } catch (Exception) { @@ -156,7 +166,7 @@ namespace Tango.PPC.Common.Connection } else { - LogManager.Log($"Connecting to machine on {settings.EmbeddedComPort}...", LogCategory.Debug); + LogManager.Log($"Connecting to machine on {settings.EmbeddedComPort}...", LogCategory.Info); UsbTransportAdapter adapter = new UsbTransportAdapter(settings.EmbeddedComPort, UsbSerialBaudRates.BR_115200); MachineOperator.Adapter = adapter; @@ -170,6 +180,8 @@ namespace Tango.PPC.Common.Connection settings.FirmwareVersion = MachineOperator.DeviceInformation.Version; settings.Save(); } + + disableConnectionFileLogging = false; } catch (Exception) { @@ -200,6 +212,8 @@ namespace Tango.PPC.Common.Connection LogManager.Log("Connecting machine operator..."); await MachineOperator.Connect(); + disableConnectionFileLogging = false; + if (MachineOperator.DeviceInformation != null) { settings.FirmwareVersion = MachineOperator.DeviceInformation.Version; @@ -212,7 +226,18 @@ namespace Tango.PPC.Common.Connection } catch (Exception ex) { - LogManager.Log(ex, LogCategory.Debug, "Error while trying to scan and connect to the machine."); + LogManager.Log(ex, "Error while trying to scan and connect to the machine."); + LogManager.Log("File logging of further connection attempts is now disabled and will resume when connection is successful."); + disableConnectionFileLogging = true; + } + finally + { + await Task.Delay(100); + + if (fileLogger != null) + { + fileLogger.Enabled = true; + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs index edb004344..a7f77855a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs @@ -33,6 +33,7 @@ namespace Tango.PPC.Common.FileSystem public String Id { get; set; } public String Path { get; set; } public bool IsPathTempZip { get; set; } + public String UploadPostPath { get; set; } public FileSystemOperation(FileSystemOperationMode mode, String path) { @@ -84,6 +85,7 @@ namespace Tango.PPC.Common.FileSystem webRtcTransporter.ComponentName = "File System Passive WebRTC Transporter"; webRtcTransporter.UseKeepAlive = false; webRtcTransporter.RegisterRequestHandler(WebRtcChunkDownloadRequestReceived); + webRtcTransporter.RegisterRequestHandler(WebRtcChunkUploadRequestReceived); await webRtcTransporter.Connect(); await receiver.SendGenericResponse(new InitWebRtcResponse(), token); _webRtcClients[receiver] = webRtcTransporter; @@ -99,6 +101,11 @@ namespace Tango.PPC.Common.FileSystem OnChunkDownloadRequest(request, token, transporter); } + private void WebRtcChunkUploadRequestReceived(ITransporter transporter, ChunkUploadRequest request, string token) + { + OnChunkUploadRequest(request, token, transporter); + } + [ExternalBridgeRequestHandlerMethod(typeof(GetFileSystemItemRequest))] public async void OnGetFileSystemItemRequest(GetFileSystemItemRequest request, String token, ExternalBridgeReceiver receiver) { @@ -118,9 +125,10 @@ namespace Tango.PPC.Common.FileSystem { try { - using (var stream = new FileStream(request.Path, FileMode.Create)) { } + var tempFile = TemporaryManager.CreateFile(); + using (var stream = new FileStream(tempFile, FileMode.Create)) { } - FileSystemOperation operation = new FileSystemOperation(FileSystemOperationMode.Upload, request.Path); + FileSystemOperation operation = new FileSystemOperation(FileSystemOperationMode.Upload, tempFile) { UploadPostPath = request.Path }; _operations.Add(operation.Id, operation); await receiver.SendGenericResponse(new FileUploadResponse() { OperationId = operation.Id }, token); @@ -131,6 +139,25 @@ namespace Tango.PPC.Common.FileSystem } } + [ExternalBridgeRequestHandlerMethod(typeof(FolderUploadRequest))] + public async void OnFolderUploadRequest(FolderUploadRequest request, String token, ExternalBridgeReceiver receiver) + { + try + { + var tempFile = TemporaryManager.CreateFile(); + using (var stream = new FileStream(tempFile, FileMode.Create)) { } + + FileSystemOperation operation = new FileSystemOperation(FileSystemOperationMode.Upload, tempFile) { UploadPostPath = request.Path, IsPathTempZip = true }; + _operations.Add(operation.Id, operation); + + await receiver.SendGenericResponse(new FolderUploadResponse() { OperationId = operation.Id }, token); + } + catch (Exception ex) + { + await receiver.SendErrorResponse(ex, token); + } + } + [ExternalBridgeRequestHandlerMethod(typeof(FileDownloadRequest))] public async void OnFileDownloadRequest(FileDownloadRequest request, String token, ExternalBridgeReceiver receiver) { @@ -191,7 +218,7 @@ namespace Tango.PPC.Common.FileSystem } [ExternalBridgeRequestHandlerMethod(typeof(ChunkUploadRequest))] - public async void OnChunkUploadRequest(ChunkUploadRequest request, String token, ExternalBridgeReceiver receiver) + public async void OnChunkUploadRequest(ChunkUploadRequest request, String token, ITransporter receiver) { try { @@ -209,6 +236,32 @@ namespace Tango.PPC.Common.FileSystem stream.Write(request.Data, 0, request.Data.Length); } + if (request.IsCompleted) + { + if (!operation.IsPathTempZip) + { + File.Copy(operation.Path, operation.UploadPostPath, true); + try + { + File.Delete(operation.Path); + } + catch { } + } + else + { + using (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile(operation.Path)) + { + zip.ExtractAll(operation.UploadPostPath, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently); + } + + try + { + File.Delete(operation.Path); + } + catch { } + } + } + await receiver.SendGenericResponse(new ChunkUploadResponse(), token, new TransportResponseConfig() { Priority = QueuePriority.Low }); } catch (Exception ex) @@ -230,12 +283,19 @@ namespace Tango.PPC.Common.FileSystem } FileStream stream = null; + bool removeTempZipFile = false; try { stream = new FileStream(operation.Path, FileMode.Open); stream.Position = request.Position; byte[] data = new byte[Math.Min(request.MaxChunkSize, stream.Length - stream.Position)]; + + if (stream.Position + data.Length == stream.Length) + { + removeTempZipFile = true; + } + await stream.ReadAsync(data, 0, data.Length); stream.Dispose(); stream = null; @@ -249,6 +309,20 @@ namespace Tango.PPC.Common.FileSystem stream?.Dispose(); await receiver.SendErrorResponse(ex, token); } + finally + { + if (operation.IsPathTempZip && removeTempZipFile) + { + try + { + if (File.Exists(operation.Path)) + { + File.Delete(operation.Path); + } + } + catch { } + } + } } [ExternalBridgeRequestHandlerMethod(typeof(AbortOperationRequest))] @@ -271,10 +345,6 @@ namespace Tango.PPC.Common.FileSystem { File.Delete(operation.Path); } - else if (Directory.Exists(operation.Path)) - { - Directory.Delete(operation.Path, true); - } } else if (operation.IsPathTempZip) { @@ -348,6 +418,20 @@ namespace Tango.PPC.Common.FileSystem } } + [ExternalBridgeRequestHandlerMethod(typeof(PerformDiskSpaceOptimizationRequest))] + public async void OnPerformDiskSpaceOptimizationRequest(PerformDiskSpaceOptimizationRequest request, String token, ExternalBridgeReceiver receiver) + { + try + { + var deletedBytes = _manager.PerformDiskSpaceOptimization(); + await receiver.SendGenericResponse(new PerformDiskSpaceOptimizationResponse() { DeletedBytes = deletedBytes }, token); + } + catch (Exception ex) + { + await receiver.SendErrorResponse(ex, token); + } + } + public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) { if (_webRtcClients.ContainsKey(receiver)) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + diff --git a/Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs index 0b65de64d..8ee0f4b8f 100644 --- a/Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs +++ b/Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs @@ -16,7 +16,7 @@ namespace Tango.Core.Helpers long bytes = Math.Abs(fileSize); int place = System.Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024))); double num = Math.Round(bytes / Math.Pow(1024, place), 1); - return (Math.Sign(fileSize) * num).ToString() + suf[place]; + return (Math.Sign(fileSize) * num).ToString() + " " + suf[place]; } } } diff --git a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs index 3660a18f0..0769b3576 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs @@ -233,6 +233,22 @@ namespace Tango.FileSystem public static readonly DependencyProperty RenameCommandInternalProperty = DependencyProperty.Register("RenameCommandInternal", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + public ICommand UploadCommandInternal + { + get { return (ICommand)GetValue(UploadCommandInternalProperty); } + set { SetValue(UploadCommandInternalProperty, value); } + } + public static readonly DependencyProperty UploadCommandInternalProperty = + DependencyProperty.Register("UploadCommandInternal", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand UploadCommand + { + get { return (ICommand)GetValue(UploadCommandProperty); } + set { SetValue(UploadCommandProperty, value); } + } + public static readonly DependencyProperty UploadCommandProperty = + DependencyProperty.Register("UploadCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + public bool IsContextMenuOpened { get { return (bool)GetValue(IsContextMenuOpenedProperty); } @@ -395,6 +411,11 @@ namespace Tango.FileSystem return true; }); + + UploadCommandInternal = new RelayCommand(() => + { + UploadCommand?.Execute(null); + }); } private void OnIsContextMenuOpenedChanged() @@ -408,6 +429,7 @@ namespace Tango.FileSystem (DeleteCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); (RenameCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); (NewFolderCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); + (UploadCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); if (IsContextMenuOpened) { @@ -808,6 +830,7 @@ namespace Tango.FileSystem try { + Debug.WriteLine("Drag Started..."); var ef = DragDrop.DoDragDrop(this, new DataObject(DataFormats.FileDrop, files, false), DragDropEffects.Copy); } catch (Exception ex) @@ -816,6 +839,8 @@ namespace Tango.FileSystem Debugger.Break(); } + Debug.WriteLine("Drag Stopped..."); + await Task.Delay(3000); foreach (var watcher in watchers) @@ -838,6 +863,7 @@ namespace Tango.FileSystem { if (IsVisible) { + AllowDrop = true; await Task.Delay(100); this.Focus(); Keyboard.Focus(this); diff --git a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs index 46ca080a2..c08304ca8 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileSystemManager.cs @@ -7,6 +7,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using Tango.Core.Helpers; using Tango.FileSystem.Network; +using Tango.Logging; namespace Tango.FileSystem { @@ -22,7 +23,7 @@ namespace Tango.FileSystem { Path = x.RootDirectory.FullName, DriveType = x.DriveType, - DriveLabel = x.Name, + DriveLabel = $"{x.VolumeLabel} ({x.Name.Replace("\\", "")})", Type = FileSystemItemType.Drive, }).Cast().ToList(); @@ -198,5 +199,61 @@ namespace Tango.FileSystem Path = fullPath }); } + + public long PerformDiskSpaceOptimization() + { + var tempDir = Path.GetTempPath(); + var logsFolder = FileLogger.DefaultLogsFolder; + + long sizeBefore = GetDirectorySize(new DirectoryInfo(tempDir)) + GetDirectorySize(new DirectoryInfo(logsFolder)); + + foreach (var file in Directory.GetFiles(tempDir, "*.*", SearchOption.AllDirectories)) + { + try + { + FileInfo fileInfo = new FileInfo(file); + if (fileInfo.LastWriteTime < DateTime.Now.AddDays(-1)) + { + File.Delete(file); + } + } + catch { } + } + + foreach (var file in Directory.GetFiles(logsFolder, "*.*", SearchOption.AllDirectories)) + { + try + { + FileInfo fileInfo = new FileInfo(file); + if (fileInfo.LastWriteTime < DateTime.Now.AddDays(-2)) + { + File.Delete(file); + } + } + catch { } + } + + long sizeAfter = GetDirectorySize(new DirectoryInfo(tempDir)) + GetDirectorySize(new DirectoryInfo(logsFolder)); + + return Math.Max(sizeBefore - sizeAfter, 0); + } + + public static long GetDirectorySize(DirectoryInfo d) + { + long size = 0; + // Add file sizes. + FileInfo[] fis = d.GetFiles(); + foreach (FileInfo fi in fis) + { + size += fi.Length; + } + // Add subdirectory sizes. + DirectoryInfo[] dis = d.GetDirectories(); + foreach (DirectoryInfo di in dis) + { + size += GetDirectorySize(di); + } + return size; + } } } diff --git a/Software/Visual_Studio/Tango.FileSystem/Network/ChunkDownloadRequest.cs b/Software/Visual_Studio/Tango.FileSystem/Network/ChunkDownloadRequest.cs index 16951930e..caedad88b 100644 --- a/Software/Visual_Studio/Tango.FileSystem/Network/ChunkDownloadRequest.cs +++ b/Software/Visual_Studio/Tango.FileSystem/Network/ChunkDownloadRequest.cs @@ -10,6 +10,6 @@ namespace Tango.FileSystem.Network { public String OperationId { get; set; } public long Position { get; set; } - public long MaxChunkSize { get; set; } = 1024 * 1024; + public long MaxChunkSize { get; set; } = 1024 * 10; } } diff --git a/Software/Visual_Studio/Tango.FileSystem/Network/ChunkUploadRequest.cs b/Software/Visual_Studio/Tango.FileSystem/Network/ChunkUploadRequest.cs index 98a27efd2..ed6b3e45f 100644 --- a/Software/Visual_Studio/Tango.FileSystem/Network/ChunkUploadRequest.cs +++ b/Software/Visual_Studio/Tango.FileSystem/Network/ChunkUploadRequest.cs @@ -10,5 +10,6 @@ namespace Tango.FileSystem.Network { public String OperationId { get; set; } public byte[] Data { get; set; } + public bool IsCompleted { get; set; } } } diff --git a/Software/Visual_Studio/Tango.FileSystem/Network/FolderUploadRequest.cs b/Software/Visual_Studio/Tango.FileSystem/Network/FolderUploadRequest.cs new file mode 100644 index 000000000..79a93eff3 --- /dev/null +++ b/Software/Visual_Studio/Tango.FileSystem/Network/FolderUploadRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FileSystem.Network +{ + public class FolderUploadRequest + { + public String Path { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.FileSystem/Network/FolderUploadResponse.cs b/Software/Visual_Studio/Tango.FileSystem/Network/FolderUploadResponse.cs new file mode 100644 index 000000000..dc661dc95 --- /dev/null +++ b/Software/Visual_Studio/Tango.FileSystem/Network/FolderUploadResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FileSystem.Network +{ + public class FolderUploadResponse + { + public String OperationId { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.FileSystem/Network/PerformDiskSpaceOptimizationRequest.cs b/Software/Visual_Studio/Tango.FileSystem/Network/PerformDiskSpaceOptimizationRequest.cs new file mode 100644 index 000000000..bd69bf9d8 --- /dev/null +++ b/Software/Visual_Studio/Tango.FileSystem/Network/PerformDiskSpaceOptimizationRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FileSystem.Network +{ + public class PerformDiskSpaceOptimizationRequest + { + } +} diff --git a/Software/Visual_Studio/Tango.FileSystem/Network/PerformDiskSpaceOptimizationResponse.cs b/Software/Visual_Studio/Tango.FileSystem/Network/PerformDiskSpaceOptimizationResponse.cs new file mode 100644 index 000000000..73cbbf566 --- /dev/null +++ b/Software/Visual_Studio/Tango.FileSystem/Network/PerformDiskSpaceOptimizationResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FileSystem.Network +{ + public class PerformDiskSpaceOptimizationResponse + { + public long DeletedBytes { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.FileSystem/Tango.FileSystem.csproj b/Software/Visual_Studio/Tango.FileSystem/Tango.FileSystem.csproj index a31af216c..d78419b7f 100644 --- a/Software/Visual_Studio/Tango.FileSystem/Tango.FileSystem.csproj +++ b/Software/Visual_Studio/Tango.FileSystem/Tango.FileSystem.csproj @@ -64,10 +64,14 @@ + + + + MSBuild:Compile @@ -131,6 +135,10 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {BC932DBD-7CDB-488C-99E4-F02CF441F55E} + Tango.Logging + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI diff --git a/Software/Visual_Studio/Tango.Transport/Adapters/SignalRTransportAdapter.cs b/Software/Visual_Studio/Tango.Transport/Adapters/SignalRTransportAdapter.cs index def4cd741..de472d993 100644 --- a/Software/Visual_Studio/Tango.Transport/Adapters/SignalRTransportAdapter.cs +++ b/Software/Visual_Studio/Tango.Transport/Adapters/SignalRTransportAdapter.cs @@ -30,7 +30,7 @@ namespace Tango.Transport.Adapters public String Hub { get; set; } /// - /// Gets or sets the serial number of the remote machine (Use onlt for ) mode. + /// Gets or sets the serial number of the remote machine (Use only for ) mode. /// public String SerialNumber { get; set; } @@ -66,7 +66,7 @@ namespace Tango.Transport.Adapters public SignalRTransportAdapter() : base() { ConnectionTimeout = TimeSpan.FromSeconds(30); - WriteInterval = TimeSpan.FromMilliseconds(10); + WriteInterval = TimeSpan.FromMilliseconds(1); ComponentName = $"SignalR Adapter {_component_counter++}"; } @@ -161,9 +161,10 @@ namespace Tango.Transport.Adapters { if (!completed) { + completed = true; + LogManager.Log($"SignalR adapter session created ({SessionID})..."); LogManager.Log("SingalR adapter connected."); - completed = true; State = TransportComponentState.Connected; StartPushThread(); @@ -173,8 +174,12 @@ namespace Tango.Transport.Adapters } catch (Exception ex) { - LogManager.Log(ex, "Error occurred after session created."); - completionSource.SetException(ex); + if (!completed) + { + LogManager.Log(ex, "Error occurred after session created."); + completed = true; + completionSource.SetException(ex); + } } }); } @@ -211,8 +216,12 @@ namespace Tango.Transport.Adapters } catch (Exception ex) { - LogManager.Log(ex, "Error occurred on connection state changed event."); - completionSource.SetException(ex); + if (!completed) + { + completed = true; + LogManager.Log(ex, "Error occurred on connection state changed event."); + completionSource.SetException(ex); + } } }; diff --git a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs index 485eda628..4785e11c8 100644 --- a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs +++ b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs @@ -290,7 +290,6 @@ namespace Tango.Transport.Adapters { try { - LogManager.Log($"Finalizing USB transport adapter ({Address})."); _serialPort.Close(); _serialPort.Dispose(); } diff --git a/Software/Visual_Studio/Tango.Transport/ITransportAdapter.cs b/Software/Visual_Studio/Tango.Transport/ITransportAdapter.cs index d77ad1ed4..1c397aae3 100644 --- a/Software/Visual_Studio/Tango.Transport/ITransportAdapter.cs +++ b/Software/Visual_Studio/Tango.Transport/ITransportAdapter.cs @@ -15,6 +15,11 @@ namespace Tango.Transport /// public interface ITransportAdapter : ITransportComponent, INotifyPropertyChanged { + /// + /// Gets the last failed state exception/reason. + /// + Exception FailedStateException { get; } + /// /// Gets the total bytes received. /// diff --git a/Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs b/Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs index bdcf0ee64..ebae5855a 100644 --- a/Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransportAdapterBase.cs @@ -87,6 +87,10 @@ namespace Tango.Transport set { _address = value; RaisePropertyChangedAuto(); } } + /// + /// Gets the last failed state exception/reason. + /// + public Exception FailedStateException { get; private set; } private TransportComponentState _state; /// @@ -115,6 +119,7 @@ namespace Tango.Transport /// The ex. protected virtual void OnFailed(Exception ex) { + FailedStateException = ex; LogManager.Log(ex, $"{ComponentName}: Adapter failed."); Disconnect().Wait(); State = TransportComponentState.Failed; diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index 916992bc3..5e076738c 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -241,7 +241,7 @@ namespace Tango.Transport { if (e == TransportComponentState.Failed && FailsWithAdapter) { - OnFailed(new CommunicationException("The adapter has failed. Going into a failed state...")); + OnFailed(new CommunicationException($"The adapter has failed with exception '{Adapter.FailedStateException.Message}' and the transporter is configured to fail with the adapter.")); } } @@ -1382,6 +1382,12 @@ namespace Tango.Transport message.SetResult(true, true); } } + catch (ThreadAbortException) + { + Exception requestException = FailedStateException != null ? FailedStateException : new TransporterDisconnectedException("The transporter push thread has been aborted."); + OnRequestFailed(message, requestException); + message.SetException(requestException); + } catch (Exception ex) { OnRequestFailed(message, ex); -- cgit v1.3.1 From 091a4bdeb2feadb4962c6be5deb367ab56d81707 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 30 Mar 2020 00:56:02 +0300 Subject: Implemented PPC Updates & Packages. Moved PPC/FSE interfaces to PPC.Shared. Changes Generic Serialization to json. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes Software/DB/TCC/TCC.mdf | Bin 8388608 -> 8388608 bytes Software/DB/TCC/TCC_log.ldf | Bin 8388608 -> 8388608 bytes .../Tango.FSE.PPCConsole.csproj | 12 ++ .../Tango.FSE.PPCConsole/ViewModelLocator.cs | 9 ++ .../Tango.FSE.PPCConsole/ViewModels/MainViewVM.cs | 1 + .../ViewModels/MonitoringViewVM.cs | 2 +- .../ViewModels/UpdatesViewVM.cs | 138 +++++++++++++++++++++ .../Tango.FSE.PPCConsole/Views/MainView.xaml | 2 +- .../Tango.FSE.PPCConsole/Views/UpdatesView.xaml | 123 ++++++++++++++++++ .../Tango.FSE.PPCConsole/Views/UpdatesView.xaml.cs | 28 +++++ .../FSE/Tango.FSE.Common/FSEViewModel.cs | 7 ++ .../MachineUpdates/IMachineUpdatesProvider.cs | 13 ++ .../MachineUpdates/MachineUpdatesResult.cs | 22 ++++ .../Performance/PerformancePackageEventArgs.cs | 2 +- .../FSE/Tango.FSE.Common/Resources/Styles.xaml | 39 +++++- .../SystemInfo/ISystemInfoProvider.cs | 2 +- .../FSE/Tango.FSE.Common/Tango.FSE.Common.csproj | 6 + .../DefaultMachineUpdatesProvider.cs | 51 ++++++++ .../Performance/DefaultPerformanceProvider.cs | 2 +- .../SystemInfo/DefaultSystemInfoProvider.cs | 2 +- .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 5 + .../FSE/Tango.FSE.UI/ViewModelLocator.cs | 4 + .../Tango.PPC.Technician.csproj | 4 + .../ViewModels/PackagesViewVM.cs | 1 + .../MachineUpdate/MachineUpdateManager.cs | 43 ++++++- .../Performance/DefaultPerformanceService.cs | 2 +- .../SystemInfo/DefaultSystemInfoService.cs | 2 +- .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 9 +- .../UpdatePackages/DefaultPackageRunner.cs | 1 + .../UpdatePackages/IPackageRunner.cs | 1 + .../UpdatePackages/PPCPackageAttribute.cs | 1 + .../UpdatePackages/PackageInstallation.cs | 26 ---- .../UpdatePackages/PackageInstallationState.cs | 15 --- .../UpdatePackages/PackageStateChangedEventArgs.cs | 1 + .../Tango.PPC.Common/UpdatePackages/PackageType.cs | 14 --- .../UpdatePackages/PackagesFile.cs | 1 + .../Information/GetMachineInformationRequest.cs | 12 ++ .../Information/GetMachineInformationResponse.cs | 13 ++ .../Information/InformationPackage.cs | 19 +++ .../Performance/PerformancePackage.cs | 25 ++++ .../Performance/StartPerformanceUpdatesRequest.cs | 12 ++ .../Performance/StartPerformanceUpdatesResponse.cs | 13 ++ .../Tango.PPC.Shared/Properties/AssemblyInfo.cs | 23 ++++ .../Properties/Resources.Designer.cs | 62 +++++++++ .../PPC/Tango.PPC.Shared/Properties/Resources.resx | 117 +++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Tango.PPC.Shared/Properties/Settings.settings | 7 ++ .../PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj | 104 ++++++++++++++++ .../PPC/Tango.PPC.Shared/Themes/Generic.xaml | 6 + .../Updates/GetUpdatesAndPackagesRequest.cs | 13 ++ .../Updates/GetUpdatesAndPackagesResponse.cs | 22 ++++ .../Updates/PackageInstallation.cs | 26 ++++ .../Updates/PackageInstallationState.cs | 15 +++ .../PPC/Tango.PPC.Shared/Updates/PackageType.cs | 14 +++ .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 6 +- .../ExtensionMethods/ObjectExtensions.cs | 6 +- .../Tango.FileSystem/FileExplorerControl.cs | 13 ++ .../ExternalBridge/ExternalBridgeService.cs | 2 +- .../Information/GetMachineInformationRequest.cs | 12 -- .../Information/GetMachineInformationResponse.cs | 13 -- .../Network/Information/InformationPackage.cs | 19 --- .../Network/Performance/PerformancePackage.cs | 25 ---- .../Performance/StartPerformanceUpdatesRequest.cs | 12 -- .../Performance/StartPerformanceUpdatesResponse.cs | 13 -- .../Tango.Integration/Tango.Integration.csproj | 8 +- .../Tango.SharedUI/Helpers/DataGridHelper.cs | 67 ++++++++++ .../Tango.SharedUI/Tango.SharedUI.csproj | 3 +- .../Tango.Transport/GenericMessageSerializer.cs | 137 ++++++++++++++++++++ .../Tango.Transport/ProtoSerializer.cs | 87 ------------- .../Tango.Transport/Tango.Transport.csproj | 4 +- .../Tango.Transport/TransporterBase.cs | 12 +- Software/Visual_Studio/Tango.sln | 35 +++++- 74 files changed, 1318 insertions(+), 280 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/UpdatesViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/UpdatesView.xaml create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/UpdatesView.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/MachineUpdates/IMachineUpdatesProvider.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/MachineUpdates/MachineUpdatesResult.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/MachineUpdates/DefaultMachineUpdatesProvider.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageInstallation.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageInstallationState.cs delete mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageType.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/GetMachineInformationRequest.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/GetMachineInformationResponse.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/InformationPackage.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/PerformancePackage.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/StartPerformanceUpdatesRequest.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/StartPerformanceUpdatesResponse.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Resources.resx create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Settings.settings create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Themes/Generic.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/GetUpdatesAndPackagesRequest.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/GetUpdatesAndPackagesResponse.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageInstallation.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageInstallationState.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageType.cs delete mode 100644 Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/GetMachineInformationRequest.cs delete mode 100644 Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/GetMachineInformationResponse.cs delete mode 100644 Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/InformationPackage.cs delete mode 100644 Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/PerformancePackage.cs delete mode 100644 Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/StartPerformanceUpdatesRequest.cs delete mode 100644 Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/StartPerformanceUpdatesResponse.cs create mode 100644 Software/Visual_Studio/Tango.SharedUI/Helpers/DataGridHelper.cs create mode 100644 Software/Visual_Studio/Tango.Transport/GenericMessageSerializer.cs delete mode 100644 Software/Visual_Studio/Tango.Transport/ProtoSerializer.cs (limited to 'Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index b785ddea1..30056be9a 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 3f2b8561e..0509b635d 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/TCC/TCC.mdf b/Software/DB/TCC/TCC.mdf index e9c5e31ae..55f397ec0 100644 Binary files a/Software/DB/TCC/TCC.mdf and b/Software/DB/TCC/TCC.mdf differ diff --git a/Software/DB/TCC/TCC_log.ldf b/Software/DB/TCC/TCC_log.ldf index 701c8f115..8e326c1e0 100644 Binary files a/Software/DB/TCC/TCC_log.ldf and b/Software/DB/TCC/TCC_log.ldf differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Tango.FSE.PPCConsole.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Tango.FSE.PPCConsole.csproj index be14e05f1..9484930e4 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Tango.FSE.PPCConsole.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Tango.FSE.PPCConsole.csproj @@ -112,6 +112,10 @@ + + + UpdatesView.xaml + ConsoleView.xaml @@ -158,6 +162,10 @@ + + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7} + Tango.PPC.Shared + {6b9774f7-960d-438e-ad81-c6b9be328d50} RealTimeGraphX.WPF @@ -236,6 +244,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + Designer MSBuild:Compile diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModelLocator.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModelLocator.cs index 93317651c..4faa72e8e 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModelLocator.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModelLocator.cs @@ -17,6 +17,7 @@ namespace Tango.FSE.PPCConsole TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); } public static MainViewVM MainViewVM @@ -58,5 +59,13 @@ namespace Tango.FSE.PPCConsole return TangoIOC.Default.GetInstance(); } } + + public static UpdatesViewVM UpdatesViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/MainViewVM.cs index 5c73f70cc..e18a75ef6 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/MainViewVM.cs @@ -19,6 +19,7 @@ namespace Tango.FSE.PPCConsole.ViewModels RemoteDesktopView, MonitoringView, FileSystemView, + UpdatesView, } private NavigationView _selectedView; diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/MonitoringViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/MonitoringViewVM.cs index 890adcf54..64c8a124e 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/MonitoringViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/MonitoringViewVM.cs @@ -13,7 +13,7 @@ using Tango.Core.Helpers; using Tango.FSE.Common; using Tango.FSE.Common.Graphs; using Tango.FSE.Common.Performance; -using Tango.Integration.ExternalBridge.Network.Information; +using Tango.PPC.Shared.Information; using Tango.SystemInfo; using static Tango.SharedUI.Controls.NavigationControl; diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/UpdatesViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/UpdatesViewVM.cs new file mode 100644 index 000000000..df29a6eeb --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/UpdatesViewVM.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.FSE.Common; +using Tango.PPC.Shared.Updates; +using static Tango.SharedUI.Controls.NavigationControl; + +namespace Tango.FSE.PPCConsole.ViewModels +{ + public class UpdatesViewVM : FSEViewModel, INavigationViewModel + { + private bool _loaded; + private ICollectionView _updatesView; + private ICollectionView _packagesView; + + private List _updates; + public List Updates + { + get { return _updates; } + set { _updates = value; RaisePropertyChangedAuto(); } + } + + private List _packages; + public List Packages + { + get { return _packages; } + set { _packages = value; RaisePropertyChangedAuto(); } + } + + private String _filter; + public String Filter + { + get { return _filter; } + set { _filter = value; RaisePropertyChangedAuto(); OnFilterChanged(); } + } + + public RelayCommand RefreshCommand { get; set; } + public RelayCommand UpdateDetailsCommand { get; set; } + + public UpdatesViewVM() + { + UpdateDetailsCommand = new RelayCommand(DisplayUpdateDetails); + RefreshCommand = new RelayCommand(RefreshUpdates); + } + + private void RefreshUpdates() + { + _loaded = false; + LoadMachineUpdates(); + } + + private void DisplayUpdateDetails(TangoUpdate update) + { + Debug.WriteLine($"Update Details: {update.ApplicationVersion}"); + } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + LoadMachineUpdates(); + } + + public override void OnApplicationStarted() + { + base.OnApplicationStarted(); + MachineProvider.MachineConnected += MachineProvider_MachineConnected; + } + + private void MachineProvider_MachineConnected(object sender, Common.Connection.MachineConnectedEventArgs e) + { + _loaded = false; + + if (IsVisible) + { + LoadMachineUpdates(); + } + } + + private void OnFilterChanged() + { + _updatesView?.Refresh(); + _packagesView?.Refresh(); + } + + private async void LoadMachineUpdates() + { + if (!_loaded) + { + try + { + IsFree = false; + await Task.Delay(1000); + var result = await MachineUpdatesProvider.GetUpdates(); + Updates = result.Updates.ToList(); + Packages = result.Packages.ToList(); + + _filter = null; + RaisePropertyChanged(nameof(Filter)); + + _updatesView = CollectionViewSource.GetDefaultView(Updates); + _updatesView.Filter = OnUpdatesFilter; + + _packagesView = CollectionViewSource.GetDefaultView(Packages); + _packagesView.Filter = OnPackagesFilter; + + _loaded = true; + } + catch (Exception ex) + { + LogManager.Log(ex, "Error retrieving machine updates."); + } + finally + { + IsFree = true; + } + } + } + + private bool OnPackagesFilter(object obj) + { + PackageInstallation package = obj as PackageInstallation; + return String.IsNullOrWhiteSpace(Filter) || package.PackageName.ToLower().Contains(Filter.ToLower()); + } + + private bool OnUpdatesFilter(object obj) + { + TangoUpdate update = obj as TangoUpdate; + return String.IsNullOrWhiteSpace(Filter) || update.UpdateStatus.ToDescription().ToLower().Contains(Filter.ToLower()); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/MainView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/MainView.xaml index e11014515..93e1355be 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/MainView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/MainView.xaml @@ -34,7 +34,7 @@ - + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/UpdatesView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/UpdatesView.xaml new file mode 100644 index 000000000..232d30893 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/UpdatesView.xaml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Loading machine updates... + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/UpdatesView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/UpdatesView.xaml.cs new file mode 100644 index 000000000..959223f9b --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Views/UpdatesView.xaml.cs @@ -0,0 +1,28 @@ +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.FSE.PPCConsole.Views +{ + /// + /// Interaction logic for ConsoleView.xaml + /// + public partial class UpdatesView : UserControl + { + public UpdatesView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs index ce61f30c6..bae284bfe 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FSEViewModel.cs @@ -23,6 +23,7 @@ using Tango.FSE.Common.Logging; using Tango.FSE.Common.Navigation; using Tango.FSE.Common.Notifications; using Tango.FSE.Common.Performance; +using Tango.FSE.Common.MachineUpdates; using Tango.FSE.Common.RemoteDesktop; using Tango.FSE.Common.Resolution; using Tango.FSE.Common.Storage; @@ -125,6 +126,12 @@ namespace Tango.FSE.Common [TangoInject] public IStorageProvider StorageProvider { get; set; } + /// + /// Gets or sets the machine updates provider. + /// + [TangoInject] + public IMachineUpdatesProvider MachineUpdatesProvider { get; set; } + /// /// Gets or sets the FSE service. /// diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/MachineUpdates/IMachineUpdatesProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/MachineUpdates/IMachineUpdatesProvider.cs new file mode 100644 index 000000000..eff9e655b --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/MachineUpdates/IMachineUpdatesProvider.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Common.MachineUpdates +{ + public interface IMachineUpdatesProvider + { + Task GetUpdates(); + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/MachineUpdates/MachineUpdatesResult.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/MachineUpdates/MachineUpdatesResult.cs new file mode 100644 index 000000000..870b4b618 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/MachineUpdates/MachineUpdatesResult.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.PPC.Shared.Updates; + +namespace Tango.FSE.Common.MachineUpdates +{ + public class MachineUpdatesResult + { + public List Updates { get; set; } + public List Packages { get; set; } + + public MachineUpdatesResult() + { + Updates = new List(); + Packages = new List(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Performance/PerformancePackageEventArgs.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Performance/PerformancePackageEventArgs.cs index 669890a29..c177ed5a6 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Performance/PerformancePackageEventArgs.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Performance/PerformancePackageEventArgs.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.Integration.ExternalBridge.Network.Performance; +using Tango.PPC.Shared.Performance; namespace Tango.FSE.Common.Performance { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml index 5ff141bd7..8b549f98f 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml @@ -467,19 +467,24 @@ + + + + + - - - + + + - - + + @@ -493,4 +498,28 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SystemInfo/ISystemInfoProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SystemInfo/ISystemInfoProvider.cs index d21224c4d..b842d034f 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/SystemInfo/ISystemInfoProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SystemInfo/ISystemInfoProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.Integration.ExternalBridge.Network.Information; +using Tango.PPC.Shared.Information; namespace Tango.FSE.Common.SystemInfo { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index ce56e7f69..f2bbcb71f 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -135,6 +135,8 @@ + + @@ -272,6 +274,10 @@ + + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7} + Tango.PPC.Shared + {6b9774f7-960d-438e-ad81-c6b9be328d50} RealTimeGraphX.WPF diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/MachineUpdates/DefaultMachineUpdatesProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/MachineUpdates/DefaultMachineUpdatesProvider.cs new file mode 100644 index 000000000..4f2ee9b02 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/MachineUpdates/DefaultMachineUpdatesProvider.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.FSE.Common.Connection; +using Tango.FSE.Common.MachineUpdates; +using Tango.PPC.Shared.Updates; +using Tango.Transport; + +namespace Tango.FSE.UI.MachineUpdates +{ + public class DefaultMachineUpdatesProvider : IMachineUpdatesProvider + { + private MachineUpdatesResult _lastResult; + private IMachineProvider MachineProvider { get; set; } + + public DefaultMachineUpdatesProvider(IMachineProvider machineProvider) + { + MachineProvider = machineProvider; + MachineProvider.MachineDisconnected += MachineProvider_MachineDisconnected; + } + + private void MachineProvider_MachineDisconnected(object sender, MachineDisconnectedEventArgs e) + { + _lastResult = null; + } + + public async Task GetUpdates() + { + if (_lastResult != null) + { + return _lastResult; + } + + var response = await MachineProvider.MachineOperator.SendGenericRequest(new GetUpdatesAndPackagesRequest() { }, new TransportRequestConfig() + { + Timeout = TimeSpan.FromSeconds(30) + }); + + MachineUpdatesResult result = new MachineUpdatesResult(); + result.Updates = response.Updates.Select(x => x.ToObservable()).ToList(); + result.Packages = response.Packages; + + _lastResult = result; + + return result; + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Performance/DefaultPerformanceProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Performance/DefaultPerformanceProvider.cs index 69184290a..8debcd73b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Performance/DefaultPerformanceProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Performance/DefaultPerformanceProvider.cs @@ -7,7 +7,7 @@ using Tango.Core; using Tango.Core.DI; using Tango.FSE.Common.Connection; using Tango.FSE.Common.Performance; -using Tango.Integration.ExternalBridge.Network.Performance; +using Tango.PPC.Shared.Performance; namespace Tango.FSE.UI.Performance { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/SystemInfo/DefaultSystemInfoProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/SystemInfo/DefaultSystemInfoProvider.cs index e691939f0..5fcc1809d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/SystemInfo/DefaultSystemInfoProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/SystemInfo/DefaultSystemInfoProvider.cs @@ -7,7 +7,7 @@ using Tango.Core; using Tango.Core.DI; using Tango.FSE.Common.Connection; using Tango.FSE.Common.SystemInfo; -using Tango.Integration.ExternalBridge.Network.Information; +using Tango.PPC.Shared.Information; namespace Tango.FSE.UI.SystemInfo { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index b4854db5a..eb6810d48 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -170,6 +170,7 @@ + @@ -331,6 +332,10 @@ + + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7} + Tango.PPC.Shared + {bb2abb74-ba58-4812-83aa-ec8171f42df4} Tango.AutoComplete diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs index 1ffb0cbb7..d94e4ff9c 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs @@ -19,6 +19,7 @@ using Tango.FSE.Common.Modules; using Tango.FSE.Common.Navigation; using Tango.FSE.Common.Notifications; using Tango.FSE.Common.Performance; +using Tango.FSE.Common.MachineUpdates; using Tango.FSE.Common.RemoteDesktop; using Tango.FSE.Common.Resolution; using Tango.FSE.Common.Storage; @@ -36,6 +37,7 @@ using Tango.FSE.UI.Modules; using Tango.FSE.UI.Navigation; using Tango.FSE.UI.Notifications; using Tango.FSE.UI.Performance; +using Tango.FSE.UI.MachineUpdates; using Tango.FSE.UI.RemoteDesktop; using Tango.FSE.UI.Resolution; using Tango.FSE.UI.Storage; @@ -67,6 +69,7 @@ namespace Tango.FSE.UI TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); + TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); @@ -93,6 +96,7 @@ namespace Tango.FSE.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj index bdbc5992c..e8eec7b2f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj @@ -181,6 +181,10 @@ {0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0} Tango.PPC.Common + + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7} + Tango.PPC.Shared + {f02eaa84-ad59-465b-99a2-4422c13bfb72} Tango.PPC.Browser diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/PackagesViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/PackagesViewVM.cs index 3f3e44c4d..1d7e1780a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/PackagesViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/PackagesViewVM.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Tango.Core.DI; using Tango.PPC.Common; using Tango.PPC.Common.UpdatePackages; +using Tango.PPC.Shared.Updates; namespace Tango.PPC.Technician.ViewModels { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 1d010ecfb..733574f72 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -31,10 +31,14 @@ using Tango.SharedUI.Helpers; using Tango.SQLExaminer; using Tango.Transport.Web; using System.Data.Entity; +using Tango.PPC.Common.ExternalBridge; +using Tango.Integration.ExternalBridge; +using Tango.BL.DTO; +using Tango.PPC.Shared.Updates; namespace Tango.PPC.Common.MachineUpdate { - public class MachineUpdateManager : ExtendedObject, IMachineUpdateManager + public class MachineUpdateManager : ExtendedObject, IMachineUpdateManager, IExternalBridgeRequestHandler { private IPPCApplicationManager _app_manager; private IMachineProvider _machineProvider; @@ -95,7 +99,7 @@ namespace Tango.PPC.Common.MachineUpdate /// Initializes a new instance of the class. /// /// The application manager. - public MachineUpdateManager(PPCWebClient ppcWebClient, IPPCApplicationManager applicationManager, IMachineProvider machineProvider, IPackageRunner packageRunner) + public MachineUpdateManager(PPCWebClient ppcWebClient, IPPCApplicationManager applicationManager, IMachineProvider machineProvider, IPackageRunner packageRunner, IPPCExternalBridgeService externalBridge) { _client = ppcWebClient; _machineProvider = machineProvider; @@ -111,6 +115,8 @@ namespace Tango.PPC.Common.MachineUpdate _checkForUpdateTimer = new System.Timers.Timer(_settings.AutoUpdateCheckInterval.TotalMilliseconds); _checkForUpdateTimer.Elapsed += _checkForUpdateTimer_Elapsed; _checkForUpdateTimer.Start(); + + externalBridge.RegisterRequestHandler(this); } #endregion @@ -1676,5 +1682,38 @@ namespace Tango.PPC.Common.MachineUpdate } #endregion + + #region External Bridge + + public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) + { + + } + + [ExternalBridgeRequestHandlerMethod(typeof(GetUpdatesAndPackagesRequest))] + public async void OnGetUpdatesAndPackagesRequest(GetUpdatesAndPackagesRequest request, String token, ExternalBridgeReceiver receiver) + { + try + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var updates = await db.TangoUpdates.OrderByDescending(x => x.StartDate).ToListAsync(); + var updatesDTO = updates.Select(x => TangoUpdateDTO.FromObservable(x)).ToList(); + var packages = (await _packageRunner.GetPackagesFile()).PackageInstallations; + + var response = new GetUpdatesAndPackagesResponse(); + response.Updates.AddRange(updatesDTO); + response.Packages.AddRange(packages); + + await receiver.SendGenericResponse(response, token); + } + } + catch (Exception ex) + { + await receiver.SendErrorResponse(ex, token); + } + } + + #endregion } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Performance/DefaultPerformanceService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Performance/DefaultPerformanceService.cs index 2279d204c..d327f6b00 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Performance/DefaultPerformanceService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Performance/DefaultPerformanceService.cs @@ -10,8 +10,8 @@ using System.Threading.Tasks; using Tango.Core; using Tango.Core.DI; using Tango.Integration.ExternalBridge; -using Tango.Integration.ExternalBridge.Network.Performance; using Tango.PPC.Common.ExternalBridge; +using Tango.PPC.Shared.Performance; namespace Tango.PPC.Common.Performance { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs index a5e8516a4..ef8e31bce 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs @@ -8,10 +8,10 @@ using System.Threading.Tasks; using Tango.Core; using Tango.Core.DI; using Tango.Integration.ExternalBridge; -using Tango.Integration.ExternalBridge.Network.Information; using Tango.PPC.Common.Application; using Tango.PPC.Common.Connectivity; using Tango.PPC.Common.ExternalBridge; +using Tango.PPC.Shared.Information; using Tango.Settings; using Tango.SystemInfo; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index ad197f47b..9575b7137 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -181,13 +181,10 @@ - - - @@ -429,6 +426,10 @@ {6aa425c9-ea6a-4b01-aaed-5ff122e8b663} Tango.WiFi + + {208c8bd8-72c6-4e3c-acaa-351091a2acc7} + Tango.PPC.Shared + @@ -455,7 +456,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/DefaultPackageRunner.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/DefaultPackageRunner.cs index c94aedeb0..68b31da4e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/DefaultPackageRunner.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/DefaultPackageRunner.cs @@ -15,6 +15,7 @@ using Tango.Core.Helpers; using Tango.PPC.Common.Application; using Tango.PPC.Common.Connection; using Tango.PPC.Common.Notifications; +using Tango.PPC.Shared.Updates; namespace Tango.PPC.Common.UpdatePackages { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/IPackageRunner.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/IPackageRunner.cs index b864100aa..cdffd1ddc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/IPackageRunner.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/IPackageRunner.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.PPC.Shared.Updates; namespace Tango.PPC.Common.UpdatePackages { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PPCPackageAttribute.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PPCPackageAttribute.cs index 3186b57b1..6067b0c18 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PPCPackageAttribute.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PPCPackageAttribute.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.PPC.Shared.Updates; namespace Tango.PPC.Common.UpdatePackages { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageInstallation.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageInstallation.cs deleted file mode 100644 index bf00915bd..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageInstallation.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.PPC.Common.UpdatePackages -{ - public class PackageInstallation - { - public String PackageName { get; set; } - - public PackageType Type { get; set; } - - public DateTime InstallationDate { get; set; } - - public PackageInstallationState State { get; set; } - - public String FailedReason { get; set; } - - public PackageInstallation() - { - InstallationDate = DateTime.Now; - } - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageInstallationState.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageInstallationState.cs deleted file mode 100644 index 1300352fb..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageInstallationState.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.PPC.Common.UpdatePackages -{ - public enum PackageInstallationState - { - NotInstalled, - Installed, - Failed, - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageStateChangedEventArgs.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageStateChangedEventArgs.cs index 9c8cbe2c0..cadba4c72 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageStateChangedEventArgs.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageStateChangedEventArgs.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.PPC.Shared.Updates; namespace Tango.PPC.Common.UpdatePackages { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageType.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageType.cs deleted file mode 100644 index 48a2140b1..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackageType.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.PPC.Common.UpdatePackages -{ - public enum PackageType - { - Pre, - Post - } -} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackagesFile.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackagesFile.cs index 2fbd30d9f..7af30d2ec 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackagesFile.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/UpdatePackages/PackagesFile.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.PPC.Shared.Updates; namespace Tango.PPC.Common.UpdatePackages { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/GetMachineInformationRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/GetMachineInformationRequest.cs new file mode 100644 index 000000000..1464c15ac --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/GetMachineInformationRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Information +{ + public class GetMachineInformationRequest + { + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/GetMachineInformationResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/GetMachineInformationResponse.cs new file mode 100644 index 000000000..e88bfce05 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/GetMachineInformationResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Information +{ + public class GetMachineInformationResponse + { + public InformationPackage Package { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/InformationPackage.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/InformationPackage.cs new file mode 100644 index 000000000..e48413db6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Information/InformationPackage.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SystemInfo; + +namespace Tango.PPC.Shared.Information +{ + public class InformationPackage + { + public List System { get; set; } + + public InformationPackage() + { + System = new List(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/PerformancePackage.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/PerformancePackage.cs new file mode 100644 index 000000000..855437bcc --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/PerformancePackage.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Performance +{ + public class PerformancePackage + { + public int CPU { get; set; } + public int ApplicationCPU { get; set; } + + public int RAM { get; set; } + public int ApplicationRAM { get; set; } + public int MaxRAM { get; set; } + + public int Temperature { get; set; } + + public int AvailableDiskSpace { get; set; } + public int DiskCapacity { get; set; } + + public DateTime DateTime { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/StartPerformanceUpdatesRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/StartPerformanceUpdatesRequest.cs new file mode 100644 index 000000000..69fbaf631 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/StartPerformanceUpdatesRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Performance +{ + public class StartPerformanceUpdatesRequest + { + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/StartPerformanceUpdatesResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/StartPerformanceUpdatesResponse.cs new file mode 100644 index 000000000..196225572 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Performance/StartPerformanceUpdatesResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Performance +{ + public class StartPerformanceUpdatesResponse + { + public PerformancePackage Package { get; set; } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..c9efeb790 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +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 Panel PC Shared Library")] +[assembly: AssemblyVersion("1.0.0.0")] + +[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) +)] + +//Friends With +[assembly: InternalsVisibleTo("Tango.PPC.UI")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Resources.Designer.cs new file mode 100644 index 000000000..416184c0f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/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.PPC.Shared.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.PPC.Shared.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/PPC/Tango.PPC.Shared/Properties/Resources.resx b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/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/PPC/Tango.PPC.Shared/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Settings.Designer.cs new file mode 100644 index 000000000..0b65472a5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/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.PPC.Shared.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/PPC/Tango.PPC.Shared/Properties/Settings.settings b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj new file mode 100644 index 000000000..2ae1c7575 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj @@ -0,0 +1,104 @@ + + + + + Debug + AnyCPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7} + library + Tango.PPC.Shared + Tango.PPC.Shared + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + true + full + false + ..\..\Build\PPC\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Build\PPC\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + + GlobalVersionInfo.cs + + + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {997a961c-beda-4b56-aa0f-c39e532f7ffa} + Tango.SystemInfo + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Themes/Generic.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Themes/Generic.xaml new file mode 100644 index 000000000..1226f66d1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Themes/Generic.xaml @@ -0,0 +1,6 @@ + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/GetUpdatesAndPackagesRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/GetUpdatesAndPackagesRequest.cs new file mode 100644 index 000000000..f8cadc49d --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/GetUpdatesAndPackagesRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Updates +{ + public class GetUpdatesAndPackagesRequest + { + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/GetUpdatesAndPackagesResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/GetUpdatesAndPackagesResponse.cs new file mode 100644 index 000000000..d264739d7 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/GetUpdatesAndPackagesResponse.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.DTO; + +namespace Tango.PPC.Shared.Updates +{ + public class GetUpdatesAndPackagesResponse + { + public List Updates { get; set; } + + public List Packages { get; set; } + + public GetUpdatesAndPackagesResponse() + { + Updates = new List(); + Packages = new List(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageInstallation.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageInstallation.cs new file mode 100644 index 000000000..639fd76bf --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageInstallation.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Updates +{ + public class PackageInstallation + { + public String PackageName { get; set; } + + public PackageType Type { get; set; } + + public DateTime InstallationDate { get; set; } + + public PackageInstallationState State { get; set; } + + public String FailedReason { get; set; } + + public PackageInstallation() + { + InstallationDate = DateTime.Now; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageInstallationState.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageInstallationState.cs new file mode 100644 index 000000000..51ae2abce --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageInstallationState.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Updates +{ + public enum PackageInstallationState + { + NotInstalled, + Installed, + Failed, + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageType.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageType.cs new file mode 100644 index 000000000..0e553ca21 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Updates/PackageType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Updates +{ + public enum PackageType + { + Pre, + Post + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 45eaa0e50..9a5824d81 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -558,6 +558,10 @@ {0be74eee-22cb-4dba-b896-793b9e1a3ac0} Tango.PPC.Common + + {208c8bd8-72c6-4e3c-acaa-351091a2acc7} + Tango.PPC.Shared + @@ -693,7 +697,7 @@ if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)" - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs index cee991507..3b344ce56 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs @@ -126,7 +126,11 @@ namespace Tango.Core.ExtensionMethods var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); - if (desProp != null && desProp.PropertyType == prop.PropertyType && desProp.SetMethod != null) + if (desProp != null && desProp.SetMethod != null && desProp.PropertyType.IsEnum && prop.PropertyType.IsEnum) + { + desProp.SetValue(destination, Enum.Parse(desProp.PropertyType, value.ToString())); + } + else if (desProp != null && desProp.PropertyType == prop.PropertyType && desProp.SetMethod != null) { desProp.SetValue(destination, value); } diff --git a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs index 0769b3576..0a7fe8ddc 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs @@ -415,6 +415,19 @@ namespace Tango.FileSystem UploadCommandInternal = new RelayCommand(() => { UploadCommand?.Execute(null); + },() => + { + if (CurrentItem == null) return false; + + if (CurrentItem is FolderItem) + { + if ((CurrentItem as FolderItem).IsRoot) + { + return false; + } + } + + return true; }); } diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs index 58df06fd8..f981ce8bb 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs @@ -427,7 +427,7 @@ namespace Tango.Integration.ExternalBridge { if (_requestHandlers.ContainsKey(genericType.Name)) { - var innerMessage = ProtoSerializer.DeserializeFromByteString(genericType, (message as GenericRequest).Data); //JsonConvert.DeserializeObject(json, _genericMessageSettings); + var innerMessage = GenericMessageSerializer.DeserializeFromByteString(genericType, (message as GenericRequest).Data); //JsonConvert.DeserializeObject(json, _genericMessageSettings); var handler = _requestHandlers[genericType.Name]; handler.Method.Invoke(handler.Handler, new object[] diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/GetMachineInformationRequest.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/GetMachineInformationRequest.cs deleted file mode 100644 index 38c06b024..000000000 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/GetMachineInformationRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Integration.ExternalBridge.Network.Information -{ - public class GetMachineInformationRequest - { - } -} diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/GetMachineInformationResponse.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/GetMachineInformationResponse.cs deleted file mode 100644 index 5ae1aa440..000000000 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/GetMachineInformationResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Integration.ExternalBridge.Network.Information -{ - public class GetMachineInformationResponse - { - public InformationPackage Package { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/InformationPackage.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/InformationPackage.cs deleted file mode 100644 index afa23492e..000000000 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Information/InformationPackage.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.SystemInfo; - -namespace Tango.Integration.ExternalBridge.Network.Information -{ - public class InformationPackage - { - public List System { get; set; } - - public InformationPackage() - { - System = new List(); - } - } -} diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/PerformancePackage.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/PerformancePackage.cs deleted file mode 100644 index 56921e0c5..000000000 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/PerformancePackage.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Integration.ExternalBridge.Network.Performance -{ - public class PerformancePackage - { - public int CPU { get; set; } - public int ApplicationCPU { get; set; } - - public int RAM { get; set; } - public int ApplicationRAM { get; set; } - public int MaxRAM { get; set; } - - public int Temperature { get; set; } - - public int AvailableDiskSpace { get; set; } - public int DiskCapacity { get; set; } - - public DateTime DateTime { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/StartPerformanceUpdatesRequest.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/StartPerformanceUpdatesRequest.cs deleted file mode 100644 index 2c036e937..000000000 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/StartPerformanceUpdatesRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Integration.ExternalBridge.Network.Performance -{ - public class StartPerformanceUpdatesRequest - { - } -} diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/StartPerformanceUpdatesResponse.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/StartPerformanceUpdatesResponse.cs deleted file mode 100644 index 8eb22bdef..000000000 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Network/Performance/StartPerformanceUpdatesResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Integration.ExternalBridge.Network.Performance -{ - public class StartPerformanceUpdatesResponse - { - public PerformancePackage Package { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 1356c115c..8ecbd3d09 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -106,12 +106,6 @@ - - - - - - @@ -221,7 +215,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.SharedUI/Helpers/DataGridHelper.cs b/Software/Visual_Studio/Tango.SharedUI/Helpers/DataGridHelper.cs new file mode 100644 index 000000000..80c847a45 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Helpers/DataGridHelper.cs @@ -0,0 +1,67 @@ +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.Input; + +namespace Tango.SharedUI.Helpers +{ + public static class DataGridHelper + { + #region DoubleClickCommand + + /// + /// Determines whether an element is DoubleClickCommand by the drag and drop service. + /// + public static readonly DependencyProperty DoubleClickCommandProperty = + DependencyProperty.RegisterAttached("DoubleClickCommand", + typeof(ICommand), typeof(DataGridHelper), + new FrameworkPropertyMetadata(null, DoubleClickCommandChanged)); + + /// + /// DoubleClickCommand changed. + /// + /// The d. + /// The instance containing the event data. + private static void DoubleClickCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs xx) + { + if (xx.NewValue != null) + { + var dataGrid = d as DataGrid; + + dataGrid.MouseDoubleClick += (x, e) => + { + if (dataGrid.SelectedItem != null && (e.OriginalSource as UIElement != null) && (e.OriginalSource as FrameworkElement).DataContext == dataGrid.SelectedItem) + { + (xx.NewValue as ICommand)?.Execute(dataGrid.SelectedItem); + } + }; + } + } + + /// + /// Sets the DoubleClickCommand attached property. + /// + /// The element. + /// if set to true [value]. + public static void SetDoubleClickCommand(DataGrid dataGrid, ICommand value) + { + dataGrid.SetValue(DoubleClickCommandProperty, value); + } + + /// + /// Gets the DoubleClickCommand attached property. + /// + /// The element. + /// + public static ICommand GetDoubleClickCommand(DataGrid dataGrid) + { + return (ICommand)dataGrid.GetValue(DoubleClickCommandProperty); + } + + #endregion + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 4764d0eac..000a4e5d7 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -156,6 +156,7 @@ + @@ -254,7 +255,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Transport/GenericMessageSerializer.cs b/Software/Visual_Studio/Tango.Transport/GenericMessageSerializer.cs new file mode 100644 index 000000000..aa3486dc3 --- /dev/null +++ b/Software/Visual_Studio/Tango.Transport/GenericMessageSerializer.cs @@ -0,0 +1,137 @@ +using Google.Protobuf; +using Newtonsoft.Json; +using ProtoBuf; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PMR; +using Tango.PMR.Common; +using Tango.PMR.Integration; + +namespace Tango.Transport +{ + public static class GenericMessageSerializer + { + public enum GenericMessageSerializerMode + { + Json, + Protobuf + } + + public static GenericMessageSerializerMode Mode { get; set; } + + static GenericMessageSerializer() + { + ProtoBuf.Meta.RuntimeTypeModel.Default.AutoAddMissingTypes = true; + ProtoBuf.Meta.RuntimeTypeModel.Default.AutoAddProtoContractTypesOnly = false; + ProtoBuf.Meta.RuntimeTypeModel.Default.InferTagFromNameDefault = true; + ProtoBuf.Meta.RuntimeTypeModel.Default.UseImplicitZeroDefaults = true; + } + + public static object Deserialize(Type type, byte[] array) + { + if (Mode == GenericMessageSerializerMode.Json) + { + return JsonConvert.DeserializeObject(Encoding.UTF8.GetString(array), type); + } + else + { + AutoProtobuf.Build(type); + + using (MemoryStream ms = new MemoryStream(array)) + { + return Serializer.Deserialize(type, ms); + } + } + } + + public static object DeserializeFromByteString(Type type, ByteString byteString) + { + if (Mode == GenericMessageSerializerMode.Json) + { + return JsonConvert.DeserializeObject(byteString.ToStringUtf8(), type); + } + else + { + AutoProtobuf.Build(type); + return Deserialize(type, byteString.ToByteArray()); + } + } + + //--------------------------------------------------------------------- + + public static byte[] Serialize(T message) + { + if (Mode == GenericMessageSerializerMode.Json) + { + return Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message)); + } + else + { + AutoProtobuf.Build(); + + using (MemoryStream ms = new MemoryStream()) + { + Serializer.Serialize(ms, message); + return ms.ToArray(); + } + } + } + + public static T Deserialize(byte[] array) + { + if (Mode == GenericMessageSerializerMode.Json) + { + return (T)Deserialize(typeof(T), array); + } + else + { + AutoProtobuf.Build(); + + using (MemoryStream ms = new MemoryStream(array)) + { + return Serializer.Deserialize(ms); + } + } + } + + public static ByteString SerializeToByteString(T message) + { + if (Mode == GenericMessageSerializerMode.Json) + { + return ByteString.CopyFromUtf8(JsonConvert.SerializeObject(message)); + } + else + { + AutoProtobuf.Build(); + + return ByteString.CopyFrom(Serialize(message)); + } + } + + public static T DeserializeFromByteString(ByteString byteString) + { + if (Mode == GenericMessageSerializerMode.Json) + { + return JsonConvert.DeserializeObject(byteString.ToStringUtf8()); + } + else + { + AutoProtobuf.Build(); + + return Deserialize(byteString.ToByteArray()); + } + } + + public static T ExtractGenericRequestFromContainer(MessageContainer container) where T : class + { + var message = MessageFactory.ExtractMessageFromContainer(container); + var genericType = Type.GetType((message as GenericRequest).Type); + var innerMessage = DeserializeFromByteString(genericType, (message as GenericRequest).Data); + return innerMessage as T; + } + } +} diff --git a/Software/Visual_Studio/Tango.Transport/ProtoSerializer.cs b/Software/Visual_Studio/Tango.Transport/ProtoSerializer.cs deleted file mode 100644 index c974f2712..000000000 --- a/Software/Visual_Studio/Tango.Transport/ProtoSerializer.cs +++ /dev/null @@ -1,87 +0,0 @@ -using Google.Protobuf; -using ProtoBuf; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PMR; -using Tango.PMR.Common; -using Tango.PMR.Integration; - -namespace Tango.Transport -{ - public static class ProtoSerializer - { - static ProtoSerializer() - { - ProtoBuf.Meta.RuntimeTypeModel.Default.AutoAddMissingTypes = true; - ProtoBuf.Meta.RuntimeTypeModel.Default.AutoAddProtoContractTypesOnly = false; - ProtoBuf.Meta.RuntimeTypeModel.Default.InferTagFromNameDefault = true; - ProtoBuf.Meta.RuntimeTypeModel.Default.UseImplicitZeroDefaults = true; - } - - public static object Deserialize(Type type, byte[] array) - { - AutoProtobuf.Build(type); - - using (MemoryStream ms = new MemoryStream(array)) - { - return Serializer.Deserialize(type, ms); - } - } - - public static object DeserializeFromByteString(Type type, ByteString byteString) - { - AutoProtobuf.Build(type); - - return Deserialize(type, byteString.ToByteArray()); - } - - //--------------------------------------------------------------------- - - public static byte[] Serialize(T message) - { - AutoProtobuf.Build(); - - using (MemoryStream ms = new MemoryStream()) - { - Serializer.Serialize(ms, message); - return ms.ToArray(); - } - } - - public static T Deserialize(byte[] array) - { - AutoProtobuf.Build(); - - using (MemoryStream ms = new MemoryStream(array)) - { - return Serializer.Deserialize(ms); - } - } - - public static ByteString SerializeToByteString(T message) - { - AutoProtobuf.Build(); - - return ByteString.CopyFrom(Serialize(message)); - } - - public static T DeserializeFromByteString(ByteString byteString) - { - AutoProtobuf.Build(); - - return Deserialize(byteString.ToByteArray()); - } - - public static T ExtractGenericRequestFromContainer(MessageContainer container) where T : class - { - var message = MessageFactory.ExtractMessageFromContainer(container); - var genericType = Type.GetType((message as GenericRequest).Type); - var innerMessage = ProtoSerializer.DeserializeFromByteString(genericType, (message as GenericRequest).Data); - return innerMessage as T; - } - } -} diff --git a/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj b/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj index 120584798..f83384097 100644 --- a/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj +++ b/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj @@ -125,7 +125,7 @@ - + @@ -186,7 +186,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index 5e076738c..0958e4d9f 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -334,7 +334,7 @@ namespace Tango.Transport if (handlers.Count > 0) { - var innerRequest = ProtoSerializer.DeserializeFromByteString(handlers[0].RequestType, genericRequest.Data); + var innerRequest = GenericMessageSerializer.DeserializeFromByteString(handlers[0].RequestType, genericRequest.Data); foreach (var handler in handlers) { @@ -930,10 +930,10 @@ namespace Tango.Transport { GenericRequest genericRequest = new GenericRequest(); genericRequest.Type = request.GetType().AssemblyQualifiedName; - genericRequest.Data = ProtoSerializer.SerializeToByteString(request); + genericRequest.Data = GenericMessageSerializer.SerializeToByteString(request); var response = await SendRequest(genericRequest, config); - var responseObject = ProtoSerializer.DeserializeFromByteString(response.Message.Data); + var responseObject = GenericMessageSerializer.DeserializeFromByteString(response.Message.Data); return responseObject; } @@ -949,7 +949,7 @@ namespace Tango.Transport { GenericResponse genericResponse = new GenericResponse(); - genericResponse.Data = ProtoSerializer.SerializeToByteString(response); + genericResponse.Data = GenericMessageSerializer.SerializeToByteString(response); await SendResponse(genericResponse, token, config); } @@ -966,7 +966,7 @@ namespace Tango.Transport GenericRequest genericRequest = new GenericRequest(); genericRequest.Type = request.GetType().AssemblyQualifiedName; - genericRequest.Data = ProtoSerializer.SerializeToByteString(request); + genericRequest.Data = GenericMessageSerializer.SerializeToByteString(request); Subject subject = new Subject(); @@ -975,7 +975,7 @@ namespace Tango.Transport try { - var responseObject = ProtoSerializer.DeserializeFromByteString(response.Message.Data); + var responseObject = GenericMessageSerializer.DeserializeFromByteString(response.Message.Data); subject.OnNext(responseObject); } catch (Exception ex) diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 6e79d8d13..96548aaac 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -369,6 +369,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.SystemInfo", "Tango.S EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FileSystem", "Tango.FileSystem\Tango.FileSystem.csproj", "{C6EBBBBE-2123-44DC-AEF7-A0D47D736AC0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.PPC.Shared", "PPC\Tango.PPC.Shared\Tango.PPC.Shared.csproj", "{208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -3422,6 +3424,26 @@ Global {C6EBBBBE-2123-44DC-AEF7-A0D47D736AC0}.Release|x64.Build.0 = Release|Any CPU {C6EBBBBE-2123-44DC-AEF7-A0D47D736AC0}.Release|x86.ActiveCfg = Release|Any CPU {C6EBBBBE-2123-44DC-AEF7-A0D47D736AC0}.Release|x86.Build.0 = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|ARM.ActiveCfg = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|ARM.Build.0 = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|ARM64.Build.0 = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|x64.ActiveCfg = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|x64.Build.0 = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|x86.ActiveCfg = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Debug|x86.Build.0 = Debug|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|Any CPU.Build.0 = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|ARM.ActiveCfg = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|ARM.Build.0 = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|ARM64.ActiveCfg = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|ARM64.Build.0 = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|x64.ActiveCfg = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|x64.Build.0 = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|x86.ActiveCfg = Release|Any CPU + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3544,14 +3566,15 @@ Global {834C81C3-09B5-45D7-BE12-E7D1E6655A7C} = {004337EB-0761-4D30-B9F5-AE6E1CFC6013} {866B916A-207C-43F0-B403-7C4A820C2E11} = {4EE6DBA1-71BC-49E2-8DC7-266487E61050} {A07E6CB4-0132-4EB1-9A38-C8C057884DC2} = {EC62BC9C-F2FE-4333-B7E4-110E38D43958} + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7} = {C81ED1A3-D18C-4D80-A8F5-061994A14A60} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} - BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear - BuildVersion_UpdateAssemblyVersion = True - BuildVersion_UpdateFileVersion = False - BuildVersion_StartDate = 2000/1/1 - BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs BuildVersion_UseGlobalSettings = False + BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs + BuildVersion_StartDate = 2000/1/1 + BuildVersion_UpdateFileVersion = False + BuildVersion_UpdateAssemblyVersion = True + BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear + SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} EndGlobalSection EndGlobal -- cgit v1.3.1