Exemple #1
0
        public BackgroundParsingTask(IDocumentParserFactory parserFactory, IDocumentManager documentManager)
        {
            ParserFactory = parserFactory;
            ShutdownToken = SassyStudioPackage.Instance.ShutdownToken;

            documentManager.DocumentAdded += OnDocumentAdded;
        }
        /// <summary>
        /// Cancels the checkout.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="journalpostId">The journalpost id.</param>
        /// <param name="dokumentversjon">The document object.</param>
        public static void CancelCheckout(this IDocumentManager instance, int journalpostId, Dokumentversjon dokumentversjon)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            if (dokumentversjon == null)
            {
                throw new ArgumentNullException("dokumentversjon");
            }

            if (!dokumentversjon.DokumentbeskrivelseId.HasValue)
            {
                throw new InvalidOperationException("The Documentversjon.DokumentbeskrivelseId cannot be <null>.");
            }

            if (string.IsNullOrEmpty(dokumentversjon.VariantId))
            {
                throw new InvalidOperationException("The Documentversjon.VariantId cannot be <null> or empty.");
            }

            if (!dokumentversjon.Versjonsnummer.HasValue)
            {
                throw new InvalidOperationException("The Documentversjon.Versjonsnummer cannot be <null>.");
            }

            instance.CancelCheckout(journalpostId, dokumentversjon.DokumentbeskrivelseId.Value, dokumentversjon.VariantId, dokumentversjon.Versjonsnummer.Value);
        }
Exemple #3
0
        public DocumentsViewModel(INavigationService _navigation, IDatabase _database, ILogging _logging, IDialogue _dialogue,
                                  IDialogue dialogue, IAccountManager _accountManager, IDocumentManager documentManager) : base(_navigation, _database, _logging, _dialogue)
        {
            _dialogue        = dialogue;
            _documentManager = documentManager;

            var SiteUser = _accountManager.GetSiteUser_ByID <Cross.DataVault.Data.Account>(Constants.InMemory_ContactID);

            if (SiteUser != null)
            {
                SiteUserEmail = SiteUser.Email;
                SiteUserName  = String.Format("{0} {1}", SiteUser.FirstName, SiteUser.LastName);
                Avatar        = SiteUser.Avatar;
            }
            else
            {
                throw new ArgumentNullException("Cannot find Site user Information. Please contact site administrator for assistance");
            }

            Initials = String.Format("{0}{1}", SiteUserName.First().ToString().ToUpper(), SiteUserName.Last().ToString().ToLower());
            Title    = "My Documents";

            //Relays
            IOpenDrawer = new Relays.RelayExtension(OpenDrawer, CanOpenDrawer);
            IOpenSearch = new Relays.RelayExtension(OpenSearch, CanOpenSearch);
            IGoBack     = new Relays.RelayExtension(GoBack, CanGoBack);
            IOpenFloat  = new Relays.RelayExtension(OpenFloat, CanOpenFloat);

            //Relays - Refresh Data
            IOnRefresh = new Relays.RelayExtension(OnRefresh, CanOnRefresh);

            //Initialization
            Initialize_Core();
        }
        public PathWatcher(string inputPath, IFileManager fileManager, IBarcodeManager barcodeManager, IDocumentManager documentManager, IPublisher <IEnumerable <byte> > documentPublisher, IPublisher <StatusDTO> statusPublisher)
        {
            _fileManager       = fileManager;
            _barcodeManager    = barcodeManager;
            _documentManager   = documentManager;
            _documentPublisher = documentPublisher;
            _statusPublisher   = statusPublisher;

            _status = new StatusDTO
            {
                Value       = ServiceStatuses.Waiting,
                ServiceName = Guid.NewGuid().ToString()
            };

            _statusTimer = new SystemTimer(_statusInterval)
            {
                Enabled   = false,
                AutoReset = true
            };

            _watcher = new FileSystemWatcher(inputPath);
            _worker  = new Thread(WorkProcess);

            _watcher.Created     += Watcher_Created;
            _statusTimer.Elapsed += StatusTimer_Elapsed;
        }
 public TagArchiveNodeSource(string name, GameDefinition game, IDocumentManager documentManager,
                             DefaultState defaultState)
     : this(name, game, documentManager, DisplayItems.AllExtractedItems,
            defaultState)
 {
     ;
 }
        /// <summary>
        /// Checks in the <paramref name="content"/> to the specified <paramref name="dokumentversjon"/>.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="dokumentversjon">The document object.</param>
        /// <param name="content">The content.</param>
        public static void Checkin(this IDocumentManager instance, Dokumentversjon dokumentversjon, Stream content)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            if (dokumentversjon == null)
            {
                throw new ArgumentNullException("dokumentversjon");
            }

            if (!dokumentversjon.DokumentbeskrivelseId.HasValue)
            {
                throw new InvalidOperationException("The Documentversjon.DokumentbeskrivelseId cannot be <null>.");
            }

            if (string.IsNullOrEmpty(dokumentversjon.VariantId))
            {
                throw new InvalidOperationException("The Documentversjon.VariantId cannot be <null> or empty.");
            }

            if (!dokumentversjon.Versjonsnummer.HasValue)
            {
                throw new InvalidOperationException("The Documentversjon.Versjonsnummer cannot be <null>.");
            }

            instance.CheckIn(dokumentversjon.DokumentbeskrivelseId.Value, dokumentversjon.VariantId, dokumentversjon.Versjonsnummer.Value, content);
        }
