public DefaultModuleDirectorySupervisor(IDirectoryController directories, ILogger logger, IModuleLoader moduleLoader)
 {
     this.directories = directories;
     this.logger = logger;
     this.filesToLoad = new ModuleFileLoadQueue(directories);
     this.loadTimer = new ModuleFileLoadTimer(filesToLoad,moduleLoader);
 }
Esempio n. 2
0
 private void DirectoryButtons_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _viewModel = (IDirectoryController)DataContext;
     _viewModel.EnhancedPropertyChanged      += _viewModel_EnhancedPropertyChanged;
     _viewModel.ClosePopupRequested          += _viewModel_ClosePopupRequested;
     _viewModel.FocusAddressTextBoxRequested += _viewModel_FocusAddressTextBoxRequested;
     _viewModel.HideAddressTextBoxRequested  += _viewModel_HideAddressTextBoxRequested;
     _viewModel.NavigationComplete           += delegate { HideDirectoryTextBox(navigate: false); };
 }
 public ItemizeAllProductFilesDirectoriesAsyncDelegate(
     IGetDirectoryDelegate productFilesDirectoryDelegate,
     IDirectoryController directoryController,
     IStatusController statusController)
 {
     this.productFilesDirectoryDelegate = productFilesDirectoryDelegate;
     this.directoryController           = directoryController;
     this.statusController = statusController;
 }
Esempio n. 4
0
 public RecycleDelegate(
     IGetDirectoryDelegate getDirectoryDelegate,
     IFileController fileController,
     IDirectoryController directoryController)
 {
     this.getDirectoryDelegate = getDirectoryDelegate;
     this.fileController       = fileController;
     this.directoryController  = directoryController;
 }
Esempio n. 5
0
 private void DirectoryButtons_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _viewModel = (IDirectoryController)DataContext;
     _viewModel.EnhancedPropertyChanged += _viewModel_EnhancedPropertyChanged;
     _viewModel.ClosePopupRequested += _viewModel_ClosePopupRequested;
     _viewModel.FocusAddressTextBoxRequested += _viewModel_FocusAddressTextBoxRequested;
     _viewModel.HideAddressTextBoxRequested += _viewModel_HideAddressTextBoxRequested;
     _viewModel.NavigationComplete += delegate { HideDirectoryTextBox(navigate: false); };
 }
Esempio n. 6
0
 public Module(ILoggerContainer primaryLoggerContainer,
     IDirectoryController directories,
     IAppDomainFactory appDomainFactory,
     ModuleProxyTypeDictionary proxyTypes)
 {
     this.proxyTypes = proxyTypes;
     this.appDomainFactory = appDomainFactory;
     this.primaryLoggerContainer = primaryLoggerContainer;
     this.directories = directories;
 }
Esempio n. 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FileExplorer"/> class.
        /// </summary>
        public FileExplorer()
        {
            InitializeComponent();

            _directoryController = IoC.Resolve<IDirectoryController>();
            DataContext = _directoryController;

            PreviewMouseDown += FileExplorer_PreviewMouseDown;

            _directoryController.EnhancedPropertyChanged += _directoryController_EnhancedPropertyChanged;
            //DirectoryComboBox.IsTextSearchEnabled = false;
        }
Esempio n. 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FileExplorer"/> class.
        /// </summary>
        public FileExplorer()
        {
            InitializeComponent();

            _directoryController = IoC.Resolve <IDirectoryController>();
            DataContext          = _directoryController;

            PreviewMouseDown += FileExplorer_PreviewMouseDown;

            _directoryController.EnhancedPropertyChanged += _directoryController_EnhancedPropertyChanged;
            //DirectoryComboBox.IsTextSearchEnabled = false;
        }
