public RootLevelDocumentCache(IDocumentManager documentManager)
        {
            DocumentManager = documentManager;
            DocumentManager.DocumentAdded += OnObservedDocumentAdded;

            Initialize();
        }
Exemplo n.º 2
0
        public BackgroundParsingTask(IDocumentParserFactory parserFactory, IDocumentManager documentManager)
        {
            ParserFactory = parserFactory;
            ShutdownToken = SassyStudioPackage.Instance.ShutdownToken;

            documentManager.DocumentAdded += OnDocumentAdded;
        }
Exemplo n.º 3
0
        public Shell(IRegionManager regionManager, IServiceLocator serviceLocator, IEventAggregator aggregator, IDocumentManager documentManager, ShellViewModel viewModel)
        {
            System.Windows.Application.Current.Dispatcher.UnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(Dispatcher_UnhandledException);

            _viewModel = viewModel;
            _aggregator = aggregator;
            _documentManager = documentManager;
            _regionManager = regionManager;
            _serviceLocator = serviceLocator;
            InitializeComponent();
            if (Properties.Settings.Default.WindowState == "Maximized")
            {
                WindowState = System.Windows.WindowState.Maximized;
            }
            else
            {
                WindowState = System.Windows.WindowState.Normal;
                if (Properties.Settings.Default.WindowWidth > 600 && Properties.Settings.Default.WindowHeight > 400)
                {
                    Width = Properties.Settings.Default.WindowWidth;
                    Height = Properties.Settings.Default.WindowHeight;
                }
                Top = Properties.Settings.Default.WindowTop;
                Left = Properties.Settings.Default.WindowLeft;
            }

            _aggregator.GetEvent<ProjectOpeningEvent>().Subscribe(OnOpening);
        }
 // ------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------
 public GetController()
 {
     this._entityManager = new DocumentEntityManager();
     this._documentManager = new DocumentManager()
     {
         EntityManager = this._entityManager
     };
 }
        protected DocumentController(IDocumentManager documentManager)
        {
            if (documentManager == null) { throw new ArgumentNullException("documentManager"); }

            this.documentManager = documentManager;
            AddWeakEventListener(documentManager, DocumentManagerPropertyChanged);
            AddWeakEventListener(documentManager.Documents, DocumentsCollectionChanged);
        }
 public RichTextDocumentController(CompositionContainer container, IDocumentManager documentManager, MainViewModel mainViewModel)
     : base(documentManager)
 {
     this.container = container;
     this.documentManager = documentManager;
     this.mainViewModel = mainViewModel;
     this.richTextViewModels = new Dictionary<RichTextDocument, RichTextViewModel>();
     this.mainViewModel.PropertyChanged += MainViewModelPropertyChanged;
 }
Exemplo n.º 7
0
        public SassEditorManager(IDocumentManager documentManager, IIntellisenseManager intellisenseManager, IForegroundParsingTask parsingTask, IBackgroundParsingTask backgroundParsingTask)
        {
            DocumentManager = documentManager;
            IntellisenseManager = intellisenseManager;
            ParsingTask = parsingTask;

            // start background monitoring
            backgroundParsingTask.Start();
        }
 //------------------------------------------------------------------------------------------
 //------------------------------------------------------------------------------------------
 public LoadController()
 {
     /*initializam entity manager-ul*/
     this._entityManager = new DocumentEntityManager();
     /*TODO initializam document manager*/
     this._documentManager = new DocumentManager() {
         EntityManager = this._entityManager
     };
 }
Exemplo n.º 9
0
        public ValidationModule(IRegionManager regionManager, IDocumentManager documentManager, IEventAggregator eventAggregator, LabelAmountAlgorithm labelAmountAlgorithm)
        {
            _regionManager = regionManager;
            _eventAggregator = eventAggregator;
            this.documentManager = documentManager;
            this.labelAmountAlgorithm = labelAmountAlgorithm;

            _eventAggregator.GetEvent<LoadManualValidationEvent>().Subscribe(OnView);
        }
