コード例 #1
0
            /// <summary>
            /// Sets the value of the tracking property based on stored value of the DisplayName property.
            /// </summary>
            internal void ResetValue(NamedElementSchema element)
            {
                string calculatedValue = null;

                try
                {
                    calculatedValue = element.CalculateDisplayNameTrackingValue();
                }
                catch (NullReferenceException)
                {
                }
                catch (System.Exception e)
                {
                    if (ErrorHandler.IsCriticalException(e))
                    {
                        throw;
                    }
                }

                if (calculatedValue != null)
                {
                    if (string.Equals(element.DisplayName, calculatedValue, StringComparison.Ordinal) ||
                        string.IsNullOrEmpty(element.DisplayName))
                    {
                        element.isDisplayNameTrackingPropertyStorage = true;
                    }
                }
            }
コード例 #2
0
 /// <summary>
 /// Called after the IsDisplayNameTracking property changes.
 /// </summary>
 protected override void OnValueChanged(NamedElementSchema element, bool oldValue, bool newValue)
 {
     base.OnValueChanged(element, oldValue, newValue);
     if (!element.Store.InUndoRedoOrRollback && newValue)
     {
         DomainPropertyInfo propInfo =
             element.Store.DomainDataDirectory.GetDomainProperty(
                 NamedElementSchema.DisplayNameDomainPropertyId);
         propInfo.NotifyValueChange(element);
     }
 }
コード例 #3
0
 /// <summary>
 /// Preset the value of the tracking property as it is not serialized.
 /// </summary>
 internal void PreResetValue(NamedElementSchema element)
 {
     // Force the tracking property to false so that the value
     // of the DisplayName property is retrieved from storage.
     element.isDisplayNameTrackingPropertyStorage = false;
 }
コード例 #4
0
 /// <summary>
 /// Called after the IsDisplayNameTracking property changes.
 /// </summary>
 protected override void OnValueChanged(NamedElementSchema element, bool oldValue, bool newValue)
 {
     base.OnValueChanged(element, oldValue, newValue);
     if (!element.Store.InUndoRedoOrRollback && newValue)
     {
         DomainPropertyInfo propInfo =
             element.Store.DomainDataDirectory.GetDomainProperty(
                 NamedElementSchema.DisplayNameDomainPropertyId);
         propInfo.NotifyValueChange(element);
     }
 }
コード例 #5
0
 /// <summary>
 /// Preset the value of the tracking property as it is not serialized.
 /// </summary>
 internal void PreResetValue(NamedElementSchema element)
 {
     // Force the tracking property to false so that the value
     // of the DisplayName property is retrieved from storage.
     element.isDisplayNameTrackingPropertyStorage = false;
 }
コード例 #6
0
            /// <summary>
            /// Sets the value of the tracking property based on stored value of the DisplayName property.
            /// </summary>
            internal void ResetValue(NamedElementSchema element)
            {
                string calculatedValue = null;

                try
                {
                    calculatedValue = element.CalculateDisplayNameTrackingValue();
                }
                catch (NullReferenceException)
                {
                }
                catch (System.Exception e)
                {
                    if (ErrorHandler.IsCriticalException(e))
                    {
                        throw;
                    }
                }

                if (calculatedValue != null)
                {
                    if (string.Equals(element.DisplayName, calculatedValue, StringComparison.Ordinal)
                        || string.IsNullOrEmpty(element.DisplayName))
                    {
                        element.isDisplayNameTrackingPropertyStorage = true;
                    }
                }
            }