Exemple #1
0
        private void Reload()
        {
            CacheTextFileReaderModule fileReader = GetFileReader();
            String fileContent = fileReader.Read();

            RenderUI(fileContent, fileReader.Status);
        }
Exemple #2
0
        private CacheTextFileReaderModule GetFileReader()
        {
            CacheTextFileReaderModule fileReader = new CacheTextFileReaderModule();

            fileReader.Context.AbsoluteFilePath    = Server.MapPath("~") + "\\cacheText.txt";
            fileReader.Context.ExparationInSeconds = 30;
            return(fileReader);
        }
Exemple #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            CacheTextFileReaderModule cacheModule = new CacheTextFileReaderModule();

            cacheModule.Context.AbsoluteFilePath    = System.AppDomain.CurrentDomain.BaseDirectory + "cacheText.txt";
            cacheModule.Context.ExparationInSeconds = 30;

            String fileContent = cacheModule.Read();

            if (cacheModule.Status == CacheTextFileReaderStatus.FileFromCache)
            {
                MessageBox.Show("Read from cache");
            }

            MessageBox.Show(fileContent);
        }