public CustomerDetailViewModel(ISecurityService securityService, IViewModelsFactory<IPhoneNumberDialogViewModel> phoneVmFactory, IViewModelsFactory<IEmailDialogViewModel> emailVmFactory, IViewModelsFactory<ICreateUserDialogViewModel> wizardUserVmFactory, IViewModelsFactory<IAddressDialogViewModel> addressVmFactory, ICustomerEntityFactory entityFactory,
			IAuthenticationContext authContext, CustomersDetailViewModel parentViewModel, Contact innerContact,
			ICustomerRepository customerRepository, IRepositoryFactory<ISecurityRepository> securityRepositoryFactory,
			IRepositoryFactory<ICountryRepository> countryRepositoryFactory, IRepositoryFactory<IOrderRepository> orderRepositoryFactory, ILoginViewModel loginViewModel)
		{
			_securityService = securityService;
			_loginViewModel = loginViewModel;
			_parentViewModel = parentViewModel;
			_authContext = authContext;
			_customerRepository = customerRepository;
			_orderRepositoryFactory = orderRepositoryFactory;
			_securityRepositoryFactory = securityRepositoryFactory;
			_countryRepositoryFactory = countryRepositoryFactory;
			_entityFactory = entityFactory;
			_addressVmFactory = addressVmFactory;
			_wizardUserVmFactory = wizardUserVmFactory;
			_emailVmFactory = emailVmFactory;
			_phoneVmFactory = phoneVmFactory;
			_fileDialogService = new FileDialogService();

			InnerItem = innerContact;

			InnerItem.PropertyChanged += _innerContact_PropertyChanged;

			CommandsInit();
			RequestInit();
			CollectionInit();

			HasCurrentContactLoginAndSuspendAccessCheck();
		}
        public FileController(CompositionContainer container, IMessageService messageService, IFileDialogService fileDialogService,
            IShellService shellService, FileService fileService)
        {
            this.container = container;
            this.messageService = messageService;
            this.fileDialogService = fileDialogService;
            this.shellService = shellService;
            this.fileService = fileService;
            this.documentTypes = new List<IDocumentType>();

            this.newDocumentCommand = new DelegateCommand(NewDocumentCommand, CanNewDocumentCommand);
            this.closeDocumentCommand = new DelegateCommand(CloseDocumentCommand, CanCloseDocumentCommand);
            this.saveDocumentCommand = new DelegateCommand(SaveDocumentCommand, CanSaveDocumentCommand);
            this.saveAllDocumentCommand = new DelegateCommand(SaveAllDocumentCommand, CanSaveAllDocumentCommand);
            this.newSolutionCommand = new DelegateCommand(NewSolutionCommand);
            this.openSolutionCommand = new DelegateCommand(OpenSolutionCommand);
            this.closeSolutionCommand = new DelegateCommand(CloseSolutionCommand, CanCloseSolutionCommand);
            this.showSolutionCommand = new DelegateCommand(ShowSolutionCommand, CanShowSolutionCommand);

            this.fileService.NewDocumentCommand = this.newDocumentCommand;
            this.fileService.CloseDocumentCommand = this.closeDocumentCommand;
            this.fileService.SaveDocumentCommand = this.saveDocumentCommand;
            this.fileService.SaveAllDocumentCommand = this.saveAllDocumentCommand;
            this.fileService.NewSolutionCommand = this.newSolutionCommand;
            this.fileService.OpenSolutionCommand = this.openSolutionCommand;
            this.fileService.CloseSolutionCommand = this.closeSolutionCommand;
            this.fileService.ShowSolutionCommand = this.showSolutionCommand;

            this.recentSolutionList = Settings.Default.RecentSolutionList;
            if (this.recentSolutionList == null) { this.recentSolutionList = new RecentFileList(); }
            this.fileService.RecentSolutionList = recentSolutionList;

            AddWeakEventListener(fileService, FileServicePropertyChanged);
        }
Example #3
0
        public FileController(IMessageService messageService, IFileDialogService fileDialogService, IShellService shellService,
            FileService fileService, ExportFactory<SaveChangesViewModel> saveChangesViewModelFactory)
        {
            this.messageService = messageService;
            this.fileDialogService = fileDialogService;
            this.shellService = shellService;
            this.fileService = fileService;
            this.saveChangesViewModelFactory = saveChangesViewModelFactory;
            this.documentTypes = new List<IDocumentType>();
            this.newCommand = new DelegateCommand(NewCommand);
            this.openCommand = new DelegateCommand(OpenCommand);
            this.closeCommand = new DelegateCommand(CloseCommand, CanCloseCommand);
            this.saveCommand = new DelegateCommand(SaveCommand, CanSaveCommand);
            this.saveAsCommand = new DelegateCommand(SaveAsCommand, CanSaveAsCommand);
            
            this.fileService.NewCommand = newCommand;
            this.fileService.OpenCommand = openCommand;
            this.fileService.CloseCommand = closeCommand;
            this.fileService.SaveCommand = saveCommand;
            this.fileService.SaveAsCommand = saveAsCommand;

            this.recentFileList = Settings.Default.RecentFileList ?? new RecentFileList();
            this.fileService.RecentFileList = recentFileList;

            PropertyChangedEventManager.AddHandler(fileService, FileServicePropertyChanged, "");
        }
 public ResourceEditorViewModel(IFileDialogService fileDialogService)
 {
     _fileDialogService = fileDialogService;
     EnuRows = new ObservableCollection<LocalizableStringVm>();
     RuRows = new ObservableCollection<LocalizableStringVm>();
     InitCommands();
 }
 public LevelEditorFileCommands(
     ICommandService commandService,
     IDocumentRegistry documentRegistry,
     IFileDialogService fileDialogService) : base(commandService,documentRegistry,fileDialogService)
 {
     RegisterCommands = (RegisterCommands & ~(CommandRegister.FileSaveAll | CommandRegister.FileClose));
 }
