• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CacheManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CacheManager的典型用法代码示例。如果您正苦于以下问题:C# CacheManager类的具体用法?C# CacheManager怎么用?C# CacheManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CacheManager类属于命名空间,在下文中一共展示了CacheManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AppManager

        public AppManager(IDataLayer dl)
        {
            data = dl;
            cache = new CacheManager();

            this.firstDataDate = DateTime.Now;
        }
开发者ID:jacobduijzer,项目名称:WerktijdenApp,代码行数:7,代码来源:AppManager.cs


示例2: AssemblyExplorer

    public AssemblyExplorer(MSpecUnitTestProvider provider,
#if RESHARPER_61
                            IUnitTestElementManager manager,
                            PsiModuleManager psiModuleManager,
                            CacheManager cacheManager,
#endif
                            IMetadataAssembly assembly,
                            IProject project,
                            UnitTestElementConsumer consumer)
    {
      _assembly = assembly;
      _consumer = consumer;

      using (ReadLockCookie.Create())
      {
        var projectEnvoy = new ProjectModelElementEnvoy(project);

        var cache = new ContextCache();
#if RESHARPER_61
        _contextFactory = new ContextFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, _assembly.Location.FullPath, cache);
        _contextSpecificationFactory = new ContextSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
        _behaviorFactory = new BehaviorFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
        _behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy);
#else
#if RESHARPER_6
        _contextFactory = new ContextFactory(provider, project, projectEnvoy, _assembly.Location.FullPath, cache);
#else
        _contextFactory = new ContextFactory(provider, project, projectEnvoy, _assembly.Location, cache);
#endif
        _contextSpecificationFactory = new ContextSpecificationFactory(provider, project, projectEnvoy, cache);
        _behaviorFactory = new BehaviorFactory(provider, project, projectEnvoy, cache);
        _behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, project, projectEnvoy);
#endif
      }
    }
开发者ID:jleo3,项目名称:machine.specifications,代码行数:35,代码来源:AssemblyExplorer.cs


示例3: AmoebaManager

        public AmoebaManager(string blocksPath, BufferManager bufferManager)
        {
            _blocksPath = blocksPath;
            _bufferManager = bufferManager;

            _clientManager = new ClientManager(_bufferManager);
            _serverManager = new ServerManager(_bufferManager);
            _cacheManager = new CacheManager(_blocksPath, _bufferManager);
            _connectionsManager = new ConnectionsManager(_clientManager, _serverManager, _cacheManager, _bufferManager);
            _downloadManager = new DownloadManager(_connectionsManager, _cacheManager, _bufferManager);
            _uploadManager = new UploadManager(_connectionsManager, _cacheManager, _bufferManager);
            _backgroundDownloadManager = new BackgroundDownloadManager(_connectionsManager, _cacheManager, _bufferManager);
            _backgroundUploadManager = new BackgroundUploadManager(_connectionsManager, _cacheManager, _bufferManager);

            _clientManager.CreateCapEvent = (object sender, string uri) =>
            {
                return _createCapEvent?.Invoke(this, uri);
            };

            _serverManager.AcceptCapEvent = (object sender, out string uri) =>
            {
                uri = null;
                return _acceptCapEvent?.Invoke(this, out uri);
            };

            _clientManager.CheckUriEvent = (object sender, string uri) =>
            {
                return _checkUriEvent?.Invoke(this, uri) ?? true;
            };

            _serverManager.CheckUriEvent = (object sender, string uri) =>
            {
                return _checkUriEvent?.Invoke(this, uri) ?? true;
            };
        }
开发者ID:Alliance-Network,项目名称:Library,代码行数:35,代码来源:AmoebaManager.cs


示例4: ItemBrowsingService

 public ItemBrowsingService(IItemService itemService, ISearchProvider searchService, CacheManager cacheManager, IBlobUrlResolver blobUrlResolver = null, ISearchConnection searchConnection = null)
 {
     _searchProvider = searchService;
     _searchConnection = searchConnection;
     _itemService = itemService;
     _blobUrlResolver = blobUrlResolver;
 }
