本文整理汇总了C#中IFuture类的典型用法代码示例。如果您正苦于以下问题:C# IFuture类的具体用法?C# IFuture怎么用?C# IFuture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFuture类属于命名空间,在下文中一共展示了IFuture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: QueueStep
void ISchedulable.Schedule(TaskScheduler scheduler, IFuture future)
{
_Future = future;
_Scheduler = scheduler;
_Future.RegisterOnDispose(this.OnDisposed);
QueueStep();
}
开发者ID:pakoito,项目名称:Fracture,代码行数:7,代码来源:SchedulableGeneratorThunk.cs
示例2: CacheRecord
public CacheRecord(IFuture future)
{
this.future = future;
this.wait = new CountedEventWaitHandle(false, EventResetMode.ManualReset, "CacheRecord.Wait");
this.refs = 1;
CacheRecord.cacheRecordsExtant.crement(1);
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:7,代码来源:CacheRecord.cs
示例3: Menu
public Menu(Game game, string description, IFuture future, params IMenuItem[] items)
{
Game = game;
Description = description;
Font = game.UIText;
Items.AddRange(items);
}
开发者ID:kg,项目名称:rlms2013,代码行数:8,代码来源:Menu.cs
示例4: GetAccessFuture
private IFuture GetAccessFuture(AccessMethod accessMethod, FutureFeatures openDocFeatures, params IFuture[] methodParams)
{
IFuture[] array = new IFuture[2 + methodParams.Length];
array[0] = this.GetOpenDocumentFuture(openDocFeatures);
array[1] = new ConstantFuture(new IntParameter((int)accessMethod));
Array.Copy(methodParams, 0, array, 2, methodParams.Length);
return new ApplyFuture(new ApplyVerbPresent(), array);
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:8,代码来源:UnwarpedMapTileSource.cs
示例5: RequestRenderRegion
public void RequestRenderRegion(IFuture asynchronousImageBoundsFuture)
{
if (this.renderRegion == null)
{
AsyncRef asyncRef = (AsyncRef)asynchronousImageBoundsFuture.Realize("LatentRegionHolder.RequestRenderRegion");
asyncRef.AddCallback(new AsyncRecord.CompleteCallback(this.ImageBoundsAvailable));
new PersistentInterest(asyncRef);
}
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:9,代码来源:LatentRegionHolder.cs
示例6: GetUserBounds
public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
{
if (this.cachedUserBounds == null || this.lastUserBoundsRequest_latentRegionHolder != latentRegionHolder || this.lastUserBoundsRequest_features != features)
{
this.lastUserBoundsRequest_latentRegionHolder = latentRegionHolder;
this.lastUserBoundsRequest_features = features;
this.cachedUserBounds = this.backingSource.GetUserBounds(latentRegionHolder, features);
}
return this.cachedUserBounds;
}
开发者ID:mikhp,项目名称:greatmaps,代码行数:10,代码来源:DisplayableSourceCache.cs
示例7: AsyncRecord
public AsyncRecord(AsyncScheduler scheduler, IFuture cacheKeyToEvict, IFuture future)
{
this._cacheKeyToEvict = cacheKeyToEvict;
this._future = future;
this.scheduler = scheduler;
this._present = null;
this.asyncState = AsyncState.Prequeued;
this.queuePriority = 0;
this.qtpRef = new AsyncRef(this, "qRef");
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:10,代码来源:AsyncRecord.cs
示例8: GetRenderRegionSynchronously
public RenderRegion GetRenderRegionSynchronously(IFuture synchronousImageBoundsFuture)
{
Present present = synchronousImageBoundsFuture.Realize("LatentRegionHolder.GetRenderRegionSynchronously");
this.StoreRenderRegion(present);
if (this.renderRegion == null)
{
throw new Exception("Render region request failed, gasp: " + present.ToString());
}
return this.renderRegion;
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:10,代码来源:LatentRegionHolder.cs
示例9: ArgumentNullException
void ISchedulable.Schedule(TaskScheduler scheduler, IFuture future)
{
if (future == null)
throw new ArgumentNullException("future");
_Future = future;
_Scheduler = scheduler;
_Future.RegisterOnDispose(this.OnDisposed);
QueueStep();
}
开发者ID:sq,项目名称:Fracture,代码行数:10,代码来源:SchedulableGeneratorThunk.cs
示例10: Get
public override Present Get(IFuture future, string refCredit)
{
if (SizeSensitiveCache.oneEntryAtATime)
{
Present present = base.Lookup(future);
if (present != null)
{
return present;
}
}
return base.Get(future, refCredit);
}
开发者ID:mikhp,项目名称:greatmaps,代码行数:12,代码来源:SizeSensitiveCache.cs
示例11: QueueStepOnComplete
void QueueStepOnComplete (IFuture f) {
if (_WakeDiscardingResult && f.Failed) {
Abort(f.Error);
return;
}
if (WakeCondition != null) {
_WakePrevious = WakeCondition;
WakeCondition = null;
}
_Scheduler.QueueWorkItem(_Step);
}
开发者ID:mbahar94,项目名称:fracture,代码行数:13,代码来源:SchedulableGeneratorThunk.cs
示例12: UserBoundsRefVerb
public UserBoundsRefVerb(LatentRegionHolder latentRegionHolder, IFuture delayedStaticBoundsFuture)
{
RenderRegion renderRegion = latentRegionHolder.renderRegion;
if (renderRegion == null)
{
this.userRegion = null;
}
else
{
this.userRegion = renderRegion.Copy(new DirtyEvent());
}
this.delayedStaticBoundsFuture = delayedStaticBoundsFuture;
}
开发者ID:mikhp,项目名称:greatmaps,代码行数:13,代码来源:UserBoundsRefVerb.cs
示例13: OpenDocumentSensitivePrioritizedFuture
public OpenDocumentSensitivePrioritizedFuture(OpenDocumentSensitivePrioritizer prioritizer, IFuture future, IFuture openDocumentFuture)
{
this.prioritizer = prioritizer;
this.future = future;
this.openDocumentFuture = openDocumentFuture;
object obj;
Monitor.Enter(obj = OpenDocumentSensitivePrioritizedFuture.nextIdentityMutex);
try
{
this._identity = OpenDocumentSensitivePrioritizedFuture.nextIdentity;
OpenDocumentSensitivePrioritizedFuture.nextIdentity++;
}
finally
{
Monitor.Exit(obj);
}
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:17,代码来源:OpenDocumentSensitivePrioritizedFuture.cs
示例14: Get
public Present Get(IFuture future, string refCredit)
{
string text = this.makeCachePathname(future, "fresh.");
string text2 = this.makeCachePathname(future, "stale.");
Monitor.Enter(this);
try
{
long num;
Present present = this.Fetch(text, out num);
if (present != null)
{
D.Sayf(10, "fresh hit! {0}", new object[]
{
"fresh."
});
Present result = present;
return result;
}
present = this.Fetch(text2, out num);
if (present != null)
{
File.Move(text2, text);
this.IncrementFreshCount(num);
D.Sayf(10, "stale hit! {0} {1}", new object[]
{
"stale.",
num
});
Present result = present;
return result;
}
}
finally
{
Monitor.Exit(this);
}
Present result2 = future.Realize(refCredit);
this.ScheduleDeferredWrite(result2, text, future.ToString());
D.Sayf(10, "miss", new object[0]);
return result2;
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:41,代码来源:DiskCache.cs
示例15: Lookup
public Present Lookup(IFuture future)
{
Monitor.Enter(this);
CacheRecord cacheRecord;
try
{
if (!this.cache.ContainsKey(future))
{
return null;
}
cacheRecord = this.cache[future];
this.Touch(cacheRecord, false);
cacheRecord.AddReference();
}
finally
{
Monitor.Exit(this);
}
Present result = cacheRecord.WaitResult("lookup", this.hashName);
cacheRecord.DropReference();
return result;
}
开发者ID:mikhp,项目名称:greatmaps,代码行数:22,代码来源:CacheBase.cs
示例16: Contains
public bool Contains(IFuture future)
{
Monitor.Enter(this);
bool result;
try
{
if (this.cache.ContainsKey(future))
{
this.Touch(this.cache[future], false);
result = true;
}
else
{
result = false;
}
}
finally
{
Monitor.Exit(this);
}
return result;
}
开发者ID:mikhp,项目名称:greatmaps,代码行数:22,代码来源:CacheBase.cs
示例17: Flush
public void Flush()
{
this.cachedCoordSys = null;
this.cachedRendererCredit = null;
this.cachedUserBounds = null;
this.cachedImageRequest = null;
}
开发者ID:mikhp,项目名称:greatmaps,代码行数:7,代码来源:DisplayableSourceCache.cs
示例18: DispatchNewMessage
static void DispatchNewMessage (Peer from, string message) {
_MessageBuilder.Remove(0, _MessageBuilder.Length);
if (from != null) {
_MessageBuilder.Append("<");
_MessageBuilder.Append(from);
_MessageBuilder.Append("> ");
_MessageBuilder.Append(message);
} else {
_MessageBuilder.Append("*** ");
_MessageBuilder.Append(message);
}
Messages.Add(new Message { From = from, Text = message, DisplayText = _MessageBuilder.ToString() });
if (Messages.Count > MaxMessagesToStore) {
int numToRemove = MaxMessagesToStore / 2;
Messages.RemoveRange(0, numToRemove);
MessageIdBase += numToRemove;
}
if (WaitingForMessages != null) {
WaitingForMessages.Complete();
WaitingForMessages = null;
}
}
开发者ID:mbahar94,项目名称:fracture,代码行数:25,代码来源:Program.cs
示例19: ProcessWatcher
public ProcessWatcher(TaskScheduler scheduler, params string[] processNames)
{
Scheduler = scheduler;
foreach (var pname in processNames) {
var invariant = Path.GetFileNameWithoutExtension(pname).ToLowerInvariant();
ProcessNames.Add(invariant);
foreach (var process in Process.GetProcessesByName(invariant)) {
RunningProcessIds.Add(process.Id);
NewProcesses.Enqueue(process);
}
}
try {
var query = new WqlEventQuery(@"SELECT * FROM Win32_ProcessStartTrace");
Watcher = new ManagementEventWatcher(query);
Watcher.Options.BlockSize = 1;
Watcher.EventArrived += new EventArrivedEventHandler(OnEventArrived);
Watcher.Start();
WatcherEnabled = true;
} catch {
Watcher = null;
WatcherEnabled = false;
TimerTask = Scheduler.Start(InitTimer(), TaskExecutionPolicy.RunAsBackgroundTask);
}
}
开发者ID:kg,项目名称:shootblues,代码行数:28,代码来源:ProcessWatcher.cs
示例20: BeginSearch
IEnumerator<object> BeginSearch()
{
ActiveSearchQuery = PendingSearchQuery;
PendingSearchQuery = null;
ActiveSearch = Program.Scheduler.Start(
PerformSearch(ActiveSearchQuery),
TaskExecutionPolicy.RunAsBackgroundTask
);
yield break;
}
开发者ID:BlackFrog1,项目名称:ndexer,代码行数:10,代码来源:FindInFilesDialog.cs
注:本文中的IFuture类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论