Exemplo n.º 10
0
        public HydraProjectModule(IRegionManager regionManager, IEventAggregator eventAggregator, IDocumentManager documentManager, IServiceLocator serviceLocator)
        {
            _regionManager = regionManager;
            _eventAggregator = eventAggregator;
            _documentManager = documentManager;
            _serviceLocator = serviceLocator;

            eventAggregator.GetEvent<CreateProjectEvent>().Subscribe(OnCreateProject);
            eventAggregator.GetEvent<LoadProjectEvent>().Subscribe(OnLoadProject);
            eventAggregator.GetEvent<ProjectClosedEvent>().Subscribe(OnProjectClosed);
        }
Exemplo n.º 11
0
        public ShellViewModel(IEventAggregator eventAggregator, IDocumentManager documentManager)
        {
            _eventAggregator = eventAggregator;
            _documentManager = documentManager;
            RecentProjects = Core.Properties.Settings.Default.RecentProjects.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);

            Process = new DelegateCommand<string>(OnProcess, CanProcess);

            _eventAggregator.GetEvent<ProjectClosedEvent>().Subscribe(OnProjectClosed);
            _eventAggregator.GetEvent<LoadProjectEvent>().Subscribe(OnProjectOpened);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected async override void Initialize()
        {
            _packageProvider = new PackageProviderService(this);
            DocumentManager = new DocumentManager(this);

            PackageCommands.Initialize(this);

            base.Initialize();

            // Hook up event handlers
            await Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() =>
            {
                // Must save the solution events, otherwise it seems to get GC'd
                _solutionEvents = Environment.Events.SolutionEvents;
                _solutionEvents.Opened += OnSolutionOpened;
                _solutionEvents.AfterClosing += OnSolutionClosed;

            }), DispatcherPriority.ApplicationIdle, null);
        }
Exemplo n.º 13
0
        public void ResolveImports(ITextProvider text, ISassDocument document, IDocumentManager documentManager)
        {
            try
            {
                if (Filename == null || Filename.Value == null)
                    return;

                var path = ImportResolver.ResolvePath(Filename.Value, text, document.Source.Directory);
                if (string.IsNullOrEmpty(path))
                    return;

                var importFile = new FileInfo(path);
                if (importFile.Exists)
                    Document = documentManager.Import(importFile, document);
            }
            catch (Exception ex)
            {
                OutputLogger.Log(ex, "Failed to process reference file.");
            }
        }
Exemplo n.º 14
0
        public void ResolveImports(ITextProvider text, ISassDocument document, IDocumentManager documentManager)
        {
            foreach (var file in Files)
            {
                try
                {
                    var path = file.ResolvePath(document.Source.Directory, text);
                    if (string.IsNullOrEmpty(path))
                        continue;

                    var importFile = new FileInfo(path);
                    if (importFile.Exists)
                        file.Document = documentManager.Import(importFile, document);
                }
                catch (Exception ex)
                {
                    OutputLogger.Log(ex, "Failed to process import file.");
                }
            }
        }
Exemplo n.º 15
0
        public NewProjectViewModel(IEventAggregator eventAggregator, IServiceLocator serviceLocator)
        {
            _eventAggregator = eventAggregator;
            _experimentTypes = serviceLocator.GetAllInstances<IExperimentType>();
            _documentManager = serviceLocator.GetInstance<IDocumentManager>();

            _recentLocations = Properties.Settings.Default.RecentLocations.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);

            _selectedExperimentType = _experimentTypes.Where(type => type.Name == Properties.Settings.Default.LastSelectedExperimentType).FirstOrDefault();
            _selectedExperimentType = _selectedExperimentType ?? _experimentTypes.First();

            if (string.IsNullOrEmpty(Properties.Settings.Default.LastBrowseLocation))
            {
                string documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                Properties.Settings.Default.LastBrowseLocation = Path.Combine(documents, "Mass Spec Studio Projects");
            }
            _location = Properties.Settings.Default.LastBrowseLocation;
            _projectName = GetNextDirectoryName(_location, _selectedExperimentType.Name + "Project");
            _experimentName = _selectedExperimentType.Name + "Experiment";
        }
