public static void ReportExpectedCue(string context, AnimationSet animationSet, Animation animation = null, int frame = -1) { ExpectedCueInfo eci = new ExpectedCueInfo { context = context, animationSet = animationSet, animation = animation, frame = frame }; bool added; lock (expectedCues) added = expectedCues.Add(eci); if (added) { string format; if (animation == null) { format = "Expected cue for \"{0}\" on AnimationSet = {1}"; } else if (frame == -1) { format = "Expected cue for \"{0}\" on Animation = {2} (AnimationSet = {1})"; } else { format = "Expected cue for \"{0}\" on Frame = {3} (AnimationSet = {1}, Animation = {2})"; } string message = string.Format(format, context, animationSet == null ? "???" : animationSet.friendlyName, animation == null ? "???" : animation.friendlyName, frame); Debug.WriteLine(message); Log.Current.Warn(message); } }
public override bool Equals(object obj) { ExpectedCueInfo other = obj as ExpectedCueInfo; if (other == null) { return(false); } return(context == other.context && ReferenceEquals(animationSet, other.animationSet) && ReferenceEquals(animationSet, other.animationSet) && frame == other.frame); }
public static void ReportExpectedCue(string context, params object[] args) { var eci = new ExpectedCueInfo { context = context, args = args }; bool added; lock (ExpectedCues) { added = ExpectedCues.Add(eci); } if (added) { AnimationSet animationSet = args[0] as AnimationSet; Animation animation = args[1] as Animation; int frame = (int)args[2]; string format; if (animation == null) { format = "Expected cue for \"{0}\" on AnimationSet = {1}"; } else if (frame == -1) { format = "Expected cue for \"{0}\" on Animation = {2} (AnimationSet = {1})"; } else { format = "Expected cue for \"{0}\" on Frame = {3} (AnimationSet = {1}, Animation = {2})"; } string message = string.Format(format, context, animationSet == null ? "???" : animationSet.friendlyName, animation == null ? "???" : animation.friendlyName, frame); Debug.WriteLine(message); Log.Current.Warn(message); } }