Example #1
0
        public override string ToString()
        {
            if (Change == null)
            {
                return("");
            }

            if (Mode == DisplayMode.Value || Mode == DisplayMode.Reference || Mode == DisplayMode.ThreadReference)
            {
                return(((PropertyChange)Change.OriginalEvent).Value);
            }
            if (Mode == DisplayMode.Date)
            {
                if (Change.Output.LogSource.IsDisposed)
                {
                    return("");
                }
                return(Change.Trigger.Timestamp.Adjust(Change.Output.LogSource.TimeOffsets).ToString());
            }
            if (Mode == DisplayMode.UserHash)
            {
                var value = ((PropertyChange)Change.OriginalEvent).Value;
                return(shortNames.AddShortNameToUserHash(value));
            }
            return("");
        }
 void IEventsVisitor.Visit(PropertyChange change)
 {
     message = string.Format("'{0}'->'{1}'", change.PropertyName,
                             change.ValueType == SI.ValueType.UserHash ? shortNames.AddShortNameToUserHash(change.Value) :
                             change.ValueType == SI.ValueType.Reference && currentObject.Owner.TryGetDisplayName(change.Value, out var displayName) ? displayName :
                             change.Value);
 }
Example #3
0
 void IEventsVisitor.Visit(PropertyChange change)
 {
     message = string.Format("'{0}'->'{1}'", change.PropertyName,
                             change.ValueType == SI.ValueType.UserHash ? shortNames.AddShortNameToUserHash(change.Value) : change.Value);
 }