Exemple #7
0
        /// <summary>
        /// Inizializza l'istanza della classe acquisendo i dati relativi all'utente
        /// ed alla libreria per la connessione al documentale.
        /// </summary>
        /// <param name="infoUtente">Dati relativi all'utente</param>
        /// <param name="currentLibrary">Libreria per la connessione al documentale</param>
        public DocumentManager(DocsPaVO.utente.InfoUtente infoUtente)
        {
            this._infoUtente = infoUtente;

            this._documentManagerETDOCS     = new DocumentManagerETDOCS(infoUtente);
            this._documentManagerDocumentum = new DocumentManagerDOCUMENTUM(infoUtente);
        }
 public BackgroundTimer(IDocumentManager documentManager, ILogger logger,
                        IConfiguration configuration)
 {
     _documentManager = documentManager;
     _logger          = logger;
     _configuration   = configuration;
 }
        public BackgroundParsingTask(IDocumentParserFactory parserFactory, IDocumentManager documentManager)
        {
            ParserFactory = parserFactory;
            ShutdownToken = SassyStudioPackage.Instance.ShutdownToken;

            documentManager.DocumentAdded += OnDocumentAdded;
        }
        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.");
            }
        }
Exemple #11
0
        /// <summary>
        /// Inizializza l'istanza della classe acquisendo i dati relativi all'utente
        /// ed alla libreria per la connessione al documentale.
        /// </summary>
        /// <param name="infoUtente">Dati relativi all'utente</param>
        /// <param name="currentLibrary">Libreria per la connessione al documentale</param>
        public DocumentManager(DocsPaVO.utente.InfoUtente infoUtente)
        {
            this._infoUtente = infoUtente;

            this._documentManagerETDOCS = new DocumentManagerETDOCS(infoUtente);
            //this.DocumentManagerHERMES = new DocumentManagerHermesHB();
        }
        public RootLevelDocumentCache(IDocumentManager documentManager)
        {
            DocumentManager = documentManager;
            DocumentManager.DocumentAdded += OnObservedDocumentAdded;

            Initialize();
        }
Exemple #13
0
        public RootLevelDocumentCache(IDocumentManager documentManager)
        {
            DocumentManager = documentManager;
            DocumentManager.DocumentAdded += OnObservedDocumentAdded;

            Initialize();
        }
Exemple #14
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);
        }
Exemple #15
0
        private EphorteContext(
            Func <IObjectModelAdapter, NcoreVersion, IStateManager> createStateManager,            // Workaround to be able to instantiate a statemanager with a different IQueryProvider
            IObjectModelAdapter objectModelAdapter,
            IFunctionsAdapter functionsAdapter,
            IDocumentsAdapter documentsAdapter,
            IMetadataAdapter metadataAdapter,
            NcoreVersion ncoreVersion
            )
        {
            NcoreVersion = ncoreVersion ?? NcoreVersion.Configured;

            if (objectModelAdapter != null)
            {
                _stateManager       = createStateManager(objectModelAdapter, NcoreVersion);
                _objectModelAdapter = objectModelAdapter;
            }

            if (functionsAdapter != null)
            {
                _functionManager = new FunctionManager(functionsAdapter);
            }

            if (documentsAdapter != null)
            {
                _documentManager = new DocumentManager(documentsAdapter);
            }

            if (metadataAdapter != null)
            {
                _metadataManager = new MetadataManager(metadataAdapter);
            }
        }