Example #6
0
        public Editor(
            ICommandService commandService,
            IControlHostService controlHostService,
            IDocumentService documentService,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService
            )
        {
            m_commandService = commandService;
            m_controlHostService = controlHostService;
            m_documentService = documentService;
            m_documentRegistry = documentRegistry;
            m_fileDialogService = fileDialogService;

            // create a document client for each file type
            m_txtDocumentClient = new DocumentClient(this, ".txt");
            m_csDocumentClient = new DocumentClient(this, ".cs");
            m_luaDocumentClient = new DocumentClient(this, ".lua");
            m_nutDocumentClient = new DocumentClient(this, ".nut");
            m_pyDocumentClient = new DocumentClient(this, ".py");
            m_xmlDocumentClient = new DocumentClient(this, ".xml");
            m_daeDocumentClient = new DocumentClient(this, ".dae");
            m_cgDocumentClient = new DocumentClient(this, ".cg");

        }
        public MainViewModel(IFileDialogService fileDialogService, IMessageBoxService messageBoxService, IDirtyService dirtyService, IViewService viewService, ILifetimeScope lifetimeScope)
        {
            if (fileDialogService == null) throw new ArgumentNullException(nameof(fileDialogService));
            if (messageBoxService == null) throw new ArgumentNullException(nameof(messageBoxService));
            if (dirtyService == null) throw new ArgumentNullException(nameof(dirtyService));
            if (viewService == null) throw new ArgumentNullException(nameof(viewService));
            if (lifetimeScope == null) throw new ArgumentNullException(nameof(lifetimeScope));
            

            _fileDialogService = fileDialogService;
            _messageBoxService = messageBoxService;
            _dirtyService = dirtyService;
            _viewService = viewService;
            _lifetimeScope = lifetimeScope;
            

            dirtyService.PropertyChanged += DirtyService_PropertyChanged;

            NewCommand = new RelayCommand(New);
            OpenCommand = new RelayCommand(Open);
            SaveCommand = new RelayCommand(() => Save(), CanSave);
            SaveAsComand = new RelayCommand(() => SaveAs());
            ExitCommand = new RelayCommand(Exit);
            AboutCommand = new RelayCommand(About);
        }
        public MainViewModel(IFileDialogService fileDialogService)
        {
            if (fileDialogService == null) throw new ArgumentNullException(nameof(fileDialogService));
            _fileDialogService = fileDialogService;

            OpenFileCommand = new SimpleRelayCommand(OpenFile);
            SaveFileCommand = new SimpleRelayCommand(SaveFile);
        }
        public MultiEnvironmentWorkflowsViewModel(IWorkflowManagerStorage workflowManagerStorage, ITFSConnectivity tfsConnectivity, ITFSBuild tfsBuild, ITFSLabEnvironment tfsLabEnvironment, ITFSTest tfsTest, IRegionManager regionManager, IFileDialogService fileDialogService, IEventAggregator eventAggregator)
        {
            this.workflowManagerStorage = workflowManagerStorage;
            this.tfsConnectivity = tfsConnectivity;
            this.tfsBuild = tfsBuild;
            this.tfsLabEnvironment = tfsLabEnvironment;
            this.tfsTest = tfsTest;
            this.regionManager = regionManager;
            this.fileDialogService = fileDialogService;
            this.eventAggregator = eventAggregator;

            this.tfsConnectivity.PropertyChanged += (source, args) => { if (args.PropertyName.Equals("IsConnected")) { this.RaisePropertyChanged(() => this.IsConnectedToTfs); this.RaisePropertyChanged(() => this.CanEditDefinitions); } };
            this.tfsConnectivity.PropertyChanged += (source, args) => { if (args.PropertyName.Equals("TfsUri")) { this.RaisePropertyChanged(() => this.TeamProjectCollectionUri); } };
            this.tfsConnectivity.PropertyChanged += (source, args) => { if (args.PropertyName.Equals("TeamProjectName")) { this.RaisePropertyChanged(() => this.TeamProjectName); } };

            this.workflowManagerStorage.PropertyChanged += (source, args) => { if (args.PropertyName.Equals("Definitions")) { this.RaisePropertyChanged(() => this.Definitions); this.RaisePropertyChanged(() => this.CanEditDefinitions); } };
            this.workflowManagerStorage.PropertyChanged += (source, args) => { if (args.PropertyName.Equals("CurrentDefinitionFile")) { this.RaisePropertyChanged(() => this.CurrentWorkflowDefinitionFile); } };

            if (!string.IsNullOrWhiteSpace(this.CurrentWorkflowDefinitionFile))
            {
                this.workflowManagerStorage.Load(this.CurrentWorkflowDefinitionFile);
                this.RaisePropertyChanged(() => this.CurrentWorkflowDefinitionFile);
            }

            this.ConnectToTfsCommand = new DelegateCommand(ConnectToTfs, () => !this.tfsConnectivity.IsConnecting);
            this.AddNewDefinitionCommand = new DelegateCommand(AddNewDefinition);
            this.EditDefinitionCommand = new DelegateCommand<MultiEnvironmentWorkflowDefinition>(EditDefinition);
            this.NewCommand = new DelegateCommand(() => { string filepath; if (this.fileDialogService.SaveFile(out filepath)) { this.workflowManagerStorage.New(filepath); this.RaisePropertyChanged(() => this.CurrentWorkflowDefinitionFile); } });
            this.LoadCommand = new DelegateCommand(() => { string filepath; if (this.fileDialogService.OpenFile(out filepath)) { this.workflowManagerStorage.Load(filepath); this.RaisePropertyChanged(() => this.CurrentWorkflowDefinitionFile); } });
            this.SaveCommand = new DelegateCommand(() => this.workflowManagerStorage.Save(this.CurrentWorkflowDefinitionFile), () => !string.IsNullOrWhiteSpace(this.CurrentWorkflowDefinitionFile));
            this.SaveAsCommand = new DelegateCommand(() => { string filepath; if (this.fileDialogService.SaveFile(out filepath)) { this.workflowManagerStorage.Save(filepath); this.RaisePropertyChanged(() => this.CurrentWorkflowDefinitionFile); } }, () => !string.IsNullOrWhiteSpace(this.CurrentWorkflowDefinitionFile));
            this.DeleteDefinitionCommand = new DelegateCommand<MultiEnvironmentWorkflowDefinition>(DeleteDefinition);

            CompositeApplicationCommands.SaveAllCommand.RegisterCommand(this.SaveCommand);

            this.tfsConnectivity.PropertyChanged += (source, args) =>
            {
                if (args.PropertyName.Equals("IsConnecting"))
                {
                    ((DelegateCommand)this.ConnectToTfsCommand).RaiseCanExecuteChanged();
                    this.RaisePropertyChanged(() => this.IsConnecting);
                }
                else if (args.PropertyName.Equals("IsConnected"))
                {
                    this.RaisePropertyChanged(() => this.IsConnectedToTfs);
                    this.RaisePropertyChanged(() => this.TeamProjectCollectionUri);
                    this.RaisePropertyChanged(() => this.TeamProjectName);
                }
            };

            if (this.workflowManagerStorage.LastTFSConnection != null)
            {
                this.tfsConnectivity.Connect(this.workflowManagerStorage.LastTFSConnection.Uri, this.workflowManagerStorage.LastTFSConnection.Project);
            }

            this.eventAggregator.GetEvent<ApplicationClosingInterceptorEvent>().Subscribe(this.HandleApplicationClosing);
        }
 public StandardFileCommands(
     ICommandService commandService,
     IDocumentRegistry documentRegistry,
     IFileDialogService fileDialogService)
 {
     CommandService = commandService;
     DocumentRegistry = documentRegistry;
     FileDialogService = fileDialogService;
 }
        public DocumentManager(IFileDialogService fileDialogService)
        {
            if (fileDialogService == null) { throw new ArgumentNullException("fileDialogService"); }

            this.fileDialogService = fileDialogService;
            this.documentTypes = new ObservableCollection<IDocumentType>();
            this.readOnlyDocumentTypes = new ReadOnlyObservableCollection<IDocumentType>(documentTypes);
            this.documents = new ObservableCollection<IDocument>();
            this.readOnlyDocuments = new ReadOnlyObservableCollection<IDocument>(documents);
        }
Example #12
0
        public LabelViewModel(Label item, ICustomerEntityFactory _customerEntityFactory, IFileDialogService fileDialogService)
        {
            _entityFactory = _customerEntityFactory;
            _innerItem = item.DeepClone(_entityFactory as IKnownSerializationTypes);
            _innerItem.PropertyChanged += _innerItem_PropertyChanged;

	        _fileDialogService = fileDialogService;

            CommandsInit();
        }
Example #13
0
 public MainViewModel(IFileDialogService fds, IHelixView3D hv)
 {
     Expansion = 1;
     FileDialogService = fds;
     HelixView = hv;
     FileOpenCommand = new DelegateCommand(FileOpen);
     FileExportCommand = new DelegateCommand(FileExport);
     FileExitCommand = new DelegateCommand(FileExit);
     ViewZoomToFitCommand = new DelegateCommand(ViewZoomToFit);
     EditCopyXamlCommand = new DelegateCommand(CopyXaml);
     ApplicationTitle = "3D Model viewer";
 }
Example #14
0
        public MainViewModel(IFileDialogService fileDialogService)
        {
            if (fileDialogService == null) throw new ArgumentNullException(nameof(fileDialogService));

            _fileDialogService = fileDialogService;

            OpenCommand = new RelayCommand(Open, CanOpen);
            SaveCommand = new RelayCommand(() => Save(), CanSave);
            SaveAsCommand = new RelayCommand(() => SaveAs(), CanSaveAs);
            AddFunctionCommand = new RelayCommand(AddFunction, CanAddFunction);
            DeleteCommand = new RelayCommand(Delete, CanDelete);
        }
Example #15
0
        public StandardFileCommands(
            ICommandService commandService,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService)
        {
            CommandService = commandService;
            
            DocumentRegistry = documentRegistry;
            documentRegistry.ActiveDocumentChanging += ActiveDocumentChanging;
            documentRegistry.ActiveDocumentChanged += ActiveDocumentChanged;

            FileDialogService = fileDialogService;
        }
Example #16
0
 public Editor(
     ICommandService commandService,
     IControlHostService controlHostService,
     IDocumentService documentService,
     IDocumentRegistry documentRegistry,
     IFileDialogService fileDialogService,
     IContextRegistry contextRegistry,
     SchemaLoader schemaLoader
     )
 {
     m_commandService = commandService;
     m_controlHostService = controlHostService;
     m_documentService = documentService;
     m_documentRegistry = documentRegistry;
     m_fileDialogService = fileDialogService;
     m_contextRegistry = contextRegistry;
     m_schemaLoader = schemaLoader;
 }
 public PlaylistController(IFileDialogService fileDialogService, IShellService shellService, IEnvironmentService environmentService, 
     IMusicFileContext musicFileContext, IPlayerService playerService, IMusicPropertiesService musicPropertiesService, Lazy<PlaylistViewModel> playlistViewModel)
 {
     this.fileDialogService = fileDialogService;
     this.playlistViewModel = playlistViewModel;
     this.shellService = shellService;
     this.environmentService = environmentService;
     this.musicFileContext = musicFileContext;
     this.playerService = playerService;
     this.musicPropertiesService = musicPropertiesService;
     this.playSelectedCommand = new DelegateCommand(PlaySelected, CanPlaySelected);
     this.removeSelectedCommand = new DelegateCommand(RemoveSelected, CanRemoveSelected);
     this.showMusicPropertiesCommand = new DelegateCommand(ShowMusicProperties);
     this.openListCommand = new DelegateCommand(OpenList);
     this.saveListCommand = new DelegateCommand(SaveList);
     this.clearListCommand = new DelegateCommand(ClearList);
     this.openPlaylistFileType = new FileType(Resources.Playlist, SupportedFileTypes.PlaylistFileExtensions);
     this.savePlaylistFileType = new FileType(Resources.Playlist, SupportedFileTypes.PlaylistFileExtensions.First());
 }
