本文整理汇总了C#中IFuture类的典型用法代码示例。如果您正苦于以下问题:C# IFuture类的具体用法?C# IFuture怎么用?C# IFuture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFuture类属于命名空间,在下文中一共展示了IFuture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueueStep
void ISchedulable.Schedule(TaskScheduler scheduler, IFuture future)
{
_Future = future;
_Scheduler = scheduler;
_Future.RegisterOnDispose(this.OnDisposed);
QueueStep();
}
示例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);
}
示例3: Menu
public Menu(Game game, string description, IFuture future, params IMenuItem[] items)
{
Game = game;
Description = description;
Font = game.UIText;
Items.AddRange(items);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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");
}
示例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;
}
示例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();
}
示例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);
}
示例11: QueueStepOnComplete
void QueueStepOnComplete (IFuture f) {
if (_WakeDiscardingResult && f.Failed) {
Abort(f.Error);
return;
}
if (WakeCondition != null) {
_WakePrevious = WakeCondition;
WakeCondition = null;
}
_Scheduler.QueueWorkItem(_Step);
}
示例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;
}
示例13: Flush
public void Flush()
{
this.cachedCoordSys = null;
this.cachedRendererCredit = null;
this.cachedUserBounds = null;
this.cachedImageRequest = null;
}
示例14: 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;
}
}
示例15: 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);
}
}