开发者ID:n1njab0b,项目名称:vc-community,代码行数:7,代码来源:ItemBrowsingService.cs


示例5: MSpecUnitTestProvider

 public MSpecUnitTestProvider(ISolution solution, PsiModuleManager psiModuleManager, CacheManager cacheManager)
 {
   Solution = solution;
   PsiModuleManager = psiModuleManager;
   CacheManager = cacheManager;
   Debug.Listeners.Add(new DefaultTraceListener());
 }
开发者ID:hhariri,项目名称:machine.specifications,代码行数:7,代码来源:MSpecUnitTestProvider.cs


示例6: XunitTestProvider

 public XunitTestProvider(ISolution solution,
                          CacheManager cacheManager,
                          PsiModuleManager psiModuleManager,
                          UnitTestingCategoriesProvider categoriesProvider)
 {
     this.solution = solution;
 }
开发者ID:Eskat0n,项目名称:ReSharper.XUnitTestRunner,代码行数:7,代码来源:XunitTestProvider.cs


示例7: Region

        public Region( StatLog statLog,  CacheManager cacheManager)
            : base(0, 0, 0, 0)
        {
            // Store the statLog
            _statLog = statLog;

            // Store the cache manager
            // TODO: What happens if the cachemanger changes during the lifecycle of this region?
            _cacheManager = cacheManager;

            //default options
            options.Width = 1024;
            options.Height = 768;
            options.Left = 0;
            options.Top = 0;
            options.Uri = null;

            this.Size = new Size(options.Width, options.Height);

            this.Location = new Point(options.Left, options.Top);



              this.Background = new SolidColorBrush(Colors.Red);

            if (Settings.Default.DoubleBuffering)
            {
                //   SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
                //      SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            }

            // Create a new BlackList for us to use
            blackList = new BlackList();
        }
开发者ID:afrog33k,项目名称:eAd,代码行数:34,代码来源:Region.cs


示例8: Init

 public void Init(System.Web.HttpApplication context)
 {
   
     context.BeginRequest += Application_BeginRequest;
     context.EndRequest += Application_EndRequest;
     RootURL = System.Configuration.ConfigurationManager.AppSettings["ROOT_URL"];
     if (string.IsNullOrEmpty(RootURL))
         RootURL = "http://localhost";
     MenCacheHost = System.Configuration.ConfigurationManager.AppSettings["MEMCACHE_HOST"];
     if (string.IsNullOrEmpty(MenCacheHost))
         MenCacheHost = "127.0.0.1:11211";
     Boolean.TryParse(System.Configuration.ConfigurationManager.AppSettings["ENABLED_MEMCACHE"], out MenCacheEnabled);
     Boolean.TryParse(System.Configuration.ConfigurationManager.AppSettings["ENABLED_WEBCACHE"], out WebCacheEnabled);
     GetDespatch = new Despatch();
     try
     {
         if (MenCacheEnabled)
             MenCache = new CacheManager(MenCacheHost);
        
     }
     catch
     {
     }
     
 }
开发者ID:priceLiu,项目名称:Enterprise.Company,代码行数:25,代码来源:MenCacheModule.cs


示例9: ReadFromXml

    public static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, MSpecUnitTestProvider provider, ISolution solution
#if RESHARPER_61
      , IUnitTestElementManager manager, PsiModuleManager psiModuleManager, CacheManager cacheManager
#endif
      )
    {
      var projectId = parent.GetAttribute("projectId");
      var project = ProjectUtil.FindProjectElementByPersistentID(solution, projectId) as IProject;
      if (project == null)
      {
        return null;
      }

      var behavior = parentElement as BehaviorElement;
      if (behavior == null)
      {
        return null;
      }

      var typeName = parent.GetAttribute("typeName");
      var methodName = parent.GetAttribute("methodName");
      var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));

      return BehaviorSpecificationFactory.GetOrCreateBehaviorSpecification(provider,
#if RESHARPER_61
        manager, psiModuleManager, cacheManager,
#endif
        project, behavior, ProjectModelElementEnvoy.Create(project), typeName, methodName, isIgnored);
    }
