Esempio n. 1
0
        public MainWindow(ApplicationInitializer applicationInitializer)
        {
            this.RecentFilesList = new RecentFilesList();

            InitializeComponent();

            this.applicationInitializer = applicationInitializer;

            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.New, New_Executed, New_Enabled));
            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Open, Open_Executed, Open_Enabled));
            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Save, Save_Executed, Save_Enabled));
            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, Close_Executed));
            RecentFilesChanged();
            this.RecentFilesList.RecentFiles.CollectionChanged += RecentFiles_CollectionChanged;
        }
Esempio n. 2
0
        public void Test_RecentFilesList_LifeCycle()
        {
            string recentFilesPath = ApplicationLocalStorageHelper.GetApplicationDataFilePath(RecentFilesList.RECENTFILESSTORENAME);

            if (File.Exists(recentFilesPath))
            {
                File.Delete(recentFilesPath);
            }

            var recentFilesList1 = new RecentFilesList();

            recentFilesList1.Add(@"c:\temp\test1");

            var recentFilesList2 = new RecentFilesList();

            Assert.AreEqual(1, recentFilesList2.RecentFiles.Count);
        }