Example #1
0
 /// <summary>
 /// Called when properties on the <see cref="ControlGraphic.Subject"/> have changed.
 /// </summary>
 protected virtual void OnSubjectChanged(VisualStatePropertyKind propertyKind)
 {
     if (propertyKind == VisualStatePropertyKind.Geometry || propertyKind == VisualStatePropertyKind.Unspecified)
     {
         SetCalloutLocation();
     }
 }
Example #2
0
        /// <summary>
        /// Called when properties on the <see cref="ControlGraphic.Subject"/> have changed.
        /// </summary>
        protected override sealed void OnSubjectChanged(VisualStatePropertyKind propertyKind)
        {
            if (propertyKind == VisualStatePropertyKind.Geometry)
            {
                if (this.DecoratedGraphic is IControlGraphic && SynchronizationContext.Current != null)
                {
                    //we can't use the DelayedEventPublisher because that relies on the sync context,
                    //and we use graphics on worker threads for avi export ... so, we'll just do it custom.
                    lock (_syncLock)
                    {
                        _lastChange = Environment.TickCount;
                    }

                    if (_uiThreadContext == null)
                    {
                        _uiThreadContext = SynchronizationContext.Current;
                        ThreadPool.QueueUserWorkItem(DelayedEventThread);
                    }

                    Analyze(true);
                }
                else
                {
                    // the roi is inactive, focused or selected, but not actively
                    // moving or stretching; just do the calculation immediately.
                    Analyze(false);
                }
                OnRoiChanged();
            }
            base.OnSubjectChanged(propertyKind);
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VisualStateChangedEventArgs"/> class.
 /// </summary>
 /// <param name="graphic">The graphic whose visual state changed.</param>
 /// <param name="propertyName">The name of the property that changed. </param>
 /// <param name="propertyKind">The kind of the property that changed.</param>
 public VisualStateChangedEventArgs(IGraphic graphic, string propertyName, VisualStatePropertyKind propertyKind = VisualStatePropertyKind.Unspecified)
     : base(propertyName)
 {
     _graphic      = graphic;
     _propertyKind = propertyKind;
 }
		/// <summary>
		/// Called when properties on the <see cref="ControlGraphic.Subject"/> have changed.
		/// </summary>
		protected virtual void OnSubjectChanged(VisualStatePropertyKind propertyKind)
		{
			if (propertyKind == VisualStatePropertyKind.Geometry || propertyKind == VisualStatePropertyKind.Unspecified)
				SetCalloutLocation();
		}
Example #5
0
 /// <summary>
 /// Fires the <see cref="VisualStateChanged"/> event.
 /// </summary>
 /// <param name="propertyName">The name of the property whose value changed.</param>
 /// <param name="propertyKind">The kind of the property whose value changed.</param>
 protected void NotifyVisualStateChanged(string propertyName, VisualStatePropertyKind propertyKind = VisualStatePropertyKind.Unspecified)
 {
     this.OnVisualStateChanged(propertyName);
     EventsHelper.Fire(_visualStateChanged, this, new VisualStateChangedEventArgs(this, propertyName, propertyKind));
 }
Example #6
0
		/// <summary>
		/// Fires the <see cref="VisualStateChanged"/> event.
		/// </summary>
		/// <param name="propertyName">The name of the property whose value changed.</param>
		/// <param name="propertyKind">The kind of the property whose value changed.</param>
		protected void NotifyVisualStateChanged(string propertyName, VisualStatePropertyKind propertyKind = VisualStatePropertyKind.Unspecified)
		{
			OnVisualStateChanged(propertyName);
			FireVisualStateChanged(new VisualStateChangedEventArgs(this, propertyName, propertyKind));
		}
Example #7
0
 /// <summary>
 /// Fires the <see cref="VisualStateChanged"/> event.
 /// </summary>
 /// <param name="propertyName">The name of the property whose value changed.</param>
 /// <param name="propertyKind">The kind of the property whose value changed.</param>
 protected void NotifyVisualStateChanged(string propertyName, VisualStatePropertyKind propertyKind = VisualStatePropertyKind.Unspecified)
 {
     OnVisualStateChanged(propertyName);
     FireVisualStateChanged(new VisualStateChangedEventArgs(this, propertyName, propertyKind));
 }
Example #8
0
		/// <summary>
		/// Fires the <see cref="VisualStateChanged"/> event.
		/// </summary>
		/// <param name="propertyName">The name of the property whose value changed.</param>
		/// <param name="propertyKind">The kind of the property whose value changed.</param>
		protected void NotifyVisualStateChanged(string propertyName, VisualStatePropertyKind propertyKind = VisualStatePropertyKind.Unspecified)
		{
			this.OnVisualStateChanged(propertyName);
			EventsHelper.Fire(_visualStateChanged, this, new VisualStateChangedEventArgs(this, propertyName, propertyKind));
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="VisualStateChangedEventArgs"/> class. 
		/// </summary>
		/// <param name="graphic">The graphic whose visual state changed.</param>
		/// <param name="propertyName">The name of the property that changed. </param>
		/// <param name="propertyKind">The kind of the property that changed.</param>
		public VisualStateChangedEventArgs(IGraphic graphic, string propertyName, VisualStatePropertyKind propertyKind = VisualStatePropertyKind.Unspecified)
			: base(propertyName)
		{
			_graphic = graphic;
			_propertyKind = propertyKind;
		}
Example #10
0
		/// <summary>
		/// Called when properties on the <see cref="ControlGraphic.Subject"/> have changed.
		/// </summary>
		protected override sealed void OnSubjectChanged(VisualStatePropertyKind propertyKind)
		{
			if (propertyKind == VisualStatePropertyKind.Geometry)
			{
				if (this.DecoratedGraphic is IControlGraphic && SynchronizationContext.Current != null)
				{
					//we can't use the DelayedEventPublisher because that relies on the sync context,
					//and we use graphics on worker threads for avi export ... so, we'll just do it custom.
					lock (_syncLock)
					{
						_lastChange = Environment.TickCount;
					}

					if (_uiThreadContext == null)
					{
						_uiThreadContext = SynchronizationContext.Current;
						ThreadPool.QueueUserWorkItem(DelayedEventThread);
					}

					Analyze(true);
				}
				else
				{
					// the roi is inactive, focused or selected, but not actively
					// moving or stretching; just do the calculation immediately.
					Analyze(false);
				}
				OnRoiChanged();
			}
			base.OnSubjectChanged(propertyKind);
		}