Exemple #16
0
        public EditorEditMenuItemProvider(IDocumentManager documentManager)
        {
            DocumentManager = documentManager;
            SubItems        = new List <IMenuItem>();
            SubItems.Add(new ModuleMenuItem("_Undo", new DelegateCommand(() => DocumentManager.ActiveDocument?.Undo.Execute(null),
                                                                         () => DocumentManager.ActiveDocument?.Undo.CanExecute(null) ?? false).ObservesProperty(() => DocumentManager.ActiveDocument).
                                            ObservesProperty(() => DocumentManager.ActiveDocument !.IsModified), new("Control+Z")));

            SubItems.Add(new ModuleMenuItem("_Redo", new DelegateCommand(() => DocumentManager.ActiveDocument?.Redo.Execute(null),
                                                                         () => DocumentManager.ActiveDocument?.Redo.CanExecute(null) ?? false).ObservesProperty(() => DocumentManager.ActiveDocument).
                                            ObservesProperty(() => DocumentManager.ActiveDocument !.IsModified), new("Control+Y")));

            SubItems.Add(new ModuleManuSeparatorItem());

            SubItems.Add(new ModuleMenuItem("_Copy",
                                            new DelegateCommand(
                                                () => DocumentManager.ActiveDocument?.Copy.Execute(null),
                                                () => DocumentManager.ActiveDocument?.Copy.CanExecute(null) ?? false)
                                            .ObservesProperty(() => DocumentManager.ActiveDocument), new("Control+C")));

            SubItems.Add(new ModuleMenuItem("Cu_t",
                                            new DelegateCommand(
                                                () => DocumentManager.ActiveDocument?.Cut.Execute(null),
                                                () => DocumentManager.ActiveDocument?.Cut.CanExecute(null) ?? false)
                                            .ObservesProperty(() => DocumentManager.ActiveDocument), new("Control+X")));

            SubItems.Add(new ModuleMenuItem("_Paste",
                                            new DelegateCommand(() => DocumentManager.ActiveDocument?.Paste.Execute(null),
                                                                () => DocumentManager.ActiveDocument?.Paste.CanExecute(null) ?? false)
                                            .ObservesProperty(() => DocumentManager.ActiveDocument), new("Control+V")));
        }
Exemple #17
0
        public FileProcessor(
            IFileNameGenerator fileNameGenerator,
            IDocumentWrapper documentWrapper,
            IDocumentManager documentManager,
            Func <Type, ITaggerCommand> commandFactory,
            ILogger logger)
        {
            if (fileNameGenerator == null)
            {
                throw new ArgumentNullException(nameof(fileNameGenerator));
            }

            if (documentWrapper == null)
            {
                throw new ArgumentNullException(nameof(documentWrapper));
            }

            if (documentManager == null)
            {
                throw new ArgumentNullException(nameof(documentManager));
            }

            if (commandFactory == null)
            {
                throw new ArgumentNullException(nameof(commandFactory));
            }

            this.fileNameGenerator = fileNameGenerator;
            this.documentWrapper   = documentWrapper;
            this.documentManager   = documentManager;
            this.commandFactory    = commandFactory;
            this.logger            = logger;

            this.tasks = new ConcurrentQueue <Task>();
        }
Exemple #18
0
        public static async Task <Tuple <long, long> > PCHelpEnsure(
            IServiceInstanceManager sim,
            long?ScopeId,
            IContentManager ContentManger,
            IFilePathResolver FilePathResolver,
            IDocumentManager DocManager,
            IDocumentCategoryManager CatManager
            )
        {
            var re = await DocManager.DocEnsureFromFiles(
                CatManager,
                //"pc-help",
                null,
                FilePathResolver.Resolve($"root://StaticResources/帮助文档/PC文档")
                );

            await sim.UpdateSetting <HygouSetting>(
                ScopeId,
                s =>
            {
                s.PCHelpCenterDefaultDocId = re[0].Children[0].Id;
            });

            var tail_doc_list = await ContentManger.ContentEnsure(
                "PC页面尾部文档列表",
                "PC页面尾部文档列表",
                null,
                re.Select(cat =>
                          new ContentItem {
                Title1 = cat.Name,
                Items = cat.Children.Select(doc =>
                                            new ContentItem {
                    Title1 = doc.Name, Uri = $"/help/doc/{doc.Id}"
                }
                                            ).ToArray()
            }
                          ).Take(4).ToArray()
                );

            var tail_link_list = await ContentManger.ContentEnsure(
                "PC页面尾部链接列表",
                "PC页面尾部链接列表",
                null,
                re.Last().Children.Select(doc =>
                                          new ContentItem {
                Title1 = doc.Name, Uri = $"/help/doc/{doc.Id}"
            }
                                          ).ToArray()
                );

            await sim.UpdateSetting <FriendlyContentSetting>(
                ScopeId,
                s =>
            {
                s.PCHomeTailMenuId = tail_doc_list.Id;
            });

            return(Tuple.Create(tail_doc_list.Id, tail_link_list.Id));
        }
 // ------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------
 public GetController()
 {
     this._entityManager = new DocumentEntityManager();
     this._documentManager = new DocumentManager()
     {
         EntityManager = this._entityManager
     };
 }
Exemple #20
0
 public GenericTableDocumentService(ITableDefinitionProvider tableDefinitionProvider,
                                    IDocumentManager documentManager,
                                    DatabaseTableSolutionItemEditorProvider documentProvider)
 {
     this.tableDefinitionProvider = tableDefinitionProvider;
     this.documentManager         = documentManager;
     this.documentProvider        = documentProvider;
 }
Exemple #21
0
        /// <summary>
        /// Inizializza l'istanza della classe acquisendo i dati relativi all'utente
        /// ed alla libreria per la connessione al documentale.
        /// </summary>
        /// <param name="infoUtente">Dati relativi all'utente</param>
        /// <param name="currentLibrary">Libreria per la connessione al documentale</param>
        public DocumentManager(DocsPaVO.utente.InfoUtente infoUtente)
        {
            this._infoUtente = infoUtente;

            this._documentManagerETDOCS = new DocumentManagerETDOCS(infoUtente);

            this._documentManagerWSPIA = new DocumentManagerWSPIA(infoUtente);
        }
Exemple #22
0
 protected ProcessDocuments(IDocumentManager <Document> documentManager)
 {
     if (documentManager == null)
     {
         throw new ArgumentNullException("documentManager");
     }
     _documentManager = documentManager;
 }
Exemple #23
0
 public SlideshowPlayerEngineManager(
     IDocumentManager <PresentationProfilesDocument> documentManager,
     IEnumerable <ISlideshowPlayerEngine> slideshowPlayerEngines
     )
 {
     _documentManager        = documentManager;
     _slideshowPlayerEngines = slideshowPlayerEngines;
 }
Exemple #24
0
 // ------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------
 public GetController()
 {
     this._entityManager   = new DocumentEntityManager();
     this._documentManager = new DocumentManager()
     {
         EntityManager = this._entityManager
     };
 }
 public EditorViewMenuItemProvider(IDocumentManager documentManager)
 {
     SubItems = new List <IMenuItem>(capacity: documentManager.AllTools.Count);
     foreach (var window in documentManager.AllTools)
     {
         SubItems.Add(new ModuleMenuItem(window.Title, new DelegateCommand(() => documentManager.OpenTool(window.GetType()))));
     }
 }
        protected DocumentController(IDocumentManager documentManager)
        {
            if (documentManager == null) { throw new ArgumentNullException("documentManager"); }

            this.documentManager = documentManager;
            AddWeakEventListener(documentManager, DocumentManagerPropertyChanged);
            AddWeakEventListener(documentManager.Documents, DocumentsCollectionChanged);
        }
        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
     };
 }
        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);
        }
Exemple #30
0
        public SassEditorManager(IDocumentManager documentManager, IIntellisenseManager intellisenseManager, IForegroundParsingTask parsingTask, IBackgroundParsingTask backgroundParsingTask)
        {
            DocumentManager     = documentManager;
            IntellisenseManager = intellisenseManager;
            ParsingTask         = parsingTask;

            // start background monitoring
            backgroundParsingTask.Start();
        }
Exemple #31
0
 public Pan(IDocumentManager documentManager,
            IWinformToolbarViewManager winformToolbarViewManager,
            ICADToolbarControl cadToolbarControl
            )
 {
     DocumentManager           = documentManager;
     WinformToolbarViewManager = winformToolbarViewManager;
     CADToolbarControl         = cadToolbarControl;
 }
 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;
 }
 public FileMenuViewModel(IDocumentManager theDocumentManager)
 {
     _documentManager = theDocumentManager;
     NewCommand       = new CommandHandler(FileNewAction);
     OpenCommand      = new CommandHandler(FileOpenAction);
     SaveCommand      = new CommandHandler(FileSaveAction);
     SaveAsCommand    = new CommandHandler(FileSaveAsAction);
     ExitCommand      = new CommandHandler(FileExitAction);
 }
Exemple #34
0
 public CADViewSingleFileDocumentResource(IocManager iocManager,
                                          IDocumentManager documentManager,
                                          ICADToolbarControl toolbarControl
                                          )
 {
     IocManager      = iocManager;
     DocumentManager = documentManager;
     ToolbarControl  = toolbarControl;
 }
 public AvaloniaToolDockWrapper(IDocumentManager documentManager, ITool tool)
 {
     this.documentManager = documentManager;
     Id        = tool.UniqueId;
     Title     = tool.Title;
     ViewModel = tool;
     CanFloat  = false;
     CanPin    = false;
     CanClose  = true;
 }
 public AnniversarySummaryService(IDocumentManager documentManager,
                                  Func <TimelineViewModel> timelineViewModelFactory,
                                  IUserSettings userSettings)
 {
     this.documentManager          = documentManager;
     this.timelineViewModelFactory = timelineViewModelFactory;
     this.userSettings             = userSettings;
     data = userSettings.Get <Data>();
     ShowAnniversaryBox = !data.HideSummaryBox;
 }
Exemple #37
0
 public DocumentController(UserManager <ApplicationUser> userManager, DataContext context,
                           IDocumentRepository documentRepository, ITagRepository tagRepository,
                           IDocumentManager documentManager)
 {
     _userManager        = userManager;
     _context            = context;
     _documentRepository = documentRepository;
     _tagRepository      = tagRepository;
     _documentManager    = documentManager;
 }
Exemple #38
0
        public void Init()
        {
            settings        = Substitute.For <IUpdaterSettingsProvider>();
            currentVersion  = Substitute.For <IApplicationVersion>();
            documentManager = Substitute.For <IDocumentManager>();
            fileSystem      = Substitute.For <IFileSystem>();

            fileSystem.Exists("changelog.json").Returns(true);
            fileSystem.ReadAllText("changelog.json").Returns(@"[{""Version"":294,""VersionName"":""Build 0.1.294"",""Date"":""2021-03-13T17:38:00"",""UpdateTitle"":null,""Changes"":[]}]");
        }
Exemple #39
0
 /// <summary>
 /// Provides a state that corresponds to a sepcified document being opened in the DocumentManager.
 /// </summary>
 /// <param name="manager">The document manager that will be used to determine state.</param>
 /// <param name="gameID">The GameID of the game that opened documents will belong to.</param>
 /// <param name="location">The TagLocation that opened documents will exist in.</param>
 /// <param name="collapsedIcon">The icon that will be displayed when the node is collapsed.</param>
 /// <param name="expandedIcon">The icon that will be displayed when the node is expanded.</param>
 /// <param name="foregroundColor">The foreground color of the node.</param>
 /// <param name="backgroundColor">The background color of the node.</param>
 public DocumentOpenState(IDocumentManager manager, string gameID, TagLocation location,
                          Bitmap collapsedIcon, Bitmap expandedIcon, Color foregroundColor, Color backgroundColor)
     : base("document_open", collapsedIcon, expandedIcon, foregroundColor, backgroundColor)
 {
     this.manager = manager;
     this.gameID  = gameID;
     tagLocation  = location;
     this.manager.DocumentOpened += new DocumentActionHandler(manager_DocumentOpened);
     this.manager.DocumentClosed += new DocumentClosedHandler(manager_DocumentClosed);
 }
        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);
        }
Exemple #41
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);
        }
        /// <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);
        }
        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";
        }
        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.");
                }
            }
        }
        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.");
            }
        }
        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 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);
        }
Exemple #48
0
 public ShellViewModel(IView view, IDocumentManager documentManager) : base(view)
 {
     this.documentManager = documentManager;
     AddWeakEventListeners();
 }
 public DocumentsController(IDocumentManager documentManager, SharingFoldersServices sharingFoldersServices, UserServices userServices)
 {
     _documentManager = documentManager;
     _sharingFoldersServices = sharingFoldersServices;
     _userServices = userServices;
 }
Exemple #50
0
 public DocumentController(IDocumentManager documentManager)
 {
     this.documentManager = documentManager;
     AddWeakEventListeners();
 }
 public DocumentParser(ILexer lexer, IDocumentManager documentManager)
 {
     Lexer = lexer;
     DocumentManager = documentManager;
 }
		public BookmarksController( IDocumentManager documentManager , INetscapeBookmarkParser bookmarkParser ) {
			_documentManager = documentManager;
			_bookmarkParser = bookmarkParser;
		}
        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();
            }
        }
 public StartPageViewModel(IDocumentManager documentManager)
 {
     RecentProjects = Core.Properties.Settings.Default.RecentProjects.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);
     DocumentManager = documentManager;
 }