Example #18
0
        public MainViewModel(IFileDialogService fds, HelixViewport3D viewport)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }

            this.dispatcher             = Dispatcher.CurrentDispatcher;
            this.Expansion              = 1;
            this.fileDialogService      = fds;
            this.viewport               = viewport;
            this.FileOpenCommand        = new DelegateCommand(this.FileOpen);
            this.FileExportCommand      = new DelegateCommand(this.FileExport);
            this.FileExitCommand        = new DelegateCommand(FileExit);
            this.ViewZoomExtentsCommand = new DelegateCommand(this.ViewZoomExtents);
            this.EditCopyXamlCommand    = new DelegateCommand(this.CopyXaml);
            this.ApplicationTitle       = "3D Model viewer";
            this.Elements               = new List <VisualViewModel>();
            foreach (var c in viewport.Children)
            {
                this.Elements.Add(new VisualViewModel(c));
            }
        }
        public MainViewModel(IFileDialogService fds, HelixViewport3D viewport)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }

            this.dispatcher = Dispatcher.CurrentDispatcher;
            this.Expansion = 1;
            this.fileDialogService = fds;
            this.viewport = viewport;
            this.FileOpenCommand = new DelegateCommand(this.FileOpen);
            this.FileExportCommand = new DelegateCommand(this.FileExport);
            this.FileExitCommand = new DelegateCommand(FileExit);
            this.ViewZoomExtentsCommand = new DelegateCommand(this.ViewZoomExtents);
            this.EditCopyXamlCommand = new DelegateCommand(this.CopyXaml);
            this.ApplicationTitle = "3D Model viewer";
            this.Elements = new List<VisualViewModel>();
            foreach (var c in viewport.Children)
            {
                this.Elements.Add(new VisualViewModel(c));
            }
        }
        public SettingsViewModel(ISettingsView view, IShellService shellService, ICrawlerService crawlerService,
                                 IManagerService managerService, IFolderBrowserDialog folderBrowserDialog, IFileDialogService fileDialogService,
                                 ExportFactory <AuthenticateViewModel> authenticateViewModelFactory)
            : base(view)
        {
            this.folderBrowserDialog = folderBrowserDialog;
            this.fileDialogService   = fileDialogService;
            ShellService             = shellService;
            settings       = ShellService.Settings;
            CrawlerService = crawlerService;
            ManagerService = managerService;
            this.authenticateViewModelFactory = authenticateViewModelFactory;
            browseDownloadLocationCommand     = new DelegateCommand(BrowseDownloadLocation);
            browseExportLocationCommand       = new DelegateCommand(BrowseExportLocation);
            authenticateCommand       = new DelegateCommand(Authenticate);
            saveCommand               = new DelegateCommand(Save);
            enableAutoDownloadCommand = new DelegateCommand(EnableAutoDownload);
            exportCommand             = new DelegateCommand(ExportBlogs);
            bloglistExportFileType    = new FileType(Resources.Textfile, SupportedFileTypes.BloglistExportFileType);

            Load();
            view.Closed += ViewClosed;
        }
Example #21
0
        public CreateInnerComplaintViewModel(
            IEntityUoWBuilder uoWBuilder,
            IUnitOfWorkFactory unitOfWorkFactory,
            IEmployeeService employeeService,
            ISubdivisionRepository subdivisionRepository,
            ICommonServices commonServices,
            IEntityAutocompleteSelectorFactory employeeSelectorFactory,
            IFileDialogService fileDialogService,
            IUserRepository userRepository
            ) : base(uoWBuilder, unitOfWorkFactory, commonServices)
        {
            _fileDialogService       = fileDialogService ?? throw new ArgumentNullException(nameof(fileDialogService));
            _userRepository          = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
            _employeeSelectorFactory = employeeSelectorFactory ?? throw new ArgumentNullException(nameof(employeeSelectorFactory));
            _employeeService         = employeeService ?? throw new ArgumentNullException(nameof(employeeService));
            _subdivisionRepository   = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository));
            Entity.ComplaintType     = ComplaintType.Inner;
            Entity.SetStatus(ComplaintStatuses.Checking);

            _complaintKinds = complaintKindSource = UoW.GetAll <ComplaintKind>().Where(k => !k.IsArchive).ToList();

            TabName = "Новая внутреняя рекламация";
        }
Example #22
0
        public FileController(IMessageService messageService, IFileDialogService fileDialogService, IShellService shellService, IEnvironmentService environmentService, 
            IClipboardService clipboardService, FileService fileService, ExportFactory<SaveChangesViewModel> saveChangesViewModelFactory)
        {
            this.messageService = messageService;
            this.fileDialogService = fileDialogService;
            this.shellService = shellService;
            this.environmentService = environmentService;
            this.clipboardService = clipboardService;
            this.fileService = fileService;
            this.saveChangesViewModelFactory = saveChangesViewModelFactory;
            this.newCSharpCommand = new DelegateCommand(NewCSharpFile);
            this.newVisualBasicCommand = new DelegateCommand(NewVisualBasicFile);
            this.newCSharpFromClipboardCommand = new DelegateCommand(NewCSharpFromClipboard, CanNewFromClipboard);
            this.newVisualBasicFromClipboardCommand = new DelegateCommand(NewVisualBasicFromClipboard, CanNewFromClipboard);
            this.openCommand = new DelegateCommand(OpenFile);
            this.closeCommand = new DelegateCommand(CloseFile, CanCloseFile);
            this.closeAllCommand = new DelegateCommand(CloseAll, CanCloseAll);
            this.saveCommand = new DelegateCommand(SaveFile, CanSaveFile);
            this.saveAsCommand = new DelegateCommand(SaveAsFile, CanSaveAsFile);

            this.fileService.NewCSharpCommand = newCSharpCommand;
            this.fileService.NewVisualBasicCommand = newVisualBasicCommand;
            this.fileService.NewCSharpFromClipboardCommand = newCSharpFromClipboardCommand;
            this.fileService.NewVisualBasicFromClipboardCommand = newVisualBasicFromClipboardCommand;
            this.fileService.OpenCommand = openCommand;
            this.fileService.CloseCommand = closeCommand;
            this.fileService.CloseAllCommand = closeAllCommand;
            this.fileService.SaveCommand = saveCommand;
            this.fileService.SaveAsCommand = saveAsCommand;

            this.cSharpFileType = new FileType(Resources.CSharpFile, ".cs");
            this.visualBasicFileType = new FileType(Resources.VisualBasicFile, ".vb");
            this.allFilesType = new FileType(Resources.CodeFile, ".cs;*.vb");
            this.observedDocumentFiles = new List<DocumentFile>();
            PropertyChangedEventManager.AddHandler(fileService, FileServicePropertyChanged, "");
            shellService.Closing += ShellServiceClosing;
        }
