Пример #1
0
 /* ----------------------------------------------------------------- */
 ///
 /// HeroViewModel
 ///
 /// <summary>
 /// Initializes a new instance of the RecentViewModel with the
 /// specified argumetns.
 /// </summary>
 ///
 /// <param name="items">Recently used PDF files.</param>
 /// <param name="Aggregator">Messenger object.</param>
 /// <param name="context">Synchronization context.</param>
 ///
 /* ----------------------------------------------------------------- */
 public RecentViewModel(DirectoryMonitor items,
                        Aggregator Aggregator,
                        SynchronizationContext context
                        ) : base(Aggregator, context)
 {
     Items = items;
 }
Пример #2
0
        /* ----------------------------------------------------------------- */
        ///
        /// MainViewModel
        ///
        /// <summary>
        /// Initializes a new instance of the MainViewModel class
        /// with the specified settings.
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        public MainViewModel(SettingFolder src, SynchronizationContext context) :
            base(new Aggregator(), context)
        {
            var recent   = Environment.SpecialFolder.Recent.GetName();
            var mon      = new DirectoryMonitor(recent, "*.pdf.lnk", src.IO, GetDispatcher(false));
            var password = new Query <string>(e => Send(new PasswordViewModel(e, src.IO, context)));

            Model  = new MainFacade(src, password, context);
            Ribbon = new RibbonViewModel(Model.Bindable, Aggregator, context);
            Recent = new RecentViewModel(mon, Aggregator, context);

            SetCommands();
            Track(() => Model.Setup(App.Arguments));
        }
Пример #3
0
        /* ----------------------------------------------------------------- */
        ///
        /// MainViewModel
        ///
        /// <summary>
        /// Initializes a new instance of the MainViewModel class
        /// with the specified settings.
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        public MainViewModel(SettingFolder src, SynchronizationContext context) : base(
                new MainFacade(src, context),
                new Aggregator(),
                context
                )
        {
            var recent = Environment.SpecialFolder.Recent.GetName();
            var mon    = new DirectoryMonitor(recent, "*.pdf.lnk", src.IO, GetInvoker(false));

            Ribbon      = new RibbonViewModel(Facade, Aggregator, context);
            Recent      = new RecentViewModel(mon, Aggregator, context);
            Value.Query = new Query <string>(e => Send(new PasswordViewModel(e, context)));
            Recent.Open = GetOpenLinkCommand();
        }
Пример #4
0
        /* ----------------------------------------------------------------- */
        ///
        /// MainViewModel
        ///
        /// <summary>
        /// Initializes a new instance of the MainViewModel class
        /// with the specified settings.
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        public MainViewModel(SettingsFolder src) : base(new Messenger())
        {
            var recent   = Environment.SpecialFolder.Recent.GetName();
            var mon      = new DirectoryMonitor(recent, "*.pdf.lnk", src.IO);
            var password = new Query <string>(e => Send(new PasswordViewModel(e, src.IO, Context)));

            Model  = new MainFacade(src, password, Context);
            Ribbon = new RibbonViewModel(Model.Bindable, MessengerInstance);
            Recent = new RecentViewModel(mon, MessengerInstance);

            Data.Source.PropertyChanged += (s, e) => Ribbon.Raise();
            Data.Busy.PropertyChanged   += (s, e) => Ribbon.Raise();

            SetCommands();
            Post(() => Model.Setup(App.Arguments));
        }
Пример #5
0
 /* ----------------------------------------------------------------- */
 ///
 /// HeroViewModel
 ///
 /// <summary>
 /// Initializes a new instance of the RecentViewModel with the
 /// specified argumetns.
 /// </summary>
 ///
 /// <param name="items">Recently used PDF files.</param>
 /// <param name="messenger">Messenger object.</param>
 ///
 /* ----------------------------------------------------------------- */
 public RecentViewModel(DirectoryMonitor items, IMessenger messenger) : base(messenger)
 {
     Items        = items;
     Menu.Command = new RelayCommand(() => Post(() => Process.Start(Items.Directory)));
 }