开发者ID:rho24,项目名称:machine.specifications,代码行数:29,代码来源:BehaviorSpecificationElement.cs


示例10: GetOrCreateContextSpecification

    public static ContextSpecificationElement GetOrCreateContextSpecification(MSpecUnitTestProvider provider,
                                                                              IUnitTestElementManager manager,
                                                                              PsiModuleManager psiModuleManager,
                                                                              CacheManager cacheManager,
                                                                              IProject project,
                                                                              ContextElement context,
                                                                              ProjectModelElementEnvoy projectEnvoy,
                                                                              IClrTypeName declaringTypeName,
                                                                              string fieldName,
                                                                              bool isIgnored)
    {
      var id = ContextSpecificationElement.CreateId(context, fieldName);
      var contextSpecification = manager.GetElementById(project, id) as ContextSpecificationElement;
      if (contextSpecification != null)
      {
        contextSpecification.Parent = context;
        contextSpecification.State = UnitTestElementState.Valid;
        return contextSpecification;
      }

      return new ContextSpecificationElement(provider,
                                             psiModuleManager,
                                             cacheManager,
                                             context,
                                             projectEnvoy,
                                             declaringTypeName,
                                             fieldName,
                                             isIgnored);
    }
开发者ID:AnthonyMastrean,项目名称:machine.specifications,代码行数:29,代码来源:ContextSpecificationFactory.cs


示例11: FileCollector

        public FileCollector(CacheManager cacheManager, FilesModel xmlString)
        {
            _cacheManager = cacheManager;


            // Create a required files object
            _requiredFiles = new RequiredFiles();


            foreach (var item in xmlString.Items)
            {
                _requiredFiles.Files.Add(item);
            }


            // Get the key for later use
            hardwareKey = new HardwareKey();

            // Make a new filelist collection
            _files = new Collection<RequiredFileModel>();

            // Create a webservice call
            xmdsFile = new ServiceClient();

            // Start up the Xmds Service Object
            //xmdsFile.Credentials = null;
            //xmdsFile.Url = Properties.Settings.Default.Client_xmds_xmds;
            //xmdsFile.UseDefaultCredentials = false;

            // Hook onto the xmds file complete event
            xmdsFile.GetFileCompleted += (XmdsFileGetFileCompleted);
        }
开发者ID:afrog33k,项目名称:eAd,代码行数:32,代码来源:FileCollector.cs


示例12: TestBasicCachingFunctionality

 public void TestBasicCachingFunctionality()
 {
     string objectToStore = "Test Object";
     CacheManager manager = new CacheManager(new MemoryProvider());
     manager.Store(objectToStore);
     Assert.AreEqual(objectToStore, manager.GetMostRecentCacheItem());
 }
开发者ID:neraath,项目名称:testing-in-sp2010,代码行数:7,代码来源:CacheManagerTests.cs


示例13: Example

        public void Example()
        {
            var cacheManager = new CacheManager();

            Assert.IsNotNull(cacheManager);

        }
开发者ID:codesmithtools,项目名称:Framework-Samples,代码行数:7,代码来源:CacheManagerTests.cs


示例14: ReadFromXml

    public static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, MSpecUnitTestProvider provider, ISolution solution
#if RESHARPER_61
      , IUnitTestElementManager manager, PsiModuleManager psiModuleManager, CacheManager cacheManager