Example #23
0
        public FileController(IMessageService messageService, IFileDialogService fileDialogService, IShellService shellService, IEnvironmentService environmentService,
                              IClipboardService clipboardService, FileService fileService, ExportFactory <SaveChangesViewModel> saveChangesViewModelFactory)
        {
            this.messageService                     = messageService;
            this.fileDialogService                  = fileDialogService;
            this.shellService                       = shellService;
            this.environmentService                 = environmentService;
            this.clipboardService                   = clipboardService;
            this.fileService                        = fileService;
            this.saveChangesViewModelFactory        = saveChangesViewModelFactory;
            this.newCSharpCommand                   = new DelegateCommand(NewCSharpFile);
            this.newVisualBasicCommand              = new DelegateCommand(NewVisualBasicFile);
            this.newCSharpFromClipboardCommand      = new DelegateCommand(NewCSharpFromClipboard, CanNewFromClipboard);
            this.newVisualBasicFromClipboardCommand = new DelegateCommand(NewVisualBasicFromClipboard, CanNewFromClipboard);
            this.openCommand                        = new DelegateCommand(OpenFile);
            this.closeCommand                       = new DelegateCommand(CloseFile, CanCloseFile);
            this.closeAllCommand                    = new DelegateCommand(CloseAll, CanCloseAll);
            this.saveCommand                        = new DelegateCommand(SaveFile, CanSaveFile);
            this.saveAsCommand                      = new DelegateCommand(SaveAsFile, CanSaveAsFile);

            this.fileService.NewCSharpCommand                   = newCSharpCommand;
            this.fileService.NewVisualBasicCommand              = newVisualBasicCommand;
            this.fileService.NewCSharpFromClipboardCommand      = newCSharpFromClipboardCommand;
            this.fileService.NewVisualBasicFromClipboardCommand = newVisualBasicFromClipboardCommand;
            this.fileService.OpenCommand     = openCommand;
            this.fileService.CloseCommand    = closeCommand;
            this.fileService.CloseAllCommand = closeAllCommand;
            this.fileService.SaveCommand     = saveCommand;
            this.fileService.SaveAsCommand   = saveAsCommand;

            this.cSharpFileType        = new FileType(Resources.CSharpFile, ".cs");
            this.visualBasicFileType   = new FileType(Resources.VisualBasicFile, ".vb");
            this.allFilesType          = new FileType(Resources.CodeFile, ".cs;*.vb");
            this.observedDocumentFiles = new List <DocumentFile>();
            PropertyChangedEventManager.AddHandler(fileService, FileServicePropertyChanged, "");
            shellService.Closing += ShellServiceClosing;
        }
Example #24
0
        public ProductViewModel(IRegionManager regionManager, IDialogWindowService dialogService, IFileIOService fileIOService, IFileDialogService fileDialog, IFileService fileService, IEventAggregator eventAggregator, IObjectUsageControlService <Product> usageControlService)
        {
            Title             = "Список товаров";
            ProductCollection = new ReadOnlyObservableCollection <Product>(_products);
            CanClose          = false;

            CurrentRegionManager = regionManager;
            _dialogService       = dialogService;
            _fileIOService       = fileIOService;
            _fileDialog          = fileDialog;
            _xmlService          = fileService;
            _eventAggregator     = eventAggregator;
            _usageControlService = usageControlService;

            SelectPreviousProductCommand = new DelegateCommand(SelectPreviousProductCommandExecute);
            SelectNextProductCommand     = new DelegateCommand(SelectNextProductCommandExecute);
            CreateProductCommand         = new DelegateCommand(CreateProductCommandExecute);
            EditProductCommand           = new DelegateCommand(EditProductCommandExecute, EditProductCommandCanExecute).ObservesProperty(() => SelectedProduct);
            RemoveProductCommand         = new DelegateCommand(RemoveProductCommandExecute, RemoveProductCommandCanExecute).ObservesProperty(() => SelectedProduct);
            ImportXmlCommand             = new DelegateCommand(ImportXmlCommandExecute);
            ExportXmlCommand             = new DelegateCommand(ExportXmlCommandExecute);

            _eventAggregator.GetEvent <CloseTabEvent>().Subscribe(OnCloseTab);
        }
Example #25
0
        /// <summary>Function to inject dependencies for the view model.</summary>
        /// <param name="injectionParameters">The parameters to inject.</param>
        /// <remarks>
        /// Applications should call this when setting up the view model for complex operations and/or dependency injection. The constructor should only be used for simple set up and initialization of objects.
        /// </remarks>
        protected override void OnInitialize(ImportPlugInSettingsParameters injectionParameters)
        {
            _messageDisplay  = injectionParameters.MessageDisplay ?? throw new ArgumentMissingException(nameof(injectionParameters.MessageDisplay), nameof(injectionParameters));
            _settings        = injectionParameters.Settings ?? throw new ArgumentMissingException(nameof(injectionParameters.Settings), nameof(injectionParameters));
            _plugInService   = injectionParameters.ContentPlugInService ?? throw new ArgumentMissingException(nameof(injectionParameters.ContentPlugInService), nameof(injectionParameters));
            _codecs          = injectionParameters.Codecs ?? throw new ArgumentMissingException(nameof(injectionParameters.Codecs), nameof(injectionParameters));
            _openCodecDialog = injectionParameters.OpenCodecDialog ?? throw new ArgumentMissingException(nameof(injectionParameters.OpenCodecDialog), nameof(injectionParameters));
            _busyService     = injectionParameters.BusyService ?? throw new ArgumentMissingException(nameof(injectionParameters.BusyService), nameof(injectionParameters));

            foreach (GorgonSpriteCodecPlugIn plugin in _codecs.CodecPlugIns)
            {
                foreach (GorgonSpriteCodecDescription desc in plugin.Codecs)
                {
                    IGorgonSpriteCodec codec = _codecs.Codecs.FirstOrDefault(item => string.Equals(item.GetType().FullName, desc.Name, StringComparison.OrdinalIgnoreCase));

                    if (codec == null)
                    {
                        continue;
                    }

                    CodecPlugInPaths.Add(new CodecSetting(codec.CodecDescription, plugin, desc));
                }
            }
        }
        public AddConnectionPresenter(IAddConnectionView view, IFileDialogService fileDialog)
            : base(view)
        {
            Logger.Current.Trace("Start AddConnectionPresenter");
            if (fileDialog == null)
            {
                throw new ArgumentNullException("fileDialog");
            }

            // PM 20160302 Added:
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }

            _fileDialog = fileDialog;

            view.Init(_postGis);

            view.TestConnection += TestConnection;

            view.ConnectionChanged += OnConnectionChanged;
            Logger.Current.Trace("End AddConnectionPresenter");
        }
        public MainWindowViewModel(
            IMessageBoxService messageBoxService,
            IFileDialogService fileDialogService,
            IVersionChecker versionChecker,
            IDialogProvider dialogProvider,
            IUrlHelper urlHelper)
        {
            _messageBoxService = messageBoxService;
            _fileDialogService = fileDialogService;
            _versionChecker    = versionChecker;
            _dialogProvider    = dialogProvider;
            _urlHelper         = urlHelper;

            DocumentList.CollectionChanged += OnTreeViewItemCollectionChanged;

#if DEBUG
            if (IsInDesignMode)
            {
                return;
            }
#endif
            _customUiSchemas = LoadXmlSchemas();
            XmlSamples       = LoadXmlSamples();
        }
Example #28
0
        public Editor(
            ICommandService commandService,
            IControlHostService controlHostService,
            IDocumentService documentService,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService
            )
        {
            m_commandService     = commandService;
            m_controlHostService = controlHostService;
            m_documentService    = documentService;
            m_documentRegistry   = documentRegistry;
            m_fileDialogService  = fileDialogService;

            // create a document client for each file type
            m_txtDocumentClient = new DocumentClient(this, ".txt");
            m_csDocumentClient  = new DocumentClient(this, ".cs");
            m_luaDocumentClient = new DocumentClient(this, ".lua");
            m_nutDocumentClient = new DocumentClient(this, ".nut");
            m_pyDocumentClient  = new DocumentClient(this, ".py");
            m_xmlDocumentClient = new DocumentClient(this, ".xml");
            m_daeDocumentClient = new DocumentClient(this, ".dae");
            m_cgDocumentClient  = new DocumentClient(this, ".cg");
        }
        public FastDeliveryAdditionalLoadingReportViewModel(IUnitOfWorkFactory unitOfWorkFactory, IInteractiveService interactiveService,
                                                            INavigationManager navigation, IFileDialogService fileDialogService)
            : base(unitOfWorkFactory, interactiveService, navigation)
        {
            _fileDialogService = fileDialogService ?? throw new ArgumentNullException(nameof(fileDialogService));
            Title = "Отчёт по дозагрузке МЛ";

            CreateDateFrom = DateTime.Now.Date;
            CreateDateTo   = DateTime.Now.Date.Add(new TimeSpan(0, 23, 59, 59));
        }
 public WordRuleCheckViewModelCommands(IFileDialogService fileDialogService, IRuleCheckingService ruleCheckingService, IInformationPublishingService informationPublishingService)
 {
     _fileDialogService            = fileDialogService;
     _ruleCheckingService          = ruleCheckingService;
     _informationPublishingService = informationPublishingService;
 }
        public SettingsViewModel(ISettingsView view, IShellService shellService, ICrawlerService crawlerService, IManagerService managerService, ILoginService loginService, IFolderBrowserDialog folderBrowserDialog, IFileDialogService fileDialogService, ExportFactory <AuthenticateViewModel> authenticateViewModelFactory)
            : base(view)
        {
            _folderBrowserDialog           = folderBrowserDialog;
            _fileDialogService             = fileDialogService;
            ShellService                   = shellService;
            _settings                      = ShellService.Settings;
            CrawlerService                 = crawlerService;
            ManagerService                 = managerService;
            LoginService                   = loginService;
            _authenticateViewModelFactory  = authenticateViewModelFactory;
            _browseDownloadLocationCommand = new DelegateCommand(BrowseDownloadLocation);
            _browseExportLocationCommand   = new DelegateCommand(BrowseExportLocation);
            _authenticateCommand           = new AsyncDelegateCommand(Authenticate);
            _tumblrLoginCommand            = new AsyncDelegateCommand(TumblrLogin);
            _tumblrLogoutCommand           = new AsyncDelegateCommand(TumblrLogout);
            _tumblrSubmitTfaCommand        = new AsyncDelegateCommand(TumblrSubmitTfa);
            _saveCommand                   = new AsyncDelegateCommand(Save);
            _enableAutoDownloadCommand     = new DelegateCommand(EnableAutoDownload);
            _exportCommand                 = new DelegateCommand(ExportBlogs);
            _bloglistExportFileType        = new FileType(Resources.Textfile, SupportedFileTypes.BloglistExportFileType);

            Task loadSettingsTask = Load();

            view.Closed += ViewClosed;
        }
