当前位置: 首页>>代码示例>>C#>>正文


C# ObjectCache类代码示例

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


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

示例1: ReflectionOnlyAssemblyLoader

 public ReflectionOnlyAssemblyLoader(ObjectCache cache, IEnumerable<string> assemblyLocation)
 {
     this._cache = cache;
     this._locations = assemblyLocation.ToArray();
     this._loadedAssemblies = new HashSet<Assembly>();
     AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += this.OnFailedAssemblyResolve;
 }
开发者ID:LBi-Dick,项目名称:LBi.LostDoc,代码行数:7,代码来源:ReflectionOnlyAssemblyLoader.cs

示例2: FilterContext

 public FilterContext(ObjectCache cache, CompositionContainer container, FilterState state, params IAssetFilter[] filters)
 {
     this.Container = container;
     this.Cache = cache;
     this.State = state;
     this._filters = filters;
 }
开发者ID:LBiNetherlands,项目名称:LBi.LostDoc,代码行数:7,代码来源:FilterContext.cs

示例3: ChannelAdvisorServicesFactory

 public ChannelAdvisorServicesFactory( string developerKey, string developerPassword, ObjectCache cache, TimeSpan slidingCacheExpiration )
 {
     this._developerPassword = developerPassword;
     this._developerKey = developerKey;
     this._cache = cache;
     this._slidingCacheExpiration = slidingCacheExpiration;
 }
开发者ID:agileharbor,项目名称:channelAdvisorAccess,代码行数:7,代码来源:ChannelAdvisorServicesFactory.cs

示例4: FilterContext

 public FilterContext(ObjectCache cache, CompositionContainer container, IAssetResolver assetResolver, FilterState state)
 {
     this.Container = container;
     this.Cache = cache;
     this.AssetResolver = assetResolver;
     this.State = state;
 }
开发者ID:ppittle,项目名称:LBi.LostDoc,代码行数:7,代码来源:FilterContext.cs

