1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 // ------------------------------------------------------------------------------
5 // Changes to this file must follow the http://aka.ms/api-review process.
6 // ------------------------------------------------------------------------------
7 
8 namespace System.Runtime.Caching
9 {
10     public abstract partial class CacheEntryChangeMonitor : System.Runtime.Caching.ChangeMonitor
11     {
CacheEntryChangeMonitor()12         protected CacheEntryChangeMonitor() { }
13         public abstract System.Collections.ObjectModel.ReadOnlyCollection<string> CacheKeys { get; }
14         public abstract System.DateTimeOffset LastModified { get; }
15         public abstract string RegionName { get; }
16     }
17     public partial class CacheEntryRemovedArguments
18     {
CacheEntryRemovedArguments(System.Runtime.Caching.ObjectCache source, System.Runtime.Caching.CacheEntryRemovedReason reason, System.Runtime.Caching.CacheItem cacheItem)19         public CacheEntryRemovedArguments(System.Runtime.Caching.ObjectCache source, System.Runtime.Caching.CacheEntryRemovedReason reason, System.Runtime.Caching.CacheItem cacheItem) { }
20         public System.Runtime.Caching.CacheItem CacheItem { get { throw null; } }
21         public System.Runtime.Caching.CacheEntryRemovedReason RemovedReason { get { throw null; } }
22         public System.Runtime.Caching.ObjectCache Source { get { throw null; } }
23     }
CacheEntryRemovedCallback(System.Runtime.Caching.CacheEntryRemovedArguments arguments)24     public delegate void CacheEntryRemovedCallback(System.Runtime.Caching.CacheEntryRemovedArguments arguments);
25     public enum CacheEntryRemovedReason
26     {
27         CacheSpecificEviction = 4,
28         ChangeMonitorChanged = 3,
29         Evicted = 2,
30         Expired = 1,
31         Removed = 0,
32     }
33     public partial class CacheEntryUpdateArguments
34     {
CacheEntryUpdateArguments(System.Runtime.Caching.ObjectCache source, System.Runtime.Caching.CacheEntryRemovedReason reason, string key, string regionName)35         public CacheEntryUpdateArguments(System.Runtime.Caching.ObjectCache source, System.Runtime.Caching.CacheEntryRemovedReason reason, string key, string regionName) { }
36         public string Key { get { throw null; } }
37         public string RegionName { get { throw null; } }
38         public System.Runtime.Caching.CacheEntryRemovedReason RemovedReason { get { throw null; } }
39         public System.Runtime.Caching.ObjectCache Source { get { throw null; } }
40         public System.Runtime.Caching.CacheItem UpdatedCacheItem { get { throw null; } set { } }
41         public System.Runtime.Caching.CacheItemPolicy UpdatedCacheItemPolicy { get { throw null; } set { } }
42     }
CacheEntryUpdateCallback(System.Runtime.Caching.CacheEntryUpdateArguments arguments)43     public delegate void CacheEntryUpdateCallback(System.Runtime.Caching.CacheEntryUpdateArguments arguments);
44     public partial class CacheItem
45     {
CacheItem(string key)46         public CacheItem(string key) { }
CacheItem(string key, object value)47         public CacheItem(string key, object value) { }
CacheItem(string key, object value, string regionName)48         public CacheItem(string key, object value, string regionName) { }
49         public string Key { get { throw null; } set { } }
50         public string RegionName { get { throw null; } set { } }
51         public object Value { get { throw null; } set { } }
52     }
53     public partial class CacheItemPolicy
54     {
CacheItemPolicy()55         public CacheItemPolicy() { }
56         public System.DateTimeOffset AbsoluteExpiration { get { throw null; } set { } }
57         public System.Collections.ObjectModel.Collection<System.Runtime.Caching.ChangeMonitor> ChangeMonitors { get { throw null; } }
58         public System.Runtime.Caching.CacheItemPriority Priority { get { throw null; } set { } }
59         public System.Runtime.Caching.CacheEntryRemovedCallback RemovedCallback { get { throw null; } set { } }
60         public System.TimeSpan SlidingExpiration { get { throw null; } set { } }
61         public System.Runtime.Caching.CacheEntryUpdateCallback UpdateCallback { get { throw null; } set { } }
62     }
63     public enum CacheItemPriority
64     {
65         Default = 0,
66         NotRemovable = 1,
67     }
68     public abstract partial class ChangeMonitor : System.IDisposable
69     {
ChangeMonitor()70         protected ChangeMonitor() { }
71         public bool HasChanged { get { throw null; } }
72         public bool IsDisposed { get { throw null; } }
73         public abstract string UniqueId { get; }
Dispose()74         public void Dispose() { }
Dispose(bool disposing)75         protected abstract void Dispose(bool disposing);
InitializationComplete()76         protected void InitializationComplete() { }
NotifyOnChanged(System.Runtime.Caching.OnChangedCallback onChangedCallback)77         public void NotifyOnChanged(System.Runtime.Caching.OnChangedCallback onChangedCallback) { }
OnChanged(object state)78         protected void OnChanged(object state) { }
79     }
80     [System.FlagsAttribute]
81     public enum DefaultCacheCapabilities
82     {
83         AbsoluteExpirations = 8,
84         CacheEntryChangeMonitors = 4,
85         CacheEntryRemovedCallback = 64,
86         CacheEntryUpdateCallback = 32,
87         CacheRegions = 128,
88         InMemoryProvider = 1,
89         None = 0,
90         OutOfProcessProvider = 2,
91         SlidingExpirations = 16,
92     }
93     public abstract partial class FileChangeMonitor : System.Runtime.Caching.ChangeMonitor
94     {
FileChangeMonitor()95         protected FileChangeMonitor() { }
96         public abstract System.Collections.ObjectModel.ReadOnlyCollection<string> FilePaths { get; }
97         public abstract System.DateTimeOffset LastModified { get; }
98     }
99     public sealed partial class HostFileChangeMonitor : System.Runtime.Caching.FileChangeMonitor
100     {
HostFileChangeMonitor(System.Collections.Generic.IList<string> filePaths)101         public HostFileChangeMonitor(System.Collections.Generic.IList<string> filePaths) { }
102         public override System.Collections.ObjectModel.ReadOnlyCollection<string> FilePaths { get { throw null; } }
103         public override System.DateTimeOffset LastModified { get { throw null; } }
104         public override string UniqueId { get { throw null; } }
Dispose(bool disposing)105         protected override void Dispose(bool disposing) { }
106     }
107     public partial class MemoryCache : System.Runtime.Caching.ObjectCache, System.Collections.IEnumerable, System.IDisposable
108     {
MemoryCache(string name, System.Collections.Specialized.NameValueCollection config=null)109         public MemoryCache(string name, System.Collections.Specialized.NameValueCollection config=null) { }
MemoryCache(string name, System.Collections.Specialized.NameValueCollection config, bool ignoreConfigSection)110         public MemoryCache(string name, System.Collections.Specialized.NameValueCollection config, bool ignoreConfigSection) { }
111         public long CacheMemoryLimit { get { throw null; } }
112         public static System.Runtime.Caching.MemoryCache Default { get { throw null; } }
113         public override System.Runtime.Caching.DefaultCacheCapabilities DefaultCacheCapabilities { get { throw null; } }
114         public override object this[string key] { get { throw null; } set { } }
115         public override string Name { get { throw null; } }
116         public long PhysicalMemoryLimit { get { throw null; } }
117         public System.TimeSpan PollingInterval { get { throw null; } }
Add(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy)118         public override bool Add(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy) { throw null; }
AddOrGetExisting(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy)119         public override System.Runtime.Caching.CacheItem AddOrGetExisting(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy) { throw null; }
AddOrGetExisting(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null)120         public override object AddOrGetExisting(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null) { throw null; }
AddOrGetExisting(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null)121         public override object AddOrGetExisting(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null) { throw null; }
Contains(string key, string regionName=null)122         public override bool Contains(string key, string regionName=null) { throw null; }
CreateCacheEntryChangeMonitor(System.Collections.Generic.IEnumerable<string> keys, string regionName=null)123         public override System.Runtime.Caching.CacheEntryChangeMonitor CreateCacheEntryChangeMonitor(System.Collections.Generic.IEnumerable<string> keys, string regionName=null) { throw null; }
Dispose()124         public void Dispose() { }
Get(string key, string regionName=null)125         public override object Get(string key, string regionName=null) { throw null; }
GetCacheItem(string key, string regionName=null)126         public override System.Runtime.Caching.CacheItem GetCacheItem(string key, string regionName=null) { throw null; }
GetCount(string regionName=null)127         public override long GetCount(string regionName=null) { throw null; }
GetEnumerator()128         protected override System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>> GetEnumerator() { throw null; }
GetLastSize(string regionName=null)129         public long GetLastSize(string regionName=null) { throw null; }
GetValues(System.Collections.Generic.IEnumerable<string> keys, string regionName=null)130         public override System.Collections.Generic.IDictionary<string, object> GetValues(System.Collections.Generic.IEnumerable<string> keys, string regionName=null) { throw null; }
Remove(string key, System.Runtime.Caching.CacheEntryRemovedReason reason, string regionName=null)131         public object Remove(string key, System.Runtime.Caching.CacheEntryRemovedReason reason, string regionName=null) { throw null; }
Remove(string key, string regionName=null)132         public override object Remove(string key, string regionName=null) { throw null; }
Set(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy)133         public override void Set(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy) { }
Set(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null)134         public override void Set(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null) { }
Set(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null)135         public override void Set(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null) { }
System.Collections.IEnumerable.GetEnumerator()136         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
Trim(int percent)137         public long Trim(int percent) { throw null; }
138     }
139     public abstract partial class ObjectCache : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>, System.Collections.IEnumerable
140     {
141         public static readonly System.DateTimeOffset InfiniteAbsoluteExpiration;
142         public static readonly System.TimeSpan NoSlidingExpiration;
ObjectCache()143         protected ObjectCache() { }
144         public abstract System.Runtime.Caching.DefaultCacheCapabilities DefaultCacheCapabilities { get; }
145         public static System.IServiceProvider Host { get { throw null; } set { } }
146         public abstract object this[string key] { get; set; }
147         public abstract string Name { get; }
Add(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy)148         public virtual bool Add(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy) { throw null; }
Add(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null)149         public virtual bool Add(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null) { throw null; }
Add(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null)150         public virtual bool Add(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null) { throw null; }
AddOrGetExisting(System.Runtime.Caching.CacheItem value, System.Runtime.Caching.CacheItemPolicy policy)151         public abstract System.Runtime.Caching.CacheItem AddOrGetExisting(System.Runtime.Caching.CacheItem value, System.Runtime.Caching.CacheItemPolicy policy);
AddOrGetExisting(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null)152         public abstract object AddOrGetExisting(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null);
AddOrGetExisting(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null)153         public abstract object AddOrGetExisting(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null);
Contains(string key, string regionName=null)154         public abstract bool Contains(string key, string regionName=null);
CreateCacheEntryChangeMonitor(System.Collections.Generic.IEnumerable<string> keys, string regionName=null)155         public abstract System.Runtime.Caching.CacheEntryChangeMonitor CreateCacheEntryChangeMonitor(System.Collections.Generic.IEnumerable<string> keys, string regionName=null);
Get(string key, string regionName=null)156         public abstract object Get(string key, string regionName=null);
GetCacheItem(string key, string regionName=null)157         public abstract System.Runtime.Caching.CacheItem GetCacheItem(string key, string regionName=null);
GetCount(string regionName=null)158         public abstract long GetCount(string regionName=null);
GetEnumerator()159         protected abstract System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>> GetEnumerator();
GetValues(System.Collections.Generic.IEnumerable<string> keys, string regionName=null)160         public abstract System.Collections.Generic.IDictionary<string, object> GetValues(System.Collections.Generic.IEnumerable<string> keys, string regionName=null);
GetValues(string regionName, params string[] keys)161         public virtual System.Collections.Generic.IDictionary<string, object> GetValues(string regionName, params string[] keys) { throw null; }
Remove(string key, string regionName=null)162         public abstract object Remove(string key, string regionName=null);
Set(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy)163         public abstract void Set(System.Runtime.Caching.CacheItem item, System.Runtime.Caching.CacheItemPolicy policy);
Set(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null)164         public abstract void Set(string key, object value, System.DateTimeOffset absoluteExpiration, string regionName=null);
Set(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null)165         public abstract void Set(string key, object value, System.Runtime.Caching.CacheItemPolicy policy, string regionName=null);
GetEnumerator()166         System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, object>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.GetEnumerator() { throw null; }
System.Collections.IEnumerable.GetEnumerator()167         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
168     }
OnChangedCallback(object state)169     public delegate void OnChangedCallback(object state);
170 }
171 namespace System.Runtime.Caching.Hosting
172 {
173     public partial interface IApplicationIdentifier
174     {
GetApplicationId()175         string GetApplicationId();
176     }
177     public partial interface IFileChangeNotificationSystem
178     {
StartMonitoring(string filePath, System.Runtime.Caching.OnChangedCallback onChangedCallback, out object state, out System.DateTimeOffset lastWriteTime, out long fileSize)179         void StartMonitoring(string filePath, System.Runtime.Caching.OnChangedCallback onChangedCallback, out object state, out System.DateTimeOffset lastWriteTime, out long fileSize);
StopMonitoring(string filePath, object state)180         void StopMonitoring(string filePath, object state);
181     }
182     public partial interface IMemoryCacheManager
183     {
ReleaseCache(System.Runtime.Caching.MemoryCache cache)184         void ReleaseCache(System.Runtime.Caching.MemoryCache cache);
UpdateCacheSize(long size, System.Runtime.Caching.MemoryCache cache)185         void UpdateCacheSize(long size, System.Runtime.Caching.MemoryCache cache);
186     }
187 }
188