Example #32
0
        public SettingDialogViewModel(ISettingDialogView view, IDataService dataservice, IFileDialogService fileDialogService)
            : base(view)
        {
            this.fileDialogService = fileDialogService;

            this.submitCommand = new DelegateCommand(() => Close(true), CanSubmitSetting);
            this.cancelCommand = new DelegateCommand(() => Close(false));

            this.browseSoundFile = new DelegateCommand(BrowseSoundFileCommand);

            this.branches         = dataservice.Branches;
            this.selectedBranch   = this.branches.FirstOrDefault();
            this.selectedBranches = new ObservableCollection <string>();

            this.addNewBranchCommand = new DelegateCommand(AddNewBranch);
            this.removeBranchCommand = new DelegateCommand(RemoveBranch, CanRemoveBranch);

            AddWeakEventListener(SelectedBranches, SelectedBranchesChanged);
        }
Example #33
0
 public WarehousesBalanceSummaryViewModel(
     IUnitOfWorkFactory unitOfWorkFactory, IInteractiveService interactiveService, INavigationManager navigation, IFileDialogService fileDialogService)
     : base(unitOfWorkFactory, interactiveService, navigation)
 {
     _fileDialogService = fileDialogService;
     TabName            = "Остатки по складам";
 }
 protected WorkspaceViewModel(IDataService dataService, IDialogService dialogService, IFileDialogService fileDialog)
 {
     _dataService   = dataService;
     _fileDialog    = fileDialog;
     _dialogService = dialogService;
 }
Example #35
0
 public FileController(IMessageService messageService, ISystemService systemService, IFileDialogService fileDialogService, ISettingsService settingsService, IShellService shellService, 
     FileService fileService, ExportFactory<SaveChangesViewModel> saveChangesViewModelFactory, IRichTextDocumentType richTextDocumentType, IXpsExportDocumentType xpsExportDocumentType)
 {
     this.messageService = messageService;
     this.systemService = systemService;
     this.fileDialogService = fileDialogService;
     this.shellService = shellService;
     this.fileService = fileService;
     this.saveChangesViewModelFactory = saveChangesViewModelFactory;
     documentTypes = new() { richTextDocumentType, xpsExportDocumentType };
     newCommand = new DelegateCommand(NewCommand);
     openCommand = new DelegateCommand(OpenCommand);
     closeCommand = new DelegateCommand(CloseCommand, CanCloseCommand);
     saveCommand = new DelegateCommand(SaveCommand, CanSaveCommand);
     saveAsCommand = new DelegateCommand(SaveAsCommand, CanSaveAsCommand);
     settings = settingsService.Get<AppSettings>();
     this.fileService.NewCommand = newCommand;
     this.fileService.OpenCommand = openCommand;
     this.fileService.CloseCommand = closeCommand;
     this.fileService.SaveCommand = saveCommand;
     this.fileService.SaveAsCommand = saveAsCommand;
     recentFileList = settings.RecentFileList ?? new RecentFileList();
     this.fileService.RecentFileList = recentFileList;
     fileService.PropertyChanged += FileServicePropertyChanged;
 }
 public NetworkTrainerVM()
 {
     _syncContext   = SynchronizationContext.Current;
     _dialogService = new DefaultFileDialogService();
 }
        public ServiceAccountingSettingsViewModel(AppSettings settings, IMainRegionService mainRegionService, IFileDialogService fileDialogService, IDialogService dialogService)
        {
            Settings = settings;
            this.fileDialogService = fileDialogService;
            MainRegionService      = mainRegionService;

            MainRegionService.Header = "Настройки учета услуг";

            SelectFileCommand = new DelegateCommandAsync(SelectFileExecute);
        }
Example #38
0
        /// <summary>
        /// Constructor
        /// </summary>
        public TopMenuVM(
            IAppSettings appSettings, IResetManager resetManager, ISaveLoadManager saveLoadManager,
            IUndoRedoManager undoRedoManager, IDialogService dialogService, IFileDialogService fileDialogService,
            IAutoTrackerDialogVM autoTrackerDialog, IColorSelectDialogVM colorSelectDialog,
            ISequenceBreakDialogVM sequenceBreakDialog, IAboutDialogVM aboutDialog,
            IErrorBoxDialogVM.Factory errorBoxFactory, IMessageBoxDialogVM.Factory messageBoxFactory)
        {
            _appSettings     = appSettings;
            _resetManager    = resetManager;
            _saveLoadManager = saveLoadManager;
            _undoRedoManager = undoRedoManager;

            _dialogService     = dialogService;
            _fileDialogService = fileDialogService;

            _autoTrackerDialog   = autoTrackerDialog;
            _colorSelectDialog   = colorSelectDialog;
            _sequenceBreakDialog = sequenceBreakDialog;
            _aboutDialog         = aboutDialog;

            _errorBoxFactory   = errorBoxFactory;
            _messageBoxFactory = messageBoxFactory;

            Open = ReactiveCommand.CreateFromTask(OpenImpl);
            Open.IsExecuting.ToProperty(this, x => x.IsOpening, out _isOpening);

            Save = ReactiveCommand.CreateFromTask(SaveImpl);
            Save.IsExecuting.ToProperty(this, x => x.IsSaving, out _isSaving);

            SaveAs = ReactiveCommand.CreateFromTask(SaveAsImpl);
            SaveAs.IsExecuting.ToProperty(this, x => x.IsSavingAs, out _isSavingAs);

            Reset = ReactiveCommand.CreateFromTask(ResetImpl);
            Reset.IsExecuting.ToProperty(this, x => x.IsResetting, out _isResetting);

            Close = ReactiveCommand.Create <Window>(CloseImpl);

            Undo = ReactiveCommand.CreateFromTask(UndoImpl, this.WhenAnyValue(x => x.CanUndo));
            Undo.IsExecuting.ToProperty(this, x => x.IsUndoing, out _isUndoing);

            Redo = ReactiveCommand.CreateFromTask(RedoImpl, this.WhenAnyValue(x => x.CanRedo));
            Redo.IsExecuting.ToProperty(this, x => x.IsRedoing, out _isRedoing);

            AutoTracker = ReactiveCommand.CreateFromTask(AutoTrackerImpl);
            AutoTracker.IsExecuting.ToProperty(
                this, x => x.IsOpeningAutoTracker, out _isOpeningAutoTracker);

            SequenceBreaks = ReactiveCommand.CreateFromTask(SequenceBreaksImpl);
            SequenceBreaks.IsExecuting.ToProperty(
                this, x => x.IsOpeningSequenceBreak, out _isOpeningSequenceBreak);

            ToggleDisplayAllLocations       = ReactiveCommand.Create(ToggleDisplayAllLocationsImpl);
            ToggleShowItemCountsOnMap       = ReactiveCommand.Create(ToggleShowItemCountsOnMapImpl);
            ToggleDisplayMapsCompasses      = ReactiveCommand.Create(ToggleDisplayMapsCompassesImpl);
            ToggleAlwaysDisplayDungeonItems = ReactiveCommand.Create(ToggleAlwaysDisplayDungeonItemsImpl);

            ColorSelect = ReactiveCommand.CreateFromTask(ColorSelectImpl);
            ColorSelect.IsExecuting.ToProperty(
                this, x => x.IsOpeningColorSelect, out _isOpeningColorSelect);

            ChangeLayoutOrientation          = ReactiveCommand.Create <string>(ChangeLayoutOrientationImpl);
            ChangeMapOrientation             = ReactiveCommand.Create <string>(ChangeMapOrientationImpl);
            ChangeHorizontalUIPanelPlacement = ReactiveCommand.Create <string>(ChangeHorizontalUIPanelPlacementImpl);
            ChangeVerticalUIPanelPlacement   = ReactiveCommand.Create <string>(ChangeVerticalUIPanelPlacementImpl);
            ChangeHorizontalItemsPlacement   = ReactiveCommand.Create <string>(ChangeHorizontalItemsPlacementImpl);
            ChangeVerticalItemsPlacement     = ReactiveCommand.Create <string>(ChangeVerticalItemsPlacementImpl);
            ChangeUIScale = ReactiveCommand.Create <string>(ChangeUIScaleImpl);

            About = ReactiveCommand.CreateFromTask(AboutImpl);
            About.IsExecuting.ToProperty(
                this, x => x.IsOpeningAbout, out _isOpeningAbout);

            _undoRedoManager.PropertyChanged     += OnUndoRedoManagerChanged;
            _appSettings.Tracker.PropertyChanged += OnTrackerSettingsChanged;
            _appSettings.Layout.PropertyChanged  += OnLayoutChanged;
        }
 public MainWindowMatchingViewModel(IDialogService dialogService, IFileDialogService fileDialog, Matches matches = null)
     : base(dialogService, fileDialog, matches)
 {
     Initialize();
 }
 public MainWindowMatchingViewModel(IDialogService dialogService, IFileDialogService fileDialog)
     : base(dialogService, fileDialog)
 {
     Initialize();
 }
