internal void AsyncReadyCallback(LegendOptionsPanel.CallbackIgnorinator ci) { if (ci == this.waitingForCI) { this.UpdatePreviewPanel(); } }
public void Configure(Legend legend, IDisplayableSource displayableSource) { Monitor.Enter(this); try { if (this.previewInterest != null) { this.previewInterest.Dispose(); this.previewInterest = null; this.waitingForCI = null; } } finally { Monitor.Exit(this); } if (this._legend == legend) { return; } if (this._legend != null) { this._legend.dirtyEvent.Remove(new DirtyListener(this.LegendChanged)); } this._legend = legend; this.displayableSource = displayableSource; if (this._legend != null) { this._legend.dirtyEvent.Add(new DirtyListener(this.LegendChanged)); this.LegendChanged(); } base.Enabled = (this._legend != null); this.UpdatePreviewImage(null); this.UpdatePreviewPanel(); }
private void HandleUpdate() { if (!this.needUpdate) { return; } this.needUpdate = false; Monitor.Enter(this); try { if (this.previewInterest != null) { this.previewInterest.Dispose(); this.previewInterest = null; this.waitingForCI = null; } if (this._legend != null) { try { IFuture renderedLegendFuture = this._legend.GetRenderedLegendFuture(this.displayableSource, (FutureFeatures)5); if (this.previewFuture != renderedLegendFuture) { this.previewFuture = renderedLegendFuture; AsyncRef asyncRef = (AsyncRef)renderedLegendFuture.Realize("LegendOptionsPanel.UpdatePreviewPanel"); if (asyncRef.present == null) { this.waitingForCI = new LegendOptionsPanel.CallbackIgnorinator(this); asyncRef.AddCallback(new AsyncRecord.CompleteCallback(this.waitingForCI.Callback)); asyncRef.SetInterest(524296); this.previewInterest = new InterestList(); this.previewInterest.Add(asyncRef); this.previewInterest.Activate(); this.UpdatePreviewImage(null); } else { if (asyncRef.present is ImageRef) { this.UpdatePreviewImage((ImageRef)asyncRef.present); } } } } catch (Legend.RenderFailedException) { } } } finally { Monitor.Exit(this); } }