Esempio n. 9
0
 public ItemizeAllUpdatedProductFilesAsyncDelegate(
     IIndexController <long> updatedDataController,
     IDataController <GameDetails> gameDetailsDataController,
     IItemizeAsyncDelegate <GameDetails, string> itemizeGameDetailsDirectoriesAsyncDelegate,
     IDirectoryController directoryController,
     IStatusController statusController)
 {
     this.updatedDataController     = updatedDataController;
     this.gameDetailsDataController = gameDetailsDataController;
     this.itemizeGameDetailsDirectoriesAsyncDelegate = itemizeGameDetailsDirectoriesAsyncDelegate;
     this.directoryController = directoryController;
     this.statusController    = statusController;
 }
Esempio n. 10
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            //KeyBindingHelper.SetKeyBindings(this, tagView.TagToolbar.wrenchMenu.Items);
            KeyBindingHelper.SetKeyBindings(this, tagView.MainMenu.Menu.Items);

            InputBindings.Add(new KeyBinding(_viewModel.DirectoryViewModel.GoBackCommand, Key.Left, ModifierKeys.Alt));
            InputBindings.Add(new KeyBinding(_viewModel.DirectoryViewModel.GoForwardCommand, Key.Right, ModifierKeys.Alt));
            InputBindings.Add(new KeyBinding(_viewModel.DirectoryViewModel.GoUpCommand, Key.Up, ModifierKeys.Alt));
            InputBindings.Add(new KeyBinding(_viewModel.DirectoryViewModel.SelectAllCommand, Key.A, ModifierKeys.Control));
            InputBindings.Add(new KeyBinding(new DelegateCommand(_viewModel.DirectoryViewModel.FocusAddressTextBox), Key.D, ModifierKeys.Alt));

            MainWindowSettings settings;

            if (SettingsFile.TryLoad("mainWindow.json", out settings))
            {
                try
                {
                    // Splitter/InitialDirectory settings
                    tagView.FileExplorer.GridSplitterPosition = new GridLength(settings.GridSplitterPosition);

                    IDirectoryController directoryController = tagView.FileExplorer.DirectoryController; // TODO: Need a better way to get this.
                    directoryController.InitialDirectory = settings.Directory;

                    // Column settings
                    var columns = tagView.FileExplorer.GetFileViewColumns();

                    foreach (var column in columns)
                    {
                        string name = column.GetValue(DataGridUtil.NameProperty).ToString();
                        foreach (var kvp in settings.ColumnSettings)
                        {
                            if (kvp.Key == name)
                            {
                                double width  = kvp.Value.Width;
                                bool   isStar = kvp.Value.IsStar;

                                column.Width        = new DataGridLength(width, isStar ? DataGridLengthUnitType.Star : DataGridLengthUnitType.Pixel);
                                column.DisplayIndex = kvp.Value.DisplayIndex;
                            }
                        }
                    }
                }
                catch
                {
                    // TODO: Log error?
                }
            }
        }
        /// <summary>
        /// Converts source values to a value for the binding target. The data binding engine calls this method when it propagates the values from source bindings to the binding target.
        /// </summary>
        /// <param name="values">The array of values that the source bindings in the <see cref="T:System.Windows.Data.MultiBinding"/> produces. The value <see cref="F:System.Windows.DependencyProperty.UnsetValue"/> indicates that the source binding has no value to provide for conversion.</param>
        /// <param name="targetType">The type of the binding target property.</param>
        /// <param name="parameter">The converter parameter to use.</param>
        /// <param name="culture">The culture to use in the converter.</param>
        /// <returns>
        /// A converted value.If the method returns null, the valid null value is used.A return value of <see cref="T:System.Windows.DependencyProperty"/>.<see cref="F:System.Windows.DependencyProperty.UnsetValue"/> indicates that the converter did not produce a value, and that the binding will use the <see cref="P:System.Windows.Data.BindingBase.FallbackValue"/> if it is available, or else will use the default value.A return value of <see cref="T:System.Windows.Data.Binding"/>.<see cref="F:System.Windows.Data.Binding.DoNothing"/> indicates that the binding does not transfer the value or use the <see cref="P:System.Windows.Data.BindingBase.FallbackValue"/> or the default value.
        /// </returns>
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            ObservableCollection <MenuItem> menuItems = new ObservableCollection <MenuItem>();

            if (values.Length != 2)
            {
                return(menuItems);
            }

            _directoryController = (IDirectoryController)values[0];
            if (_directoryController == null)
            {
                return(menuItems);
            }

            var dirs = _directoryController.SubDirectories;

            if (dirs == null || dirs.Count == 0)
            {
                return(menuItems);
            }

            foreach (var item in dirs)
            {
                TextBlock header = new TextBlock
                {
                    Text = item,
                };

                Image icon = new Image();
                icon.Source = IconHelper.GetImageSource(item);

                MenuItem subDirMenuItem = new MenuItem {
                    Header = header, Tag = item
                };
                subDirMenuItem.Icon            = icon;
                subDirMenuItem.PreviewKeyDown += KeyEventHandler;
                subDirMenuItem.Click          += subDirMenuItem_Click;

                menuItems.Add(subDirMenuItem);
            }

            return(menuItems);
        }