示例5: CacheUnorderedNeuralVectorProvider

        public CacheUnorderedNeuralVectorProvider(IUnorderedNeuralVectorsProvider baseProvider, ObjectCache cache = null)
        {
            Contract.Requires(baseProvider != null);

            BaseProvider = baseProvider;
            this.cache = cache ?? MemoryCache.Default;
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:7,代码来源:CacheUnorderedNeuralVectorProvider.cs

示例6: RegisterCacheInfrastructure

        public static void RegisterCacheInfrastructure(IKernel kernel, ObjectCache cache, ICacheKeyRegistrationService cacheKeyRegistrationService)
        {
            kernel.Bind<ICacheKeyGenerationService>().To<CacheKeyGenerationService>();
            kernel.Bind<ICacheKeyRegistrationService>().ToConstant(cacheKeyRegistrationService);

            kernel.Bind<ObjectCache>().ToConstant(cache);
        }
开发者ID:asmorger,项目名称:cash,代码行数:7,代码来源:Cash.cs

示例7: Index

        public Index(File file, string name, BiosParameterBlock bpb, UpperCase upCase)
        {
            _file = file;
            _name = name;
            _bpb = bpb;
            _isFileIndex = name == "$I30";

            _blockCache = new ObjectCache<long, IndexBlock>();

            _root = _file.GetStream(AttributeType.IndexRoot, _name).GetContent<IndexRoot>();
            _comparer = _root.GetCollator(upCase);

            using (Stream s = _file.OpenStream(AttributeType.IndexRoot, _name, FileAccess.Read))
            {
                byte[] buffer = Utilities.ReadFully(s, (int)s.Length);
                _rootNode = new IndexNode(WriteRootNodeToDisk, 0, this, true, buffer, IndexRoot.HeaderOffset);

                // Give the attribute some room to breathe, so long as it doesn't squeeze others out
                // BROKEN, BROKEN, BROKEN - how to figure this out?  Query at the point of adding entries to the root node?
                _rootNode.TotalSpaceAvailable += _file.MftRecordFreeSpace(AttributeType.IndexRoot, _name) - 100;
            }

            if (_file.StreamExists(AttributeType.IndexAllocation, _name))
            {
                _indexStream = _file.OpenStream(AttributeType.IndexAllocation, _name, FileAccess.ReadWrite);
            }

            if (_file.StreamExists(AttributeType.Bitmap, _name))
            {
                _indexBitmap = new Bitmap(_file.OpenStream(AttributeType.Bitmap, _name, FileAccess.ReadWrite), long.MaxValue);
            }
        }
开发者ID:alexcmd,项目名称:DiscUtils,代码行数:32,代码来源:Index.cs

示例8: InternalSegmentStream

 /// <summary>
 /// Initializes a new instance of the <see cref="InternalSegmentStream"/> class.
 /// </summary>
 /// <param name="objectCache">The object cache.</param>
 /// <param name="key">The key.</param>
 /// <param name="segmentSize">Size of the segment.</param>
 /// <param name="region">The region.</param>
 public InternalSegmentStream(ObjectCache objectCache, string key, int segmentSize, string region)
 {
     _segmentSize = segmentSize;
     _cache = objectCache;
     _regionKey = new RegionKey { Key = key, Region = region };
     _canRead = true;
     _canWrite = true;
     _canSeek = true;
 }
开发者ID:patrickhuber,项目名称:CacheIt,代码行数:16,代码来源:InternalSegmentStream.cs

示例9: CSharpCodeChecker

        public CSharpCodeChecker(ObjectCache compiledCustomCheckersCache)
        {
            if (compiledCustomCheckersCache == null)
            {
                throw new ArgumentNullException(nameof(compiledCustomCheckersCache));
            }

            this.compiledCustomCheckersCache = compiledCustomCheckersCache;
        }
开发者ID:Teodor92,项目名称:OpenJudgeSystem,代码行数:9,代码来源:CSharpCodeChecker.cs

示例10: NtfsFileSystem

        /// <summary>
        /// Creates a new instance from a stream.
        /// </summary>
        /// <param name="stream">The stream containing the NTFS file system</param>
        public NtfsFileSystem(Stream stream)
            : base(new NtfsOptions())
        {
            _context = new NtfsContext();
            _context.RawStream = stream;
            _context.Options = NtfsOptions;

            _context.GetFileByIndex = GetFile;
            _context.GetFileByRef = GetFile;
            _context.GetDirectoryByRef = GetDirectory;
            _context.GetDirectoryByIndex = GetDirectory;
            _context.AllocateFile = AllocateFile;
            _context.ForgetFile = ForgetFile;
            _context.ReadOnly = !stream.CanWrite;

            _fileCache = new ObjectCache<long, File>();

            stream.Position = 0;
            byte[] bytes = Utilities.ReadFully(stream, 512);


            _context.BiosParameterBlock = BiosParameterBlock.FromBytes(bytes, 0);

            // Bootstrap the Master File Table
            _context.Mft = new MasterFileTable(_context);
            File mftFile = new File(_context, _context.Mft.GetBootstrapRecord());
            _fileCache[MasterFileTable.MftIndex] = mftFile;
            _context.Mft.Initialize(mftFile);

            // Initialize access to the other well-known metadata files
            _context.ClusterBitmap = new ClusterBitmap(GetFile(MasterFileTable.BitmapIndex));
            _context.AttributeDefinitions = new AttributeDefinitions(GetFile(MasterFileTable.AttrDefIndex));
            _context.UpperCase = new UpperCase(GetFile(MasterFileTable.UpCaseIndex));
            _context.SecurityDescriptors = new SecurityDescriptors(GetFile(MasterFileTable.SecureIndex));
            _context.ObjectIds = new ObjectIds(GetFile(GetDirectoryEntry(@"$Extend\$ObjId").Reference));
            _context.ReparsePoints = new ReparsePoints(GetFile(GetDirectoryEntry(@"$Extend\$Reparse").Reference));
            _context.Quotas = new Quotas(GetFile(GetDirectoryEntry(@"$Extend\$Quota").Reference));

            File volumeInfoFile = GetFile(MasterFileTable.VolumeIndex);
            _volumeInfo = volumeInfoFile.GetStream(AttributeType.VolumeInformation, null).GetContent<VolumeInformation>();

#if false
            byte[] buffer = new byte[1024];
            for (int i = 0; i < buffer.Length; ++i)
            {
                buffer[i] = 0xFF;
            }

            using (Stream s = OpenFile("$LogFile", FileMode.Open, FileAccess.ReadWrite))
            {
                while (s.Position != s.Length)
                {
                    s.Write(buffer, 0, (int)Math.Min(buffer.Length, s.Length - s.Position));
                }
            }
#endif
        }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:61,代码来源:NtfsFileSystem.cs

示例11: ObjectCacheAmbientContextManager

        /// <summary>
        /// Initializes a new instance of the <see cref="ObjectCacheAmbientContextManager" /> class.
        /// </summary>
        /// <param name="cache">The cache.</param>
        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="cache"/> is null.</exception>
        public ObjectCacheAmbientContextManager(ObjectCache cache)
        {
            if (cache == null)
            {
                throw new ArgumentNullException("cache");
            }

            _Cache = cache;
        }
开发者ID:chihoyeung,项目名称:NContext,代码行数:14,代码来源:ObjectCacheAmbientContextManager.cs

示例12: Reload

        void Reload()
        {
            MemoryStream ms = new MemoryStream();

            Cache.Save(ms);
            ms.Position = 0;

            Cache = new ObjectCache();
            Cache.Load(ms);
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:10,代码来源:CacheTests.cs

示例13: RoutineManager

        public RoutineManager(ITransaction transaction)
        {
            if (transaction == null)
                throw new ArgumentNullException("transaction");

            routinesCache = new ObjectCache<IRoutine>();

            this.transaction = transaction;
            this.transaction.Context.RouteImmediate<TransactionEvent>(OnTransactionEnd, e => e.EventType != TransactionEventType.Begin);
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:10,代码来源:RoutineManager.cs

示例14: AutoChartingService

 public AutoChartingService(ILogger logger,
                            IConfigurationService configurationService,
                            ITradeIdeasStorage tradeIdeasStorage,
                            ObjectCache cache)
 {
     _logger = logger;
     _cache = cache;
     _configurationService = configurationService;
     _tradeIdeasStorage = tradeIdeasStorage;
 }
开发者ID:evkap,项目名称:MetaPortal,代码行数:10,代码来源:AutoChartingService.cs

示例15: CachedLifetime

		public CachedLifetime(ObjectCache cache, CacheItemPolicy policy)
		{
			if (cache == null)
				throw new ArgumentNullException("cache");
			if (policy == null)
				throw new ArgumentNullException("policy");

			_cache = cache;
			_cachePolicy = policy;
		}
开发者ID:Kingefosa,项目名称:Dynamo.IoC,代码行数:10,代码来源:CachedLifetime.cs


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