Пример #1
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="codeCheckerService">Сервис проверки кода.</param>
        /// <param name="viewService">Сервис представлений.</param>
        public PanelContainerViewModel(ICodeCheckerService codeCheckerService, IViewService viewService)
        {
            this.viewService         = viewService;
            this.openCommandHandlers = new OpenCommandHandlers(viewService);
            this.OpenPackageCommand  = new RelayCommand(this.openCommandHandlers.OpenPackage);
            this.OpenDatabaseCommand = new RelayCommand(this.openCommandHandlers.OpenDatabase);
            this.OpenFolderCommand   = new RelayCommand(this.openCommandHandlers.OpenFolder);

            this.Panels = new ObservableCollection <IPanel>();
            this.Panels.CollectionChanged += this.PanelsCollectionChangedHandler;
            this.PanelsView = CollectionViewSource.GetDefaultView(this.Panels);

            this.AnchorablePanels = new ObservableCollection <IPanel>();
            this.AnchorablePanels.CollectionChanged += this.PanelsCollectionChangedHandler;
            this.AnchorablePanelsView = CollectionViewSource.GetDefaultView(this.AnchorablePanels);

            // TODO: Панельки должны добавляться в лист.
            this.StandardToolbar = new StandardToolbarViewModel(codeCheckerService, viewService);

            this.ExitCommand = new RelayCommand(Exit);
            this.ShowSourceExplorerCommand = new RelayCommand(ShowSourceExplorer);
            this.ShowReportViewerCommand   = new RelayCommand(ShowReportViewer);
            this.ShowStartPageCommand      = new RelayCommand(ShowStartPage);
            this.ShowAboutCommand          = new RelayCommand(this.ShowAbout);
        }
Пример #2
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="codeCheckerService">Сервис проверки кода.</param>
 /// <param name="viewService">Сервис представлений.</param>
 public StandardToolbarViewModel(ICodeCheckerService codeCheckerService, IViewService viewService)
 {
     this.codeCheckerService  = codeCheckerService;
     this.openCommandHandlers = new OpenCommandHandlers(viewService);
     this.CheckCommand        = new RelayCommand(this.Check, CanCheck);
     this.CheckAllCommand     = new RelayCommand(this.CheckAll, CanCheckAll);
     this.OpenPackageCommand  = new RelayCommand(this.openCommandHandlers.OpenPackage);
     this.OpenDatabaseCommand = new RelayCommand(this.openCommandHandlers.OpenDatabase);
     this.OpenFolderCommand   = new RelayCommand(this.openCommandHandlers.OpenFolder);
 }
Пример #3
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="codeCheckerService">Сервис проверки кода.</param>
        /// <param name="viewService">Сервис представлений.</param>
        public SourceExplorerViewModel(ICodeCheckerService codeCheckerService, IViewService viewService) : base(viewService)
        {
            this.codeCheckerService = codeCheckerService;

            this.TitleLocalizationKey = PanelTitle;
            this.CanClose             = false;

            this.ComponentTypesView = CollectionViewSource.GetDefaultView(this.componentTypes);

            this.FiltrateComponentsCommand = new RelayCommand(this.FiltrateComponents);
            this.OpenDocumentCommand       = new RelayCommand <IDocument>(this.OpenDocument, CanOpenDocument);
            this.CheckAllCommand           = new RelayCommand(this.CheckAll, this.CanCheckAll);
            this.CheckDocumentsCommand     = new RelayCommand <TreeNode>(this.CheckDocuments, CanCheckDocuments);
        }