Esempio n. 12
0
 public CleanupActivity(
     Entity context,
     IItemizeAllAsyncDelegate <string> itemizeAllExpectedItemsAsyncDelegate,
     IItemizeAllAsyncDelegate <string> itemizeAllActualItemsAsyncDelegate,
     IItemizeDelegate <string, string> itemizeDetailsDelegate,
     IFormatDelegate <string, string> formatSupplementaryItemDelegate,
     IRecycleDelegate recycleDelegate,
     IDirectoryController directoryController,
     IStatusController statusController) :
     base(statusController)
 {
     this.context = context;
     this.itemizeAllExpectedItemsAsyncDelegate = itemizeAllExpectedItemsAsyncDelegate;
     this.itemizeAllActualItemsAsyncDelegate   = itemizeAllActualItemsAsyncDelegate;
     this.itemizeDetailsDelegate          = itemizeDetailsDelegate;
     this.formatSupplementaryItemDelegate = formatSupplementaryItemDelegate;
     this.recycleDelegate     = recycleDelegate;
     this.directoryController = directoryController;
 }
Esempio n. 13
0
        /// <summary>
        /// Converts source values to a value for the binding target. The data binding engine calls this method when it propagates the values from source bindings to the binding target.
        /// </summary>
        /// <param name="values">The array of values that the source bindings in the <see cref="T:System.Windows.Data.MultiBinding"/> produces. The value <see cref="F:System.Windows.DependencyProperty.UnsetValue"/> indicates that the source binding has no value to provide for conversion.</param>
        /// <param name="targetType">The type of the binding target property.</param>
        /// <param name="parameter">The converter parameter to use.</param>
        /// <param name="culture">The culture to use in the converter.</param>
        /// <returns>
        /// A converted value.If the method returns null, the valid null value is used.A return value of <see cref="T:System.Windows.DependencyProperty"/>.<see cref="F:System.Windows.DependencyProperty.UnsetValue"/> indicates that the converter did not produce a value, and that the binding will use the <see cref="P:System.Windows.Data.BindingBase.FallbackValue"/> if it is available, or else will use the default value.A return value of <see cref="T:System.Windows.Data.Binding"/>.<see cref="F:System.Windows.Data.Binding.DoNothing"/> indicates that the binding does not transfer the value or use the <see cref="P:System.Windows.Data.BindingBase.FallbackValue"/> or the default value.
        /// </returns>
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values.Length != 2)
            {
                return(null);
            }

            IDirectoryController directoryController = (IDirectoryController)values[0];
            var history = directoryController.History;

            ObservableCollection <MenuItem> menuItems = new ObservableCollection <MenuItem>();

            foreach (var item in history)
            {
                bool   isDrive   = (item.FileView.FullName.Length <= 3);
                string dir       = item.FileView.FullName;
                bool   isCurrent = item.IsCurrent;

                TextBlock header = new TextBlock
                {
                    Text       = isDrive ? DriveTypeHelper.GetDescription(new DriveInfo(dir)) : Path.GetFileName(dir),
                    FontWeight = isCurrent ? FontWeights.Bold : FontWeights.Normal,
                };
                MenuItem subDirMenuItem = new MenuItem {
                    Header = header, Icon = new Image {
                        Source = new FileView(dir).ImageSource
                    }
                };
                int historyOffset = item.HistoryOffset;
                subDirMenuItem.Click += delegate { directoryController.Navigate(historyOffset); };

                menuItems.Add(subDirMenuItem);
            }

            return(menuItems);
        }
        /// <summary>
        /// Converts source values to a value for the binding target. The data binding engine calls this method when it propagates the values from source bindings to the binding target.
        /// </summary>
        /// <param name="values">The array of values that the source bindings in the <see cref="T:System.Windows.Data.MultiBinding"/> produces. The value <see cref="F:System.Windows.DependencyProperty.UnsetValue"/> indicates that the source binding has no value to provide for conversion.</param>
        /// <param name="targetType">The type of the binding target property.</param>
        /// <param name="parameter">The converter parameter to use.</param>
        /// <param name="culture">The culture to use in the converter.</param>
        /// <returns>
        /// A converted value.If the method returns null, the valid null value is used.A return value of <see cref="T:System.Windows.DependencyProperty"/>.<see cref="F:System.Windows.DependencyProperty.UnsetValue"/> indicates that the converter did not produce a value, and that the binding will use the <see cref="P:System.Windows.Data.BindingBase.FallbackValue"/> if it is available, or else will use the default value.A return value of <see cref="T:System.Windows.Data.Binding"/>.<see cref="F:System.Windows.Data.Binding.DoNothing"/> indicates that the binding does not transfer the value or use the <see cref="P:System.Windows.Data.BindingBase.FallbackValue"/> or the default value.
        /// </returns>
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            ObservableCollection<MenuItem> menuItems = new ObservableCollection<MenuItem>();

            if (values.Length != 2)
                return menuItems;

            _directoryController = (IDirectoryController)values[0];
            if (_directoryController == null)
                return menuItems;

            var dirs = _directoryController.SubDirectories;

            if (dirs == null || dirs.Count == 0)
                return menuItems;

            foreach (var item in dirs)
            {
                TextBlock header = new TextBlock
                {
                    Text = item,
                };

                Image icon = new Image();
                icon.Source = IconHelper.GetImageSource(item);

                MenuItem subDirMenuItem = new MenuItem { Header = header, Tag = item };
                subDirMenuItem.Icon = icon;
                subDirMenuItem.PreviewKeyDown += KeyEventHandler;
                subDirMenuItem.Click += subDirMenuItem_Click;

                menuItems.Add(subDirMenuItem);
            }

            return menuItems;
        }
