private void AddDetail(ILogDetail logDetail) { if (logDetail is IAttributeUpdate) { IAttributeUpdate attributeUpdate = (IAttributeUpdate)logDetail; AddDetail("Attribute update", "[" + attributeUpdate.Attribute.Name + "]</b> to <b>[" + attributeUpdate.GetValue() + "]"); } else if (logDetail is IMessage) { IMessage message = (IMessage)logDetail; AddDetail("Message", message.MessageText); } else if (logDetail is IDelegateCall) { IDelegateCall delegateCall = (IDelegateCall)logDetail; // FIXME: why this could be null? if (delegateCall.GetInterface() != null) { AddDetail("Action handler", delegateCall.GetInterface().FullName); } } else if (logDetail is IExceptionReport) { IExceptionReport exceptionReport = (IExceptionReport)logDetail; AddDetail("<font color=red>Exception</font>", "<font color=red>" + exceptionReport.ExceptionMessage + "</font>"); } else if (logDetail is IObjectReference) { IObjectReference objectReference = (IObjectReference)logDetail; System.Object object_Renamed = objectReference.GetObject(); if (object_Renamed is IActivityState) { IActivityState activityState = (IActivityState)object_Renamed; AddDetail("Activitystate", activityState.Name); } else { log.Warn("unknown object reference type : " + object_Renamed); } } else { log.Warn("unknown log-detail type : " + logDetail); } }
public virtual IList GetObjectReferences(String className) { IList objectReferences = new ArrayList(); IEnumerator iter = this._details.GetEnumerator(); while (iter.MoveNext()) { ILogDetail logDetail = (ILogDetail)iter.Current; if (logDetail is ObjectReferenceImpl) { ObjectReferenceImpl objectReference = (ObjectReferenceImpl)logDetail; if (objectReference.ClassName.IndexOf(className) != -1) { objectReferences.Add(objectReference); } } } return(objectReferences); }
private void AddDetail(ILogDetail logDetail) { if (logDetail is IAttributeUpdate) { IAttributeUpdate attributeUpdate = (IAttributeUpdate) logDetail; AddDetail("Attribute update", "[" + attributeUpdate.Attribute.Name + "]</b> to <b>[" + attributeUpdate.GetValue() + "]"); } else if (logDetail is IMessage) { IMessage message = (IMessage) logDetail; AddDetail("Message", message.MessageText); } else if (logDetail is IDelegateCall) { IDelegateCall delegateCall = (IDelegateCall) logDetail; // FIXME: why this could be null? if (delegateCall.GetInterface() != null) { AddDetail("Action handler", delegateCall.GetInterface().FullName); } } else if (logDetail is IExceptionReport) { IExceptionReport exceptionReport = (IExceptionReport) logDetail; AddDetail("<font color=red>Exception</font>", "<font color=red>" + exceptionReport.ExceptionMessage + "</font>"); } else if (logDetail is IObjectReference) { IObjectReference objectReference = (IObjectReference) logDetail; System.Object object_Renamed = objectReference.GetObject(); if (object_Renamed is IActivityState) { IActivityState activityState = (IActivityState) object_Renamed; AddDetail("Activitystate", activityState.Name); } else { log.Warn("unknown object reference type : " + object_Renamed); } } else { log.Warn("unknown log-detail type : " + logDetail); } }