public ManagePluginSourceViewModel(IManagePluginSourceModel updateManager, Task <IRequestServiceNameViewModel> requestServiceNameViewModel, IEventAggregator aggregator, IAsyncWorker asyncWorker) : this(updateManager, aggregator, asyncWorker) { VerifyArgument.IsNotNull("requestServiceNameViewModel", requestServiceNameViewModel); _requestServiceNameViewModel = requestServiceNameViewModel; Item = ToModel(); }
public ManagePluginSourceViewModel(IManagePluginSourceModel updateManager, IEventAggregator aggregator, IPluginSource pluginSource, IAsyncWorker asyncWorker) : this(updateManager, aggregator, asyncWorker) { VerifyArgument.IsNotNull("pluginSource", pluginSource); asyncWorker.Start(() => updateManager.FetchSource(pluginSource.Id), source => { _pluginSource = source; _pluginSource.Path = pluginSource.Path; ToItem(); FromModel(_pluginSource); SetupHeaderTextFromExisting(); }); }
/// <exception cref="Exception">A delegate callback throws an exception.</exception> public ManagePluginSourceViewModel(IManagePluginSourceModel updateManager, IEventAggregator aggregator, IAsyncWorker asyncWorker) : base("PluginSource") { VerifyArgument.IsNotNull("asyncWorker", asyncWorker); VerifyArgument.IsNotNull("updateManager", updateManager); VerifyArgument.IsNotNull("aggregator", aggregator); _updateManager = updateManager; DllChooser = new DLLChooser(updateManager); HeaderText = Resources.Languages.Core.PluginSourceNewHeaderLabel; Header = Resources.Languages.Core.PluginSourceNewHeaderLabel; OkCommand = new DelegateCommand(o => Save(), o => CanSave()); FileSystemAssemblyName = string.Empty; ConfigFilePath = string.Empty; GACAssemblyName = string.Empty; ChooseFileSystemDLLCommand = new DelegateCommand(o => { var dll = DllChooser.GetFileSystemDLL(); if (dll != null) { FileSystemAssemblyName = dll.FullName; } }); ChooseGACDLLCommand = new DelegateCommand(o => { var dll = DllChooser.GetGacDLL(); if (dll != null) { GACAssemblyName = dll.FullName; } }); ChooseConfigFileCommand = new DelegateCommand(o => { var fileChooser = CustomContainer.GetInstancePerRequestType <IFileChooserView>(); fileChooser.ShowView(false); var vm = fileChooser.DataContext as FileChooser; if (vm != null && vm.Result == MessageBoxResult.OK) { var selectedFiles = vm.GetAttachments(); if (selectedFiles != null && selectedFiles.Count > 0) { ConfigFilePath = selectedFiles[0]; } } }); CancelCommand = new DelegateCommand(o => CloseAction.Invoke()); _warewolfserverName = updateManager.ServerName; }
public DLLChooser(IManagePluginSourceModel updateManager) { _updateManager = updateManager; SearchTerm = string.Empty; ClearSearchTextCommand = new DelegateCommand(o => SearchTerm = ""); CancelCommand = new DelegateCommand(o => { SelectedDll = null; SearchTerm = string.Empty; _view?.RequestClose(); }); SelectCommand = new DelegateCommand(o => _view?.RequestClose()); FilterTooltip = Resources.Languages.Tooltips.ManageEmailAttachmentFilterTooltip; FilesTooltip = Resources.Languages.Tooltips.ManageEmailAttachmentDriveNameTooltip; SelectTooltip = Resources.Languages.Tooltips.ManageEmailAttachmentAttachTooltip; }
public DllListingModel(IManagePluginSourceModel updateManager, IFileListing dllListing) { _updateManager = updateManager; if (dllListing != null) { Name = dllListing.Name; FullName = dllListing.FullName; if (dllListing.Children != null && dllListing.Children.Count > 0) { Children = new AsyncObservableCollection <IDllListingModel>( dllListing.Children.Select(input => new DllListingModel(_updateManager, input))); } IsDirectory = dllListing.IsDirectory; IsExpanderVisible = IsDirectory; IsVisible = true; _dllListing = dllListing; } _isCom = false; }