Esempio n. 15
0
 private void FileList_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _directoryController = (IDirectoryController)DataContext;
     fileView.MouseDoubleClick += fileView_MouseDoubleClick;
 }
Esempio n. 16
0
 private void FolderTreeView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _viewModel = (IDirectoryController)DataContext;
     _viewModel.EnhancedPropertyChanged += _viewModel_EnhancedPropertyChanged;
 }
Esempio n. 17
0
 public ItemizeDirectoryFilesDelegate(
     IDirectoryController directoryController)
 {
     this.directoryController = directoryController;
 }
 public DefaultAppDomainFactory(IDirectoryController directories)
 {
     this.directories = directories;
 }
 public ReloadCommandOnModuleList(IDirectoryController directories, ModuleList moduleList, IModuleLoader moduleLoader)
 {
     this.directories = directories;
     this.moduleList = moduleList;
     this.moduleLoader = moduleLoader;
 }
Esempio n. 20
0
 private void FolderTreeView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _viewModel = (IDirectoryController)DataContext;
     _viewModel.EnhancedPropertyChanged += _viewModel_EnhancedPropertyChanged;
 }
Esempio n. 21
0
 private void FileList_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _directoryController       = (IDirectoryController)DataContext;
     fileView.MouseDoubleClick += fileView_MouseDoubleClick;
 }
 public AssemblyResolver(ILogger logger, IDirectoryController directories)
 {
     this.directories = directories;
     this.logger = logger;
     this.defaultEventResolver = new ResolveEventHandler(DefaultAssemblyResolver);
 }