#endif
      )
    {
      var projectId = parent.GetAttribute("projectId");
      var project = ProjectUtil.FindProjectElementByPersistentID(solution, projectId) as IProject;
      if (project == null)
      {
        return null;
      }

      var context = parentElement as ContextElement;
      if (context == null)
      {
        return null;
      }

      var typeName = parent.GetAttribute("typeName");
      var methodName = parent.GetAttribute("methodName");
      var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));

      return ContextSpecificationFactory.GetOrCreateContextSpecification(provider,
#if RESHARPER_61
                manager, psiModuleManager, cacheManager,
#endif
                project, context, ProjectModelElementEnvoy.Create(project), new ClrTypeName(typeName), methodName, EmptyArray<string>.Instance, isIgnored);
    }
开发者ID:kropp,项目名称:machine.specifications,代码行数:29,代码来源:ContextSpecificationElement.cs


示例15: GetOrAddValueFactoryTest

    public void GetOrAddValueFactoryTest()
    {
      var cacheManager = new CacheManager(); 
      string key = "key" + DateTime.Now.Ticks;
      object value = "value" + DateTime.Now.Ticks;
      bool valueCalled = false;

      Func<string, object> valueFactory = k => { valueCalled = true; return value; }; 
      object result = cacheManager.GetOrAdd(key, valueFactory);

      Assert.IsNotNull(result);
      Assert.IsTrue(valueCalled);
      Assert.AreEqual(value, result);

      // value factory 2 should not be called
      object value2 = "value2" + DateTime.Now.Ticks;
      bool value2Called = false;      
      Func<string, object> valueFactory2 = k => { value2Called = true; return value2; };

      object result2 = cacheManager.GetOrAdd(key, valueFactory2);

      Assert.IsNotNull(result2);
      Assert.IsFalse(value2Called);
      // result should still = first call
      Assert.AreEqual(value, result2);
    }
开发者ID:modulexcite,项目名称:LoreSoft.Shared,代码行数:26,代码来源:CacheManagerTest.cs


示例16: SimpleTestingElementFactory

 public SimpleTestingElementFactory(SimpleTestingTestProvider provider, IUnitTestElementManager unitTestManager, CacheManager cacheManager, PsiModuleManager psiModuleManager)
 {
     _provider = provider;
     _unitTestManager = unitTestManager;
     _cacheManager = cacheManager;
     _psiModuleManager = psiModuleManager;
 }
开发者ID:briandonahue,项目名称:simple-testing,代码行数:7,代码来源:SimpleTestingElementFactory.cs


示例17: XunitServiceProvider

 public XunitServiceProvider(XunitTestProvider provider, PsiModuleManager psiModuleManager,
     CacheManager cacheManager)
 {
     this.provider = provider;
     this.psiModuleManager = psiModuleManager;
     this.cacheManager = cacheManager;
 }
开发者ID:hazzik,项目名称:ReSharper.XUnitTestRunner,代码行数:7,代码来源:XunitServiceProvider.71.cs


示例18: AddKeyNullTest

 public void AddKeyNullTest()
 {
   var cacheManager = new CacheManager();
   string key = null;
   object value = "value" + DateTime.Now.Ticks;
   CachePolicy cachePolicy = null;
   bool isAdded = cacheManager.Add(key, value, cachePolicy);
 }
开发者ID:modulexcite,项目名称:LoreSoft.Shared,代码行数:8,代码来源:CacheManagerTest.cs


示例19: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
            var cachemanager = new CacheManager<ImageModel>("Images", 60 * 6); // 6 hours?
            cachemanager.Clear();
        }
开发者ID:Roballen,项目名称:SusannahStorch,代码行数:8,代码来源:Global.asax.cs


示例20: TestInitialize

		public void TestInitialize()
        {
			CacheManagerFactory factory = new CacheManagerFactory(TestConfigurationSource.GenerateConfiguration());
			cache = factory.Create("InDatabasePersistence");
			cache.Flush();
            wasCalledBack = false;
            initializationCount = 0;
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:8,代码来源:PersistentCacheFeatureFixture.cs



注:本文中的CacheManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CacheStorage类代码示例发布时间:2022-05-24
下一篇:
C# CacheList类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap