Пример #1
0
 public WikiSiteListViewModel(IChildViewModelService childViewModelService,
                              IViewModelFactory viewModelFactory,
                              WikiEditSessionService sessionService)
 {
     _SessionService        = sessionService;
     _ViewModelFactory      = viewModelFactory;
     _ChildViewModelService = childViewModelService;
 }
Пример #2
0
 /// <summary>
 /// Create a new Wiki site instance.
 /// </summary>
 internal WikiSiteViewModel(IEventAggregator eventAggregator, WikiEditSessionService sessionService)
 {
     if (sessionService == null)
     {
         throw new ArgumentNullException(nameof(sessionService));
     }
     _Model           = new WikiSite();
     _SessionService  = sessionService;
     _EventAggregator = eventAggregator;
     AccountProfile   = new AccountProfileViewModel(eventAggregator, this);
 }
 public SessionInformationViewModel(WikiEditSessionService sessionService)
 {
     if (sessionService == null)
     {
         throw new ArgumentNullException(nameof(sessionService));
     }
     SessionService = sessionService;
     PropertyChangedEventManager.AddHandler(sessionService, Controller_PropertyChanged, nameof(sessionService.FileName));
     using (var s = Application.GetResourceStream(GlobalConfigurations.SourceControlVersionUri).Stream)
         using (var r = new StreamReader(s))
             SourceControlInformation = r.ReadToEnd();
 }
Пример #4
0
 public MainWindowViewModel(WikiEditSessionService sessionService,
                            IChildViewModelService childViewModelService,
                            IEventAggregator eventAggregator, IViewModelFactory viewModelFactory)
 {
     if (sessionService == null)
     {
         throw new ArgumentNullException(nameof(sessionService));
     }
     if (childViewModelService == null)
     {
         throw new ArgumentNullException(nameof(childViewModelService));
     }
     this.sessionService    = sessionService;
     _ChildViewModelService = childViewModelService;
     _ViewModelFactory      = viewModelFactory;
     eventAggregator.GetEvent <ActiveDocumentChangedEvent>().Subscribe(OnActiveDocumentChanged);
 }
Пример #5
0
 public WikiSiteEditingViewModel(WikiEditSessionService sessionService, Action acceptCallback, Action cancelCallback)
 {
     if (sessionService == null)
     {
         throw new ArgumentNullException(nameof(sessionService));
     }
     if (acceptCallback == null)
     {
         throw new ArgumentNullException(nameof(acceptCallback));
     }
     if (cancelCallback == null)
     {
         throw new ArgumentNullException(nameof(cancelCallback));
     }
     _SessionService    = sessionService;
     _AcceptCallback    = acceptCallback;
     _CancelCallback    = cancelCallback;
     _ErrorsContainer   = new ErrorsContainer <string>(OnErrorsChanged);
     _MainTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();
 }