Exemplo n.º 16
0
        public ManualValidationViewModel(Result result, IDocumentManager documentManager, IEventAggregator eventAggregator, LabelAmountAlgorithm labelAmountAlgorithm)
        {
            this.eventAggregator = eventAggregator;
            this.result = CloneResultIfNecessary(result);
            this.result = result;
            this.labelAmountAlgorithm = labelAmountAlgorithm;
            this.documentManager = documentManager;

            currentRunResults = new ObservableCollection<ValidationWrapper>();
            allRunResults = (from data in result.RunResults
                             select new ValidationWrapper(data)).ToList();
            foreach (ValidationWrapper runResult in allRunResults)
            {
                runResult.ReprocessingEvent += HandleReprocessingEvent;
                runResult.UpdateEvent += HandleUpdateEvent;
            }

            eventAggregator.GetEvent<PeptideSelectedEvent>().Subscribe(OnPeptideSelected);

            ApplyChanges = new DelegateCommand(OnApplyChanges);
        }
        public ApplicationController(CompositionContainer container, IPresentationController presentationController, 
            IDocumentManager documentManager)
        {
            if (container == null) { throw new ArgumentNullException("container"); }
            if (presentationController == null) { throw new ArgumentNullException("presentationController"); }
            if (documentManager == null) { throw new ArgumentNullException("documentManager"); }

            InitializeCultures();
            presentationController.InitializeCultures();

            this.container = container;
            this.documentManager = documentManager;
            this.documentManager.DocumentsClosing += DocumentManagerDocumentsClosing;

            this.richTextDocumentController = container.GetExportedValue<RichTextDocumentController>();
            this.shellViewModel = container.GetExportedValue<ShellViewModel>();
            this.mainViewModel = container.GetExportedValue<MainViewModel>();

            this.shellViewModel.Closing += ShellViewModelClosing;
            this.exitCommand = new DelegateCommand(Close);
        }
		public BookmarksController( IDocumentManager documentManager , INetscapeBookmarkParser bookmarkParser ) {
			_documentManager = documentManager;
			_bookmarkParser = bookmarkParser;
		}
Exemplo n.º 19
0
 public DocumentController(IDocumentManager documentManager)
 {
     this.documentManager = documentManager;
     AddWeakEventListeners();
 }
Exemplo n.º 20
0
 public ShellViewModel(IView view, IDocumentManager documentManager) : base(view)
 {
     this.documentManager = documentManager;
     AddWeakEventListeners();
 }
Exemplo n.º 21
0
 public StartPageViewModel(IDocumentManager documentManager)
 {
     RecentProjects = Core.Properties.Settings.Default.RecentProjects.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);
     DocumentManager = documentManager;
 }
Exemplo n.º 22
0
 public DocumentsController(IDocumentManager documentManager, SharingFoldersServices sharingFoldersServices, UserServices userServices)
 {
     _documentManager = documentManager;
     _sharingFoldersServices = sharingFoldersServices;
     _userServices = userServices;
 }
Exemplo n.º 23
0
 public DocumentParser(ILexer lexer, IDocumentManager documentManager)
 {
     Lexer = lexer;
     DocumentManager = documentManager;
 }
        private void RefreshBindingSources(IDocumentManager documentManager, bool reset = false)
        {
            if (reset)
            {
                Groups = documentManager?.Groups;
            }

            var cvs = FindResource("Groups") as CollectionViewSource;
            if (cvs != null)
            {
                if (reset || cvs.Source == null)
                {
                    cvs.Source = Groups;
                }
                cvs.View?.Refresh();
            }
        }