Example #41
0
        private void RaiseUploadRequest()
        {
            if (ParentItem.Parent == null)
            {
                CommonNotifyRequest.Raise(new Notification
                {
                    Content = "Can not upload files to the root. Please select a folder first.".Localize(),
                    Title   = "Error".Localize(null, LocalizationScope.DefaultCategory)
                });
                return;
            }

            IEnumerable <FileType> fileTypes = new[] {
                new FileType("all files".Localize(), ".*"),
                new FileType("jpg image".Localize(), ".jpg"),
                new FileType("bmp image".Localize(), ".bmp"),
                new FileType("png image".Localize(), ".png"),
                new FileType("Report".Localize(), ".rld"),
                new FileType("Report".Localize(), ".rldc")
            };

            if (fileDialogService == null)
            {
                fileDialogService = new System.Waf.VirtoCommerce.ManagementClient.Services.FileDialogService();
            }

            var result = fileDialogService.ShowOpenFileDialog(this, fileTypes);

            if (result.IsValid)
            {
                var delimiter = !string.IsNullOrEmpty(ParentItem.InnerItemID) && !ParentItem.InnerItemID.EndsWith(NamePathDelimiter) ? NamePathDelimiter : string.Empty;
                // construct new FolderItemId
                var fileInfo = new FileInfo(result.FileName);
                var fileName = string.Format("{0}{1}{2}", ParentItem.InnerItemID, delimiter, fileInfo.Name);

                var canUpload  = true;
                var fileExists = SelectedFolderItems.OfType <IFileSearchViewModel>().Any(x => x.InnerItem.FolderItemId.EndsWith(NamePathDelimiter + fileInfo.Name, StringComparison.OrdinalIgnoreCase));
                if (fileExists)
                {
                    CommonConfirmRequest.Raise(new ConditionalConfirmation
                    {
                        Title   = "Upload file".Localize(),
                        Content = string.Format("There is already a file with the same name in this location.\nDo you want to overwrite and replace the existing file '{0}'?".Localize(), fileInfo.Name)
                    }, (x) =>
                    {
                        canUpload = x.Confirmed;
                    });
                }

                if (canUpload)
                {
                    ShowLoadingAnimation = true;

                    var worker = new BackgroundWorker();
                    worker.DoWork += (o, ea) =>
                    {
                        var id   = o.GetHashCode().ToString();
                        var item = new StatusMessage {
                            ShortText = "File upload in progress".Localize(), StatusMessageId = id
                        };
                        EventSystem.Publish(item);

                        using (var info = new UploadStreamInfo())
                            using (var fileStream = new FileStream(result.FileName, FileMode.Open, FileAccess.Read))
                            {
                                info.FileName       = fileName;
                                info.FileByteStream = fileStream;
                                info.Length         = fileStream.Length;
                                _assetRepository.Upload(info);
                            }
                    };

                    worker.RunWorkerCompleted += (o, ea) =>
                    {
                        ShowLoadingAnimation = false;

                        var item = new StatusMessage
                        {
                            StatusMessageId = o.GetHashCode().ToString()
                        };

                        if (ea.Cancelled)
                        {
                            item.ShortText = "File upload was canceled!".Localize();
                            item.State     = StatusMessageState.Warning;
                        }
                        else if (ea.Error != null)
                        {
                            item.ShortText = string.Format("Failed to upload file: {0}".Localize(), ea.Error.Message);
                            item.Details   = ea.Error.ToString();
                            item.State     = StatusMessageState.Error;
                        }
                        else
                        {
                            item.ShortText = "File uploaded".Localize();
                            item.State     = StatusMessageState.Success;

                            RefreshCommand.Execute();
                        }

                        EventSystem.Publish(item);
                    };

                    worker.RunWorkerAsync();
                }
            }
        }
Example #42
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StudentsViewModel"/> class.
 /// </summary>
 public StudentsViewModel()
 {
     this.fileDialogService = new FileDialogService();
     this.students          = new ObservableCollection <StudentDTO>();
     this.selectedStudent   = new StudentDTO();
 }
