Ejemplo n.º 1
0
 internal void AsyncReadyCallback(LegendOptionsPanel.CallbackIgnorinator ci)
 {
     if (ci == this.waitingForCI)
     {
         this.UpdatePreviewPanel();
     }
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
		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);
			}
		}
Ejemplo n.º 5
0
		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();
		}