Example #43
0
        public ComplaintsJournalViewModel(
            IUnitOfWorkFactory unitOfWorkFactory,
            ICommonServices commonServices,
            IUndeliveredOrdersJournalOpener undeliveredOrdersJournalOpener,
            IEmployeeService employeeService,
            ICounterpartyJournalFactory counterpartySelectorFactory,
            IRouteListItemRepository routeListItemRepository,
            ISubdivisionParametersProvider subdivisionParametersProvider,
            ComplaintFilterViewModel filterViewModel,
            IFileDialogService fileDialogService,
            ISubdivisionRepository subdivisionRepository,
            IReportViewOpener reportViewOpener,
            IGtkTabsOpener gtkDialogsOpener,
            INomenclatureRepository nomenclatureRepository,
            IUserRepository userRepository,
            IOrderSelectorFactory orderSelectorFactory,
            IEmployeeJournalFactory employeeJournalFactory,
            ICounterpartyJournalFactory counterpartyJournalFactory,
            IDeliveryPointJournalFactory deliveryPointJournalFactory,
            ISubdivisionJournalFactory subdivisionJournalFactory,
            ISalesPlanJournalFactory salesPlanJournalFactory,
            INomenclatureJournalFactory nomenclatureSelector,
            IEmployeeSettings employeeSettings,
            IUndeliveredOrdersRepository undeliveredOrdersRepository) : base(filterViewModel, unitOfWorkFactory, commonServices)
        {
            this._unitOfWorkFactory         = unitOfWorkFactory ?? throw new ArgumentNullException(nameof(unitOfWorkFactory));
            this._commonServices            = commonServices ?? throw new ArgumentNullException(nameof(commonServices));
            _undeliveredOrdersJournalOpener = undeliveredOrdersJournalOpener ?? throw new ArgumentNullException(nameof(undeliveredOrdersJournalOpener));
            _employeeService               = employeeService ?? throw new ArgumentNullException(nameof(employeeService));
            _counterpartySelectorFactory   = counterpartySelectorFactory ?? throw new ArgumentNullException(nameof(counterpartySelectorFactory));
            _fileDialogService             = fileDialogService ?? throw new ArgumentNullException(nameof(fileDialogService));
            _subdivisionRepository         = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository));
            _routeListItemRepository       = routeListItemRepository ?? throw new ArgumentNullException(nameof(routeListItemRepository));
            _subdivisionParametersProvider = subdivisionParametersProvider ?? throw new ArgumentNullException(nameof(subdivisionParametersProvider));
            _reportViewOpener              = reportViewOpener ?? throw new ArgumentNullException(nameof(reportViewOpener));
            _gtkDlgOpener                = gtkDialogsOpener ?? throw new ArgumentNullException(nameof(gtkDialogsOpener));
            _nomenclatureRepository      = nomenclatureRepository ?? throw new ArgumentNullException(nameof(nomenclatureRepository));
            _userRepository              = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
            _orderSelectorFactory        = orderSelectorFactory ?? throw new ArgumentNullException(nameof(orderSelectorFactory));
            _employeeJournalFactory      = employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory));
            _counterpartyJournalFactory  = counterpartyJournalFactory ?? throw new ArgumentNullException(nameof(counterpartyJournalFactory));
            _deliveryPointJournalFactory = deliveryPointJournalFactory ?? throw new ArgumentNullException(nameof(deliveryPointJournalFactory));
            _subdivisionJournalFactory   = subdivisionJournalFactory ?? throw new ArgumentNullException(nameof(subdivisionJournalFactory));
            _salesPlanJournalFactory     = salesPlanJournalFactory ?? throw new ArgumentNullException(nameof(salesPlanJournalFactory));
            _nomenclatureSelector        = nomenclatureSelector ?? throw new ArgumentNullException(nameof(nomenclatureSelector));
            _employeeSettings            = employeeSettings ?? throw new ArgumentNullException(nameof(employeeSettings));
            _undeliveredOrdersRepository =
                undeliveredOrdersRepository ?? throw new ArgumentNullException(nameof(undeliveredOrdersRepository));

            TabName = "Журнал рекламаций";

            RegisterComplaints();

            var threadLoader = DataLoader as ThreadDataLoader <ComplaintJournalNode>;

            threadLoader.MergeInOrderBy(x => x.Id, true);

            FinishJournalConfiguration();

            FilterViewModel.SubdivisionParametersProvider = subdivisionParametersProvider;
            FilterViewModel.EmployeeService = employeeService;

            var currentUserSettings        = userRepository.GetUserSettings(UoW, commonServices.UserService.CurrentUserId);
            var defaultSubdivision         = currentUserSettings.DefaultSubdivision;
            var currentEmployeeSubdivision = employeeService.GetEmployeeForUser(UoW, commonServices.UserService.CurrentUserId).Subdivision;

            FilterViewModel.CurrentUserSubdivision = currentEmployeeSubdivision;

            if (FilterViewModel.SubdivisionParametersProvider.GetOkkId() == currentEmployeeSubdivision.Id)
            {
                FilterViewModel.ComplaintStatus = ComplaintStatuses.Checking;
            }
            else
            {
                if (currentUserSettings.UseEmployeeSubdivision)
                {
                    FilterViewModel.Subdivision = currentEmployeeSubdivision;
                }
                else
                {
                    FilterViewModel.Subdivision = defaultSubdivision;
                }

                FilterViewModel.ComplaintStatus = currentUserSettings.DefaultComplaintStatus;
            }

            UpdateOnChanges(
                typeof(Complaint),
                typeof(ComplaintGuiltyItem),
                typeof(ComplaintResultOfCounterparty),
                typeof(ComplaintResultOfEmployees),
                typeof(Subdivision),
                typeof(ComplaintDiscussion),
                typeof(DeliveryPoint),
                typeof(Fine),
                typeof(Order),
                typeof(RouteList),
                typeof(RouteListItem),
                typeof(ComplaintObject)
                );
            this.DataLoader.ItemsListUpdated += (sender, e) => CurrentObjectChanged?.Invoke(this, new CurrentObjectChangedArgs(null));

            DataLoader.PostLoadProcessingFunc = BeforeItemsUpdated;
        }
Example #44
0
        public SledDocumentService(
            MainForm mainForm,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService,
            IControlHostService controlHostService)
            : base(commandService, documentRegistry, fileDialogService)
        {
            m_mainForm = mainForm;
            m_commandService = commandService;
            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;
            m_fileDialogService = fileDialogService;
            m_controlHostService = controlHostService;

            m_mainForm.Shown += MainFormShown;
            m_mainForm.DragOver += MainFormDragOver;
            m_mainForm.DragDrop += MainFormDragDrop;

            // Relay this event
            m_documentRegistry.ActiveDocumentChanged += DocumentRegistryActiveDocumentChanged;

            // Everything but the copious new & open
            RegisterCommands =
                CommandRegister.FileClose |
                CommandRegister.FileSave |
                CommandRegister.FileSaveAll |
                CommandRegister.FileSaveAs;

            //
            // Register default document types
            //

            m_txtDocumentClient =
                new SledDocumentClient(
                    "Text",
                    ".txt",
                    Atf.Resources.DocumentImage,
                    true,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Text));

            m_xmlDocumentClient =
                new SledDocumentClient(
                    "Xml",
                    ".xml",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Xml));

            m_csDocumentClient =
                new SledDocumentClient(
                    "C#",
                    ".cs",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Csharp));

            m_pyDocumentClient =
                new SledDocumentClient(
                    "Python",
                    ".py",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Python));

            // One time setup
            SledDocument.ControlHostClient = this;

            // Do not use the system clipboard until further 
            // safety measures can be added. Ron Little, 5/26/2011
            StandardEditCommands.UseSystemClipboard = false;

            // Check if any command line args
            var bFirst = true;
            foreach (var arg in Environment.GetCommandLineArgs())
            {
                // First one is application .exe
                if (bFirst)
                {
                    bFirst = false;
                    continue;
                }

                // Skip non-files
                if (!File.Exists(arg))
                    continue;

                // Skip project files
                if (SledUtil.FileEndsWithExtension(arg, SledProjectService.ProjectExtensions))
                    continue;

                m_lstStartupFiles.Add(arg);
            }
        }
        //INTEGRATION
        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, Treatment treatment, SmileFile file, bool duplicate, MainWindow window)
        {
            Expansion = 1;
            FileDialogService = fds;
            HelixView = hv;
            FileOpenCommand = new DelegateCommand(FileOpen);
            FileOpenRawCommand = new DelegateCommand(FileOpenRaw);
            //FileExportCommand = new DelegateCommand(FileExport);
            FileExportCommand = new DelegateCommand(ConfirmDirectFileExport);            
            FileExportRawCommand = new DelegateCommand(FileExportRaw);
            FileExitCommand = new DelegateCommand(FileExit);
            ViewZoomExtentsCommand = new DelegateCommand(ViewZoomExtents);
            EditCopyXamlCommand = new DelegateCommand(CopyXaml);
            EditClearAreaCommand = new DelegateCommand(ClearArea);
            FileExportStlCommand = new DelegateCommand(StlFileExport);            

            
            ApplicationTitle = "Dental Smile - 3D Viewer";

            ModelToBaseMarker = new Dictionary<Model3D, BaseMarker>();
            OriginalMaterial = new Dictionary<Model3D, Material>();

            //Elements = new List<VisualElement>();
            //foreach (var c in hv.Children) Elements.Add(new VisualElement(c));

            this.window = window;
            RootVisual = window.vmodel;
            
            handleManipulationData(treatment, file, duplicate);
            
            //JawVisual = new JawVisual3D(Patient);
            //RootVisual.Children.Add(JawVisual);
        }
Example #46
0
 public MainViewModel(IFileDialogService fileDialogService, HelixViewport3D viewport)
 {
     this.fileDialogService = fileDialogService;
     this.viewport = viewport;
     modelImporter = new ModelImporter();
 }
Example #47
0
        public BierenViewModel(IDataService dataService, IDialogService dialogService, IFileDialogService fileDialogService, IMapper mapper) : base(dataService, dialogService, fileDialogService)
        {
            base.DisplayName = "Bieren";
            _mapper          = mapper;
            //_fileDialog = fileDialogService;
            //_dialogService = dialogService;
            //_dataService = dataService;
            //Bieren = new ObservableCollection<Bier>(ObjectConverter.BO_BierenToBieren(dataService.GeefAlleBieren()));
            Bieren = new ObservableCollection <Bier>(_mapper.Map <List <Bier> >(dataService.GeefAlleBieren()));
            //BierSoorten = new ObservableCollection<BierSoort>(ObjectConverter.BO_BierSoortenToBierSoorten(dataService.GeefAlleBierSoorten()));
            BierSoorten = new ObservableCollection <BierSoort>(_mapper.Map <List <BierSoort> >(dataService.GeefAlleBierSoorten()));
            if (Brouwers == null)
            {
                //Brouwers = new ObservableCollection<Brouwer>(ObjectConverter.BO_BrouwersToBrouwers(dataService.GeefAlleBrouwers()));
                Brouwers = new ObservableCollection <Brouwer>(_mapper.Map <List <Brouwer> >(dataService.GeefAlleBrouwers()));
            }
            if (Bieren != null && Bieren.Count > 0)
            {
                SelectedBier = Bieren[0];
            }
            if (SelectedBier != null)
            {
                SelectedBierSoort = BierSoorten.Where(s => s.SoortNr == SelectedBier.BierSoort.SoortNr).SingleOrDefault();
                SelectedBrouwer   = Brouwers.Where(b => b.BrouwerNr == SelectedBier.Brouwer.BrouwerNr).SingleOrDefault();
            }
            AddBierCommand    = new RelayCommand(VoegBierToe);
            UpdateBierCommand = new RelayCommand(WijzigBierGegevens);
            DeleteBierCommand = new RelayCommand(VerwijderBier);
            //BrowseImageCommand = new RelayCommand(BrowseImage);
            OpenInputDialogCommand = new RelayCommand(OpenInputDialogBierSoort);

            //CollectionView bierenView = (CollectionView)CollectionViewSource.GetDefaultView(Bieren);
            //bierenView.Filter = BierenFilter;
        }
		private void RaiseUploadRequest()
		{
			if (ParentItem.Parent == null)
			{
				CommonNotifyRequest.Raise(new Notification
				{
					Content = "Can not upload files to the root. Please select a folder first.".Localize(),
					Title = "Error".Localize(null, LocalizationScope.DefaultCategory)
				});
				return;
			}

			IEnumerable<FileType> fileTypes = new[] {
                new FileType("all files".Localize(), ".*"),
                new FileType("jpg image".Localize(), ".jpg"),
                new FileType("bmp image".Localize(), ".bmp"),
                new FileType("png image".Localize(), ".png"),
                new FileType("Report".Localize(), ".rld"),
                new FileType("Report".Localize(), ".rldc") 
            };

			if (fileDialogService == null)
				fileDialogService = new System.Waf.VirtoCommerce.ManagementClient.Services.FileDialogService();

			var result = fileDialogService.ShowOpenFileDialog(this, fileTypes);
			if (result.IsValid)
			{
				var delimiter = !string.IsNullOrEmpty(ParentItem.InnerItemID) && !ParentItem.InnerItemID.EndsWith(NamePathDelimiter) ? NamePathDelimiter : string.Empty;
				// construct new FolderItemId
				var fileInfo = new FileInfo(result.FileName);
				var fileName = string.Format("{0}{1}{2}", ParentItem.InnerItemID, delimiter, fileInfo.Name);

				var canUpload = true;
				var fileExists = SelectedFolderItems.OfType<IFileSearchViewModel>().Any(x => x.InnerItem.FolderItemId.EndsWith(NamePathDelimiter + fileInfo.Name, StringComparison.OrdinalIgnoreCase));
				if (fileExists)
				{
					CommonConfirmRequest.Raise(new ConditionalConfirmation
					{
						Title = "Upload file".Localize(),
						Content = string.Format("There is already a file with the same name in this location.\nDo you want to overwrite and replace the existing file '{0}'?".Localize(), fileInfo.Name)
					}, (x) =>
					{
						canUpload = x.Confirmed;
					});
				}

				if (canUpload)
				{
					ShowLoadingAnimation = true;

					var worker = new BackgroundWorker();
					worker.DoWork += (o, ea) =>
					{
						var id = o.GetHashCode().ToString();
						var item = new StatusMessage { ShortText = "File upload in progress".Localize(), StatusMessageId = id };
						EventSystem.Publish(item);

						using (var info = new UploadStreamInfo())
						using (var fileStream = new FileStream(result.FileName, FileMode.Open, FileAccess.Read))
						{
							info.FileName = fileName;
							info.FileByteStream = fileStream;
							info.Length = fileStream.Length;
							_assetRepository.Upload(info);
						}
					};

					worker.RunWorkerCompleted += (o, ea) =>
					{
						ShowLoadingAnimation = false;

						var item = new StatusMessage
						{
							StatusMessageId = o.GetHashCode().ToString()
						};

						if (ea.Cancelled)
						{
							item.ShortText = "File upload was canceled!".Localize();
							item.State = StatusMessageState.Warning;
						}
						else if (ea.Error != null)
						{
							item.ShortText = string.Format("Failed to upload file: {0}".Localize(), ea.Error.Message);
							item.Details = ea.Error.ToString();
							item.State = StatusMessageState.Error;
						}
						else
						{
							item.ShortText = "File uploaded".Localize();
							item.State = StatusMessageState.Success;

							RefreshCommand.Execute();
						}

						EventSystem.Publish(item);
					};

					worker.RunWorkerAsync();
				}
			}
		}
Example #49
0
        //private DateTime _vanMarktDatum;
        //private DateTime _totMarktDatum;
        public BrouwersViewModel(IDataService dataService, IDialogService dialogService, IFileDialogService fileDialogService, IMapper mapper) : base(dataService, dialogService, fileDialogService)
        {
            _mapper          = mapper;
            base.DisplayName = "Brouwers";
            //_dialogService = dialogService;
            //_dataService = dataService;
            Brouwers                 = new ObservableCollection <Brouwer>(_mapper.Map <List <Brouwer> >(_dataService.GeefAlleBrouwers()));
            BierSoorten              = new ObservableCollection <BierSoort>(ObjectConverter.BO_BierSoortenToBierSoorten(_dataService.GeefAlleBierSoorten()));
            AddBrouwerCommand        = new RelayCommand(VoegBrouwerToe);
            UpdateBrouwerCommand     = new RelayCommand(WijzigBrouwerGegevens);
            DeleteBrouwerCommand     = new RelayCommand(VerwijderBrouwer);
            ShowWebSiteDialogCommand = new RelayCommand(ShowWebSiteDialog);
            // FilterOpMarktDatumCommand = new RelayCommand(FilterBierenOpMarktDatum);

            OphalenBierenVoorBrouwers();

            //if (SelectedBrouwer != null)
            //{
            //    VanMarktDatum = SelectedBrouwer.Bieren.Min(b => b.MarktDatum);
            //    TotMarktDatum = SelectedBrouwer.Bieren.Max(b => b.MarktDatum);
            //}
        }
		public CommunicationItemViewModel()
		{
			Created = DateTime.UtcNow;
			//LastModified = Created;
			ItemCommands = new List<CommunicationItemComands>();
			Attachments = new ObservableCollection<CommunicationAttachment>();
			Attachments.CollectionChanged += (o, e) => ModifiedParentViewModel();
			fileDialogService = new System.Waf.VirtoCommerce.ManagementClient.Services.FileDialogService();

			InitCommands();
		}
//        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, ModelVisual3D rootModel)
        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, MainWindow window)
        {
            Expansion = 1;
            FileDialogService = fds;
            HelixView = hv;
            FileOpenCommand = new DelegateCommand(FileOpen);
            FileOpenRawCommand = new DelegateCommand(FileOpenRaw);
            FileExportCommand = new DelegateCommand(FileExport);
            FileExportRawCommand = new DelegateCommand(FileExportRaw);
            FileExitCommand = new DelegateCommand(FileExit);
            ViewZoomExtentsCommand = new DelegateCommand(ViewZoomExtents);
            EditCopyXamlCommand = new DelegateCommand(CopyXaml);
            EditClearAreaCommand = new DelegateCommand(ClearArea);
            FileExportStlCommand = new DelegateCommand(StlFileExport);            


            ApplicationTitle = "Dental.Smile - 3D Viewer";

            ModelToBaseMarker = new Dictionary<Model3D, BaseMarker>();
            OriginalMaterial = new Dictionary<Model3D, Material>();

            //Elements = new List<VisualElement>();
            //foreach (var c in hv.Children) Elements.Add(new VisualElement(c));

            DB = DentalSmileDBFactory.GetInstance();
            Treatment = new Treatment();
            SmileFile = new SmileFile();
            Patient = new Patient();
            JawVisual = new JawVisual3D(Patient);
            RootVisual = window.vmodel;
            app = Application.Current as App;

            RootVisual.Children.Add(JawVisual);
            this.window = window;

        }
Example #52
0
 public FirstDetailsViewModel(IFileDialogService fileDialogService)
 {
     OpenFileDialogCommand = new SimpleRelayCommand(() => ExecuteOpenFileDialog(fileDialogService));
 }
Example #53
0
 private static void ExecuteOpenFileDialog(IFileDialogService fileDialogService)
 {
     fileDialogService.ShowOpenFileDialog(new OpenFileDialogOptions());
 }
 public NonBlockDialogServiceWrapper(
     IFileDialogService service,
     IStaTaskService staService) : base(service, staService)
 {
 }
Example #55
0
 public CreateWalletViewModel(
     IFileDialogService fileDialogService)
 {
     this.fileDialogService = fileDialogService;
 }